dsh-custom-mode 1.13.0 → 2.0.0
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/README.i18n.yaml +2 -2
- package/README.md +2 -2
- package/README.zh.md +3 -3
- package/client.js +256 -203
- package/composition.mjs +29 -0
- package/index.mjs +95 -8
- package/locales.mjs +163 -144
- package/package.json +2 -1
- package/postures.mjs +74 -0
- package/preset/postures/chat.en.md +7 -0
- package/preset/postures/chat.zh.md +7 -0
- package/preset/postures/write.en.md +7 -0
- package/preset/postures/write.zh.md +7 -0
package/client.js
CHANGED
|
@@ -61,46 +61,54 @@ try {
|
|
|
61
61
|
const ZH = {
|
|
62
62
|
"nav": "自定义模式",
|
|
63
63
|
"assistant.heading": "助手",
|
|
64
|
-
"assistant.hint": "
|
|
64
|
+
"assistant.hint": "每个助手单独保存系统提示词、基础模式和插件开关。",
|
|
65
|
+
"posture.hint": "只用于新建,不改变当前助手。",
|
|
66
|
+
"posture.develop.label": "开发",
|
|
67
|
+
"posture.develop.note": "新建后:标准模式,工具按出厂。",
|
|
68
|
+
"posture.write.label": "写作",
|
|
69
|
+
"posture.write.note": "新建后:终端关闭,文件读写打开。",
|
|
70
|
+
"posture.chat.label": "聊天",
|
|
71
|
+
"posture.chat.note": "新建后:文件和终端关闭。",
|
|
65
72
|
"assistant.empty": "还没有助手,用下面的输入框新建一个。",
|
|
66
73
|
"assistant.loadingList": "正在读取助手列表…",
|
|
67
74
|
"assistant.newPlaceholder": "新助手的名字(例如:写作助手)",
|
|
68
75
|
"assistant.copyName": "「{name}」副本",
|
|
69
76
|
"assistant.broken": "本机无法启动",
|
|
70
77
|
"assistant.brokenRows": "{count} 行在本机不可用",
|
|
71
|
-
"assistant.brokenHint": "
|
|
78
|
+
"assistant.brokenHint": "此模式在本机无法启动,不会出现在新会话菜单里。点「按本线修复」只关闭那些行。",
|
|
72
79
|
"assistant.switchHint": "切换助手保留各自的未保存草稿;列表中的「未保存」标记即为此。",
|
|
73
80
|
"btn.create": "新增助手",
|
|
81
|
+
"create.heading": "新建",
|
|
74
82
|
"btn.creating": "创建中…",
|
|
75
|
-
"btn.duplicate": "
|
|
83
|
+
"btn.duplicate": "复制",
|
|
76
84
|
"btn.moveUp": "上移",
|
|
77
85
|
"btn.moveDown": "下移",
|
|
78
|
-
"btn.import": "
|
|
79
|
-
"btn.export": "
|
|
80
|
-
"btn.reset": "
|
|
81
|
-
"btn.resetHint": "
|
|
82
|
-
"btn.delete": "
|
|
86
|
+
"btn.import": "导入",
|
|
87
|
+
"btn.export": "导出",
|
|
88
|
+
"btn.reset": "恢复出厂",
|
|
89
|
+
"btn.resetHint": "把编辑器换回此助手新建时保存的提示词。只改草稿,保存后才写入。",
|
|
90
|
+
"btn.delete": "删除",
|
|
83
91
|
"btn.cancel": "取消",
|
|
84
|
-
"msg.created": "
|
|
92
|
+
"msg.created": "已创建。刷新后,新会话的模式菜单里会出现它。",
|
|
85
93
|
"msg.duplicated": "已复制。两份配置彼此独立。",
|
|
86
94
|
"msg.deleted": "已删除。",
|
|
87
95
|
"msg.createFailed": "创建失败",
|
|
88
96
|
"msg.deleteFailed": "删除失败",
|
|
89
97
|
"msg.nameRequired": "请先给新助手起个名字。",
|
|
90
98
|
"msg.readOnlyHint": "仅管理本插件创建的助手;手写 preset 不计入,也不会被改写。",
|
|
91
|
-
"msg.reordered": "
|
|
99
|
+
"msg.reordered": "顺序已保存。新会话的模式菜单按此排列。",
|
|
92
100
|
"msg.reorderFailed": "调整顺序失败",
|
|
93
|
-
"msg.imported": "
|
|
101
|
+
"msg.imported": "已导入到编辑器。尚未保存。",
|
|
94
102
|
"msg.importFailed": "导入失败",
|
|
95
103
|
"api.badDirection": "未知的排序方向:{direction}",
|
|
96
|
-
"api.unknownAssistant": "找不到助手「{id}
|
|
104
|
+
"api.unknownAssistant": "找不到助手「{id}」。此页只管理本插件创建的助手。",
|
|
97
105
|
"api.alreadyFirst": "「{name}」已经在最前面。",
|
|
98
106
|
"api.alreadyLast": "「{name}」已经在最后面。",
|
|
99
|
-
"api.badVariableName": "
|
|
100
|
-
"api.unknownVariable": "{variable}
|
|
101
|
-
"mode.unavailable": "
|
|
102
|
-
"rows.unavailable": "
|
|
103
|
-
"mode.pendingRows": "基础模式已改为「{mode}
|
|
107
|
+
"api.badVariableName": "变量 {variable} 不合法。名字用小写字母、数字和下划线,且以字母开头。",
|
|
108
|
+
"api.unknownVariable": "{variable} 不能使用。可用:{known}。",
|
|
109
|
+
"mode.unavailable": "本机读不到出厂组成,基础模式暂不能切换。",
|
|
110
|
+
"rows.unavailable": "本机读不到出厂组成,插件开关暂不能改。磁盘上的现有设置仍然有效。",
|
|
111
|
+
"mode.pendingRows": "基础模式已改为「{mode}」。保存后,工具底换成这套官方预设。",
|
|
104
112
|
"aria.expand": "展开详情",
|
|
105
113
|
"aria.collapse": "收起详情",
|
|
106
114
|
"detail.id": "行 id",
|
|
@@ -117,18 +125,20 @@ try {
|
|
|
117
125
|
"btn.repair": "按本线修复",
|
|
118
126
|
"msg.repaired": "已修复",
|
|
119
127
|
"meta.version": "插件版本",
|
|
120
|
-
"meta.versionHint": "
|
|
121
|
-
"api.saved": "已保存({name}
|
|
122
|
-
"api.savedWithExclusiveRows": "已保存({name}
|
|
123
|
-
"api.created": "已创建「{name}
|
|
128
|
+
"meta.versionHint": "未钉版本时,可能装到较旧的发布。要换版本,按 README 钉版本重装,然后重启。",
|
|
129
|
+
"api.saved": "已保存({name},{mode})。新会话使用新配置,当前会话不变。",
|
|
130
|
+
"api.savedWithExclusiveRows": "已保存({name},{mode})。已关闭不能同时启用的行:{rows}。",
|
|
131
|
+
"api.created": "已创建「{name}」。刷新后,新会话的模式菜单里会出现它。",
|
|
124
132
|
"api.savedPrompt": "已保存系统提示词({name})。下一步模型调用即生效。",
|
|
125
|
-
"api.duplicated": "
|
|
126
|
-
"api.deleted": "已删除「{name}
|
|
127
|
-
"api.reordered": "
|
|
133
|
+
"api.duplicated": "已从「{from}」复制。两份互不影响。",
|
|
134
|
+
"api.deleted": "已删除「{name}」。正在使用它的会话不受影响。",
|
|
135
|
+
"api.reordered": "顺序已保存。新会话的模式菜单按此排列。",
|
|
128
136
|
"api.nameRequired": "请先给新助手起个名字。",
|
|
137
|
+
"api.postureUnknown": "没有这个起步:{posture}。",
|
|
138
|
+
"api.posturePromptMissing": "读不到「{posture}」的起步提示词。",
|
|
129
139
|
"api.nameTooLong": "名字太长了(上限 {max} 个字符)。",
|
|
130
140
|
"api.descriptionTooLong": "描述太长了(上限 {max} 个字符)。",
|
|
131
|
-
"api.promptEmpty": "
|
|
141
|
+
"api.promptEmpty": "不能保存空的系统提示词。",
|
|
132
142
|
"api.badMode": "未知的基础模式:{mode}",
|
|
133
143
|
"api.dirExists": "目录已存在,请换一个名字:{path}",
|
|
134
144
|
"api.compositionMissing": "找不到组成文件:{path}",
|
|
@@ -138,63 +148,63 @@ try {
|
|
|
138
148
|
"api.selfCheckFailed": "生成结果自检失败,已放弃写入:{detail}",
|
|
139
149
|
"api.internalError": "宿主内部错误:{detail}",
|
|
140
150
|
"api.bodyTooLarge": "请求体过大(上限 {max} 字节)",
|
|
141
|
-
"api.repairNotNeeded": "
|
|
142
|
-
"api.repaired": "
|
|
151
|
+
"api.repairNotNeeded": "没有需要修复的行。",
|
|
152
|
+
"api.repaired": "已关闭 {count} 个本机无法启动的行({ids})。",
|
|
143
153
|
"api.badAssistantId": "助手标识不合法:{id}(只能用 a-z、0-9 与连字符)",
|
|
144
154
|
"api.seedFailed": "复制模式模板失败:{detail}",
|
|
145
155
|
"api.metaWriteFailed": "写入 preset.yml 失败:{detail}",
|
|
146
156
|
"api.promptReadFailed": "读取提示词失败:{detail}",
|
|
147
|
-
"api.noRemoveApi": "
|
|
148
|
-
"api.noDirectory": "
|
|
157
|
+
"api.noRemoveApi": "当前版本无法删除助手。",
|
|
158
|
+
"api.noDirectory": "删除失败:磁盘上已没有这个目录。刷新后再试。",
|
|
149
159
|
"api.deleteFailed": "删除失败:{detail}",
|
|
150
160
|
"api.versionMissing": "找不到这个版本(历史可能已被上限裁剪)。",
|
|
151
161
|
"api.badJson": "请求体不是合法 JSON",
|
|
152
|
-
"api.savedPromptOnly": "
|
|
153
|
-
"api.baseCompositionUnavailable": "
|
|
154
|
-
"warn.approvalGateMissing": "
|
|
155
|
-
"warn.unresolvableRows": "
|
|
156
|
-
"warn.presetBroken": "
|
|
157
|
-
"warn.badPromptVariable": "
|
|
158
|
-
"warn.duplicateRowIds": "组成文件里有重复的行 id
|
|
159
|
-
"warn.predicateFailed": "
|
|
160
|
-
"warn.exclusiveRowsActive": "
|
|
161
|
-
"warn.baseCompositionUnavailable": "
|
|
162
|
-
"warn.personaOffWithPrompt": "
|
|
163
|
-
"warn.toolOff": "
|
|
164
|
-
"warn.noDescription": "
|
|
165
|
-
"warn.noName": "
|
|
162
|
+
"api.savedPromptOnly": "已保存系统提示词。基础模式和插件开关未改。",
|
|
163
|
+
"api.baseCompositionUnavailable": "读不到基础模式「{mode}」的出厂组成。开关未改。系统提示词可以单独保存。",
|
|
164
|
+
"warn.approvalGateMissing": "当前版本没有审批事件。会话内改写提示词不会请求确认。",
|
|
165
|
+
"warn.unresolvableRows": "有的行在本机无法启动,此模式不会出现在新会话菜单里。点「按本线修复」只关闭那些行。",
|
|
166
|
+
"warn.presetBroken": "此模式无法启动,不会出现在新会话菜单里。点「按本线修复」。原因见下一行。",
|
|
167
|
+
"warn.badPromptVariable": "提示词里有不可用的变量。改掉后再保存,否则此模式的请求会失败。",
|
|
168
|
+
"warn.duplicateRowIds": "组成文件里有重复的行 id。开关只作用于第一处。",
|
|
169
|
+
"warn.predicateFailed": "有一行的平台条件无法计算,已按关闭处理。",
|
|
170
|
+
"warn.exclusiveRowsActive": "两套终端不能同时打开,否则此模式无法启动。保存时会关掉其中一套。",
|
|
171
|
+
"warn.baseCompositionUnavailable": "读不到出厂组成。基础模式和插件开关暂不能改。系统提示词仍可保存。",
|
|
172
|
+
"warn.personaOffWithPrompt": "「身份」已关闭,这段提示词不会生效。",
|
|
173
|
+
"warn.toolOff": "custom_prompt 已关闭。会话里不能改提示词,只能在此页改。",
|
|
174
|
+
"warn.noDescription": "没有描述时,模式菜单显示「暂无描述」。",
|
|
175
|
+
"warn.noName": "没有名字时,模式菜单显示目录 id。",
|
|
166
176
|
"history.label": "改动历史",
|
|
167
|
-
"history.pick": "
|
|
168
|
-
"history.load": "
|
|
169
|
-
"history.hint": "
|
|
170
|
-
"history.by.settings": "
|
|
171
|
-
"history.by.external": "
|
|
177
|
+
"history.pick": "选择版本…",
|
|
178
|
+
"history.load": "载入",
|
|
179
|
+
"history.hint": "载入只改草稿。保存后才写入。",
|
|
180
|
+
"history.by.settings": "此页保存",
|
|
181
|
+
"history.by.external": "外部改动",
|
|
172
182
|
"msg.loadFailed": "载入这一版失败",
|
|
173
183
|
"msg.importEmpty": "这个文件是空的。",
|
|
174
184
|
"msg.importTooLarge": "文件太大(上限 1MB)。",
|
|
175
185
|
"msg.exported": "已导出为文件。",
|
|
176
186
|
"msg.exportFailed": "导出失败",
|
|
177
|
-
"delete.title": "
|
|
178
|
-
"delete.description": "
|
|
179
|
-
"delete.acknowledge": "
|
|
180
|
-
"delete.confirm": "
|
|
187
|
+
"delete.title": "删除「{name}」?",
|
|
188
|
+
"delete.description": "将删除此助手的目录和系统提示词,不能撤销。正在使用它的会话不受影响。",
|
|
189
|
+
"delete.acknowledge": "我知道提示词会被删除",
|
|
190
|
+
"delete.confirm": "删除",
|
|
181
191
|
"delete.close": "关闭",
|
|
182
|
-
"delete.plainConfirm": "
|
|
183
|
-
"name.heading": "
|
|
184
|
-
"name.hint": "
|
|
192
|
+
"delete.plainConfirm": "删除「{name}」?不能撤销。",
|
|
193
|
+
"name.heading": "名称",
|
|
194
|
+
"name.hint": "显示在模式菜单里。内部标识不变。",
|
|
185
195
|
"name.placeholder": "自定义模式",
|
|
186
|
-
"name.descriptionPlaceholder": "
|
|
196
|
+
"name.descriptionPlaceholder": "描述,显示在模式菜单里,可留空",
|
|
187
197
|
"mode.heading": "基础模式",
|
|
188
|
-
"mode.hint": "
|
|
198
|
+
"mode.hint": "选一套官方预设作为工具底。提示词以本页为准。",
|
|
189
199
|
"rows.heading": "插件开关",
|
|
190
|
-
"rows.filterPlaceholder": "
|
|
191
|
-
"cap.heading": "
|
|
192
|
-
"cap.expand": "
|
|
193
|
-
"cap.collapse": "
|
|
194
|
-
"cap.hint": "
|
|
195
|
-
"rows.hint": "
|
|
200
|
+
"rows.filterPlaceholder": "按名称或 id 筛选",
|
|
201
|
+
"cap.heading": "插件开关",
|
|
202
|
+
"cap.expand": "显示插件开关",
|
|
203
|
+
"cap.collapse": "隐藏插件开关",
|
|
204
|
+
"cap.hint": "关闭的行,这个助手不会使用。",
|
|
205
|
+
"rows.hint": "关闭的行,这个助手不会使用。",
|
|
196
206
|
"prompt.heading": "系统提示词",
|
|
197
|
-
"prompt.hint": "
|
|
207
|
+
"prompt.hint": "保存后,下一步模型调用即生效。",
|
|
198
208
|
"status.enabled": "已启用",
|
|
199
209
|
"status.disabled": "已停用",
|
|
200
210
|
"status.changed": "已改",
|
|
@@ -208,10 +218,10 @@ try {
|
|
|
208
218
|
"msg.unsaved": "有未保存的修改",
|
|
209
219
|
"msg.readFailed": "读取失败",
|
|
210
220
|
"msg.saveFailed": "保存失败",
|
|
211
|
-
"msg.saved": "
|
|
221
|
+
"msg.saved": "已保存。新会话使用新配置,当前会话不变。",
|
|
212
222
|
"status.detail": "{message}:{detail}",
|
|
213
223
|
"row.persona.label": "身份(系统提示词)",
|
|
214
|
-
"row.persona.note": "
|
|
224
|
+
"row.persona.note": "关闭后,此提示词不会生效。",
|
|
215
225
|
"row.custom-prompt-tool.label": "custom_prompt 工具",
|
|
216
226
|
"row.custom-prompt-tool.note": "关掉后无法用对话改提示词(设置页仍可用)",
|
|
217
227
|
"row.agent-instructions.label": "项目指令 AGENTS.md",
|
|
@@ -223,7 +233,7 @@ try {
|
|
|
223
233
|
"row.tool-fs-search.label": "文件搜索(glob/grep)",
|
|
224
234
|
"row.tool-jobs.label": "后台任务",
|
|
225
235
|
"row.planning.label": "计划模式(分组)",
|
|
226
|
-
"row.planning.note": "
|
|
236
|
+
"row.planning.note": "关闭后,计划能力一并去掉。",
|
|
227
237
|
"row.plan-mode.label": "计划模式实现",
|
|
228
238
|
"row.compaction.label": "上下文压缩(分组)",
|
|
229
239
|
"row.compaction.note": "含 isolate realm",
|
|
@@ -231,7 +241,7 @@ try {
|
|
|
231
241
|
"row.command-compact.label": "/compact 命令",
|
|
232
242
|
"row.tool-result-pruner.label": "工具结果裁剪",
|
|
233
243
|
"row.delegation.label": "委派与工作流(分组)",
|
|
234
|
-
"row.delegation.note": "
|
|
244
|
+
"row.delegation.note": "关闭后,子代理和工作流一并去掉。",
|
|
235
245
|
"row.tool-subagent.label": "子代理(spawn)",
|
|
236
246
|
"row.tool-subagent-fork.label": "子代理(fork)",
|
|
237
247
|
"row.tool-subagent-control.label": "子代理控制",
|
|
@@ -241,7 +251,7 @@ try {
|
|
|
241
251
|
"row.tool-subagent-claude-code.label": "Claude Code 子代理",
|
|
242
252
|
"row.tool-subagent-claude-code.note": "需要先安装对应 Bundle 才能用;出厂状态见「详情」",
|
|
243
253
|
"row.time-context.label": "时间上下文(模型看得到时间)",
|
|
244
|
-
"row.time-context.note": "
|
|
254
|
+
"row.time-context.note": "在部分步骤附上当前时间。",
|
|
245
255
|
"row.tool-schedule.label": "定时提醒工具",
|
|
246
256
|
"row.tool-schedule.note": "让 agent 创建/列出/修改/删除持久提醒;存储与投递由宿主的 schedule 服务负责",
|
|
247
257
|
"row.workflow-ptc.label": "工作流引擎",
|
|
@@ -256,7 +266,7 @@ try {
|
|
|
256
266
|
"row.tool-cordis.label": "Cordis 运行时工具",
|
|
257
267
|
"row.tool-cordis.note": "可读写 harness 运行时",
|
|
258
268
|
"row.tool-plugin-manager.label": "插件管理(安装 / 启停)",
|
|
259
|
-
"row.tool-plugin-manager.note": "
|
|
269
|
+
"row.tool-plugin-manager.note": "供模型安装或开关插件。",
|
|
260
270
|
"row.tool-presentation.label": "PTC 工具呈现",
|
|
261
271
|
"row.present.label": "交付文件(present)",
|
|
262
272
|
"row.command-goal.label": "目标命令",
|
|
@@ -270,66 +280,68 @@ try {
|
|
|
270
280
|
"row.terminal-pwsh.label": "终端(pwsh)",
|
|
271
281
|
"row.persistent-pwsh.label": "持久 pwsh",
|
|
272
282
|
"base.standard.label": "标准模式",
|
|
273
|
-
"base.standard.note": "
|
|
283
|
+
"base.standard.note": "出厂的完整工具集。",
|
|
274
284
|
"base.ptc.label": "PTC 模式",
|
|
275
|
-
"base.ptc.note": "
|
|
285
|
+
"base.ptc.note": "标准模式,另开 PTC 工具呈现。",
|
|
276
286
|
"base.minimal.label": "极简模式",
|
|
277
|
-
"base.minimal.note": "只有 Shell
|
|
278
|
-
// ★ 与官方对齐:cordis 这个模式在官方界面里叫「创造模式」(英文 Creator mode),
|
|
279
|
-
// 不是「Cordis 模式」—— 实测 `dsh-client-ui-agent-preset` 的词典:
|
|
280
|
-
// `presetCordisName: "创造模式"` / `"Creator mode"`(0.1.7-rc.2 与 0.2.0-rc.2 同名)。
|
|
281
|
-
// 「Cordis」在官方用语里是**技术名**(Cordis 插件 / Cordis 运行时),不是模式名。
|
|
282
|
-
// 此前这里写「Cordis 模式」、而同一份词典的 `base.all.note` 又写「创造模式」,
|
|
283
|
-
// 同一个模式在一页里有两个名字:用户点了「Cordis 模式」药丸,读到的说明却说「创造模式」。
|
|
287
|
+
"base.minimal.note": "只有 Shell 与终端。提示词仍以本页为准。",
|
|
284
288
|
"base.cordis.label": "创造模式",
|
|
285
|
-
"base.cordis.note": "
|
|
289
|
+
"base.cordis.note": "标准模式,另开 Cordis 运行时工具。",
|
|
286
290
|
"base.all.label": "全部出厂行",
|
|
287
|
-
"base.all.note": "
|
|
291
|
+
"base.all.note": "四套官方预设的行合在一处,均可开关。"
|
|
288
292
|
}
|
|
289
293
|
|
|
290
294
|
const EN = {
|
|
291
295
|
"nav": "Custom mode",
|
|
292
296
|
"assistant.heading": "Assistants",
|
|
293
|
-
"assistant.hint": "Each assistant
|
|
297
|
+
"assistant.hint": "Each assistant keeps its own system prompt, base mode and plugin switches.",
|
|
298
|
+
"posture.hint": "Applies only to the assistant you are about to create.",
|
|
299
|
+
"posture.develop.label": "Coding",
|
|
300
|
+
"posture.develop.note": "After create: Standard, tools as shipped.",
|
|
301
|
+
"posture.write.label": "Writing",
|
|
302
|
+
"posture.write.note": "After create: terminal off, file access on.",
|
|
303
|
+
"posture.chat.label": "Chat",
|
|
304
|
+
"posture.chat.note": "After create: files and terminal off.",
|
|
294
305
|
"assistant.empty": "No assistants yet — create one with the field below.",
|
|
295
306
|
"assistant.loadingList": "Loading assistants…",
|
|
296
307
|
"assistant.newPlaceholder": "Name of the new assistant (e.g. Writing assistant)",
|
|
297
308
|
"assistant.copyName": "{name} (copy)",
|
|
298
309
|
"assistant.broken": "Will not start here",
|
|
299
310
|
"assistant.brokenRows": "{count} row(s) unusable here",
|
|
300
|
-
"assistant.brokenHint": "
|
|
311
|
+
"assistant.brokenHint": "This mode cannot start here, so it will not appear for a new session. Fix for this line turns off only those rows.",
|
|
301
312
|
"assistant.switchHint": "Switching assistants keeps each draft; the \"Unsaved\" marker in the list is exactly that.",
|
|
302
313
|
"btn.create": "New assistant",
|
|
314
|
+
"create.heading": "New assistant",
|
|
303
315
|
"btn.creating": "Creating…",
|
|
304
316
|
"btn.duplicate": "Duplicate",
|
|
305
317
|
"btn.moveUp": "Move up",
|
|
306
318
|
"btn.moveDown": "Move down",
|
|
307
|
-
"btn.import": "Import
|
|
308
|
-
"btn.export": "Export
|
|
309
|
-
"btn.reset": "
|
|
310
|
-
"btn.resetHint": "
|
|
311
|
-
"btn.delete": "Delete
|
|
319
|
+
"btn.import": "Import",
|
|
320
|
+
"btn.export": "Export",
|
|
321
|
+
"btn.reset": "Factory prompt",
|
|
322
|
+
"btn.resetHint": "Restores the prompt saved when this assistant was created. The editor changes. Save writes it.",
|
|
323
|
+
"btn.delete": "Delete",
|
|
312
324
|
"btn.cancel": "Cancel",
|
|
313
|
-
"msg.created": "Created.
|
|
325
|
+
"msg.created": "Created. Refresh once, then it appears in the mode menu for a new session.",
|
|
314
326
|
"msg.duplicated": "Duplicated. The two are independent from here on.",
|
|
315
327
|
"msg.deleted": "Deleted.",
|
|
316
328
|
"msg.createFailed": "Could not create",
|
|
317
329
|
"msg.deleteFailed": "Could not delete",
|
|
318
330
|
"msg.nameRequired": "Give the new assistant a name first.",
|
|
319
331
|
"msg.readOnlyHint": "Manages only the assistants this plugin created; a hand-written preset is not listed and is never rewritten.",
|
|
320
|
-
"msg.reordered": "Order saved
|
|
332
|
+
"msg.reordered": "Order saved. New sessions list modes in this order.",
|
|
321
333
|
"msg.reorderFailed": "Could not reorder",
|
|
322
|
-
"msg.imported": "Imported into the editor
|
|
334
|
+
"msg.imported": "Imported into the editor. Not saved yet.",
|
|
323
335
|
"msg.importFailed": "Import failed",
|
|
324
336
|
"api.badDirection": "Unknown reorder direction: {direction}",
|
|
325
|
-
"api.unknownAssistant": "No assistant {id}
|
|
337
|
+
"api.unknownAssistant": "No assistant \"{id}\". This page only manages assistants it created.",
|
|
326
338
|
"api.alreadyFirst": "{name} is already first.",
|
|
327
339
|
"api.alreadyLast": "{name} is already last.",
|
|
328
|
-
"api.badVariableName": "{variable} is not a valid variable
|
|
329
|
-
"api.unknownVariable": "{variable}
|
|
330
|
-
"mode.unavailable": "
|
|
340
|
+
"api.badVariableName": "{variable} is not a valid variable. Use a lower-case name.",
|
|
341
|
+
"api.unknownVariable": "{variable} cannot be used. Available: {known}.",
|
|
342
|
+
"mode.unavailable": "No shipped composition is available, so the base mode cannot be changed.",
|
|
331
343
|
"rows.unavailable": "No shipped composition is available, so the plugin switches cannot be edited right now; the row states already on disk still apply.",
|
|
332
|
-
"mode.pendingRows": "Base mode
|
|
344
|
+
"mode.pendingRows": "Base mode is now {mode}. On save, the tool base becomes this shipped preset.",
|
|
333
345
|
"aria.expand": "Show details",
|
|
334
346
|
"aria.collapse": "Hide details",
|
|
335
347
|
"detail.id": "Row id",
|
|
@@ -346,18 +358,20 @@ try {
|
|
|
346
358
|
"btn.repair": "Fix for this line",
|
|
347
359
|
"msg.repaired": "Repaired",
|
|
348
360
|
"meta.version": "Plugin version",
|
|
349
|
-
"meta.versionHint": "
|
|
350
|
-
"api.saved": "Saved ({name},
|
|
351
|
-
"api.savedWithExclusiveRows": "Saved ({name},
|
|
352
|
-
"api.created": "Created {name}.
|
|
361
|
+
"meta.versionHint": "Without a pinned version, an older release may be installed. To change it, reinstall with the version pin from the README, then restart.",
|
|
362
|
+
"api.saved": "Saved ({name}, {mode}). New sessions use it. The current session does not change.",
|
|
363
|
+
"api.savedWithExclusiveRows": "Saved ({name}, {mode}). Turned off rows that cannot be on together: {rows}.",
|
|
364
|
+
"api.created": "Created {name}. Refresh once, then it appears in the mode menu for a new session.",
|
|
353
365
|
"api.savedPrompt": "System prompt saved ({name}). It applies on the next model step.",
|
|
354
366
|
"api.duplicated": "Copied from {from}. The two are independent from now on.",
|
|
355
|
-
"api.deleted": "Deleted {name}. Sessions already using it
|
|
356
|
-
"api.reordered": "Order saved
|
|
367
|
+
"api.deleted": "Deleted {name}. Sessions already using it are unchanged.",
|
|
368
|
+
"api.reordered": "Order saved. New sessions list modes in this order.",
|
|
357
369
|
"api.nameRequired": "Give the new assistant a name first.",
|
|
370
|
+
"api.postureUnknown": "No such starter: {posture}.",
|
|
371
|
+
"api.posturePromptMissing": "Could not read the starter prompt for {posture}.",
|
|
358
372
|
"api.nameTooLong": "That name is too long (limit {max} characters).",
|
|
359
373
|
"api.descriptionTooLong": "That description is too long (limit {max} characters).",
|
|
360
|
-
"api.promptEmpty": "
|
|
374
|
+
"api.promptEmpty": "An empty system prompt cannot be saved.",
|
|
361
375
|
"api.badMode": "Unknown base mode: {mode}",
|
|
362
376
|
"api.dirExists": "That directory already exists — pick another name: {path}",
|
|
363
377
|
"api.compositionMissing": "Composition file not found: {path}",
|
|
@@ -367,61 +381,61 @@ try {
|
|
|
367
381
|
"api.selfCheckFailed": "The generated composition failed its self-check, so nothing was written: {detail}",
|
|
368
382
|
"api.internalError": "Unexpected host error: {detail}",
|
|
369
383
|
"api.bodyTooLarge": "Request body too large (limit {max} bytes)",
|
|
370
|
-
"api.repairNotNeeded": "Nothing to repair
|
|
371
|
-
"api.repaired": "
|
|
384
|
+
"api.repairNotNeeded": "Nothing to repair.",
|
|
385
|
+
"api.repaired": "Turned off {count} row(s) that cannot start here ({ids}).",
|
|
372
386
|
"api.badAssistantId": "Invalid assistant id: {id} (a-z, 0-9 and hyphens only)",
|
|
373
387
|
"api.seedFailed": "Copying the mode template failed: {detail}",
|
|
374
388
|
"api.metaWriteFailed": "Writing preset.yml failed: {detail}",
|
|
375
389
|
"api.promptReadFailed": "Reading the prompt failed: {detail}",
|
|
376
|
-
"api.noRemoveApi": "This
|
|
390
|
+
"api.noRemoveApi": "This version cannot delete an assistant.",
|
|
377
391
|
"api.noDirectory": "Delete failed: this assistant's directory is gone from disk, so the list on screen is stale. Refresh and try again.",
|
|
378
392
|
"api.deleteFailed": "Delete failed: {detail}",
|
|
379
393
|
"api.versionMissing": "That version is gone (the history is capped).",
|
|
380
394
|
"api.badJson": "The request body is not valid JSON",
|
|
381
|
-
"api.savedPromptOnly": "System prompt saved
|
|
395
|
+
"api.savedPromptOnly": "System prompt saved. Base mode and plugin switches were not changed.",
|
|
382
396
|
"api.baseCompositionUnavailable": "No shipped composition for base mode \"{mode}\" on this machine, so its plugin switches and base mode cannot be changed (the system prompt can still be saved on its own).",
|
|
383
|
-
"warn.personaOffWithPrompt": "
|
|
384
|
-
"warn.toolOff": "
|
|
385
|
-
"warn.noDescription": "
|
|
386
|
-
"warn.approvalGateMissing": "
|
|
387
|
-
"warn.unresolvableRows": "Some rows cannot
|
|
388
|
-
"warn.presetBroken": "
|
|
389
|
-
"warn.badPromptVariable": "The
|
|
390
|
-
"warn.duplicateRowIds": "
|
|
391
|
-
"warn.predicateFailed": "A platform condition
|
|
392
|
-
"warn.exclusiveRowsActive": "
|
|
393
|
-
"warn.noName": "
|
|
394
|
-
"warn.baseCompositionUnavailable": "
|
|
397
|
+
"warn.personaOffWithPrompt": "Identity is off, so this prompt has no effect.",
|
|
398
|
+
"warn.toolOff": "custom_prompt is off. The prompt can be edited on this page only.",
|
|
399
|
+
"warn.noDescription": "Without a description, the mode menu shows \"no description yet\".",
|
|
400
|
+
"warn.approvalGateMissing": "This version has no approval event. In-session prompt edits are not confirmed.",
|
|
401
|
+
"warn.unresolvableRows": "Some rows cannot start here, so this mode is absent from the new-session menu. Fix for this line turns off only those rows.",
|
|
402
|
+
"warn.presetBroken": "This mode cannot start, so it will not appear for a new session. Use Fix for this line. The reason is on the next line.",
|
|
403
|
+
"warn.badPromptVariable": "The prompt uses a variable that is not available. Fix it before saving.",
|
|
404
|
+
"warn.duplicateRowIds": "A row id is repeated. A switch applies only to the first one.",
|
|
405
|
+
"warn.predicateFailed": "A platform condition could not be evaluated. That row is treated as off.",
|
|
406
|
+
"warn.exclusiveRowsActive": "The two terminals cannot both be on, or this mode will not start. Saving turns one of them off.",
|
|
407
|
+
"warn.noName": "Without a name, the mode menu shows the directory id.",
|
|
408
|
+
"warn.baseCompositionUnavailable": "No shipped composition is available. Base mode and plugin switches cannot be changed. The system prompt can still be saved.",
|
|
395
409
|
"history.label": "Change history",
|
|
396
|
-
"history.pick": "
|
|
397
|
-
"history.load": "Load
|
|
398
|
-
"history.hint": "Loading
|
|
399
|
-
"history.by.settings": "saved
|
|
400
|
-
"history.by.external": "
|
|
410
|
+
"history.pick": "Choose a version…",
|
|
411
|
+
"history.load": "Load",
|
|
412
|
+
"history.hint": "Loading edits the draft only. Save writes it.",
|
|
413
|
+
"history.by.settings": "saved here",
|
|
414
|
+
"history.by.external": "external edit",
|
|
401
415
|
"msg.loadFailed": "Could not load that version",
|
|
402
416
|
"msg.importEmpty": "That file is empty.",
|
|
403
417
|
"msg.importTooLarge": "That file is too large (1 MB limit).",
|
|
404
418
|
"msg.exported": "Exported to a file.",
|
|
405
419
|
"msg.exportFailed": "Export failed",
|
|
406
|
-
"delete.title": "Delete \"{name}\"
|
|
407
|
-
"delete.description": "This
|
|
420
|
+
"delete.title": "Delete \"{name}\"?",
|
|
421
|
+
"delete.description": "This deletes the assistant directory and its system prompt. It cannot be undone. Sessions already using it are unchanged.",
|
|
408
422
|
"delete.acknowledge": "I understand this assistant's prompt will be deleted permanently",
|
|
409
|
-
"delete.confirm": "Delete
|
|
423
|
+
"delete.confirm": "Delete",
|
|
410
424
|
"delete.close": "Close",
|
|
411
|
-
"delete.plainConfirm": "
|
|
412
|
-
"name.heading": "
|
|
413
|
-
"name.hint": "Shown in the mode menu. The internal id
|
|
425
|
+
"delete.plainConfirm": "Delete \"{name}\"? This cannot be undone.",
|
|
426
|
+
"name.heading": "Name",
|
|
427
|
+
"name.hint": "Shown in the mode menu. The internal id stays the same.",
|
|
414
428
|
"name.placeholder": "Custom mode",
|
|
415
|
-
"name.descriptionPlaceholder": "
|
|
429
|
+
"name.descriptionPlaceholder": "Description, shown in the mode menu. Optional.",
|
|
416
430
|
"mode.heading": "Base mode",
|
|
417
|
-
"mode.hint": "Pick a shipped
|
|
431
|
+
"mode.hint": "Pick a shipped preset as the tool base. The prompt on this page still applies.",
|
|
418
432
|
"rows.heading": "Plugin switches",
|
|
419
|
-
"rows.filterPlaceholder": "Filter
|
|
420
|
-
"cap.heading": "
|
|
421
|
-
"cap.expand": "Show
|
|
422
|
-
"cap.collapse": "Hide
|
|
423
|
-
"cap.hint": "
|
|
424
|
-
"rows.hint": "
|
|
433
|
+
"rows.filterPlaceholder": "Filter by name or id",
|
|
434
|
+
"cap.heading": "Plugin switches",
|
|
435
|
+
"cap.expand": "Show plugin switches",
|
|
436
|
+
"cap.collapse": "Hide plugin switches",
|
|
437
|
+
"cap.hint": "A row that is off is not used by this assistant.",
|
|
438
|
+
"rows.hint": "A row that is off is not used by this assistant.",
|
|
425
439
|
"prompt.heading": "System prompt",
|
|
426
440
|
"prompt.hint": "After you save, the next model step uses this text.",
|
|
427
441
|
"status.enabled": "Enabled",
|
|
@@ -437,10 +451,10 @@ try {
|
|
|
437
451
|
"msg.unsaved": "Unsaved changes",
|
|
438
452
|
"msg.readFailed": "Load failed",
|
|
439
453
|
"msg.saveFailed": "Save failed",
|
|
440
|
-
"msg.saved": "Saved.
|
|
454
|
+
"msg.saved": "Saved. New sessions use it. The current session does not change.",
|
|
441
455
|
"status.detail": "{message}: {detail}",
|
|
442
456
|
"row.persona.label": "Identity (system prompt)",
|
|
443
|
-
"row.persona.note": "
|
|
457
|
+
"row.persona.note": "Off: this prompt has no effect.",
|
|
444
458
|
"row.custom-prompt-tool.label": "custom_prompt tool",
|
|
445
459
|
"row.custom-prompt-tool.note": "Without it the prompt can still be edited here, but not by asking the agent",
|
|
446
460
|
"row.agent-instructions.label": "Project instructions (AGENTS.md)",
|
|
@@ -452,7 +466,7 @@ try {
|
|
|
452
466
|
"row.tool-fs-search.label": "File search (glob/grep)",
|
|
453
467
|
"row.tool-jobs.label": "Background jobs",
|
|
454
468
|
"row.planning.label": "Plan mode (group)",
|
|
455
|
-
"row.planning.note": "
|
|
469
|
+
"row.planning.note": "Off: planning is removed with it.",
|
|
456
470
|
"row.plan-mode.label": "Plan mode implementation",
|
|
457
471
|
"row.compaction.label": "Context compaction (group)",
|
|
458
472
|
"row.compaction.note": "Carries an isolate realm",
|
|
@@ -460,7 +474,7 @@ try {
|
|
|
460
474
|
"row.command-compact.label": "/compact command",
|
|
461
475
|
"row.tool-result-pruner.label": "Tool-result pruning",
|
|
462
476
|
"row.delegation.label": "Delegation and workflows (group)",
|
|
463
|
-
"row.delegation.note": "
|
|
477
|
+
"row.delegation.note": "Off: subagents and workflows are removed with it.",
|
|
464
478
|
"row.tool-subagent.label": "Subagent (spawn)",
|
|
465
479
|
"row.tool-subagent-fork.label": "Subagent (fork)",
|
|
466
480
|
"row.tool-subagent-control.label": "Subagent control",
|
|
@@ -470,7 +484,7 @@ try {
|
|
|
470
484
|
"row.tool-subagent-claude-code.label": "Claude Code subagent",
|
|
471
485
|
"row.tool-subagent-claude-code.note": "Needs its Bundle installed first; the shipped state is in the details",
|
|
472
486
|
"row.time-context.label": "Time context (the model can see the clock)",
|
|
473
|
-
"row.time-context.note": "
|
|
487
|
+
"row.time-context.note": "Adds the current time on some steps.",
|
|
474
488
|
"row.tool-schedule.label": "Scheduled reminders tool",
|
|
475
489
|
"row.tool-schedule.note": "Lets the agent create, list, edit and delete durable reminders; the host schedule service owns storage and delivery",
|
|
476
490
|
"row.workflow-ptc.label": "Workflow engine",
|
|
@@ -485,7 +499,7 @@ try {
|
|
|
485
499
|
"row.tool-cordis.label": "Cordis runtime tools",
|
|
486
500
|
"row.tool-cordis.note": "Can read and modify the running harness",
|
|
487
501
|
"row.tool-plugin-manager.label": "Plugin manager (install / toggle)",
|
|
488
|
-
"row.tool-plugin-manager.note": "Lets the
|
|
502
|
+
"row.tool-plugin-manager.note": "Lets the model install or toggle plugins.",
|
|
489
503
|
"row.tool-presentation.label": "PTC tool presentation",
|
|
490
504
|
"row.present.label": "Deliverables (present)",
|
|
491
505
|
"row.command-goal.label": "Goal command",
|
|
@@ -498,20 +512,16 @@ try {
|
|
|
498
512
|
"row.persistent-bash.label": "Persistent bash",
|
|
499
513
|
"row.terminal-pwsh.label": "Terminal (pwsh)",
|
|
500
514
|
"row.persistent-pwsh.label": "Persistent pwsh",
|
|
501
|
-
// ★ 与官方选择器逐字一致(实测 `dsh-client-ui-agent-preset` 的英文字典,两版 DSH 同名):
|
|
502
|
-
// 官方英文名都带 " mode" 后缀 —— "Standard mode" / "PTC mode" / "Minimal mode" /
|
|
503
|
-
// "Creator mode"。本仓此前写成 "Standard" / "PTC" / "Minimal" / "Cordis",
|
|
504
|
-
// 与用户在官方模式选择器里看到的同一个模式名对不上。
|
|
505
515
|
"base.standard.label": "Standard mode",
|
|
506
|
-
"base.standard.note": "
|
|
516
|
+
"base.standard.note": "The shipped tool set.",
|
|
507
517
|
"base.ptc.label": "PTC mode",
|
|
508
|
-
"base.ptc.note": "Standard plus PTC tool presentation
|
|
518
|
+
"base.ptc.note": "Standard, plus PTC tool presentation.",
|
|
509
519
|
"base.minimal.label": "Minimal mode",
|
|
510
|
-
"base.minimal.note": "Shell and terminal only
|
|
520
|
+
"base.minimal.note": "Shell and terminal only. The prompt on this page still applies.",
|
|
511
521
|
"base.cordis.label": "Creator mode",
|
|
512
|
-
"base.cordis.note": "Standard plus
|
|
522
|
+
"base.cordis.note": "Standard, plus Cordis runtime tools.",
|
|
513
523
|
"base.all.label": "All shipped rows",
|
|
514
|
-
"base.all.note": "
|
|
524
|
+
"base.all.note": "Rows from all four shipped presets. Each row can be switched."
|
|
515
525
|
}
|
|
516
526
|
|
|
517
527
|
const TRANSLATIONS = { zh: ZH, en: EN }
|
|
@@ -750,6 +760,8 @@ try {
|
|
|
750
760
|
".cpfe-pill-wrap{display:inline-flex;align-items:center;gap:4px}",
|
|
751
761
|
".cpfe-actions{display:flex;flex-wrap:wrap;gap:var(--g);align-items:center;margin-top:4px}",
|
|
752
762
|
".cpfe-newrow{display:flex;gap:var(--g);align-items:center;flex-wrap:wrap;margin-top:10px}",
|
|
763
|
+
".cpfe-postures{display:flex;flex-direction:column;gap:6px}",
|
|
764
|
+
".cpfe-create{display:flex;flex-direction:column;gap:6px;margin-top:8px}",
|
|
753
765
|
".cpfe-field{display:flex;width:100%;margin-bottom:8px}",
|
|
754
766
|
".cpfe-row-head{font-size:14px;line-height:22px;color:var(--dsw-alias-label-primary)}",
|
|
755
767
|
".cpfe-row-switch{flex:0 0 auto}",
|
|
@@ -762,7 +774,8 @@ try {
|
|
|
762
774
|
".cpfe-detail-line{display:flex;gap:8px;min-width:0}",
|
|
763
775
|
".cpfe-detail-key{flex:0 0 9.5em;color:var(--dsw-alias-label-secondary)}",
|
|
764
776
|
".cpfe-detail-value{min-width:0;overflow-wrap:anywhere}",
|
|
765
|
-
".cpfe-sec-head{display:flex;flex-
|
|
777
|
+
".cpfe-sec-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}",
|
|
778
|
+
".cpfe-sec-head .cpfe-actions{margin-top:0}",
|
|
766
779
|
".cpfe-newinput{flex:1;min-width:200px}",
|
|
767
780
|
// 单列、行高统一(对齐官方插件页的形态);之前的自适应多列网格会让行高参差不齐。
|
|
768
781
|
// ★ 对齐官方设置行(实测 0.1.7-rc.2 的行:padding 16px 0、无背景、无圆角,行间只有一条 1px
|
|
@@ -1194,6 +1207,8 @@ try {
|
|
|
1194
1207
|
const [failed, setFailed] = react.useState(false)
|
|
1195
1208
|
const [busy, setBusy] = react.useState(false)
|
|
1196
1209
|
const [newName, setNewName] = react.useState("")
|
|
1210
|
+
const [postureChoices, setPostureChoices] = react.useState([])
|
|
1211
|
+
const [posture, setPosture] = react.useState("develop")
|
|
1197
1212
|
const [deleteOpen, setDeleteOpen] = react.useState(false)
|
|
1198
1213
|
const [acknowledged, setAcknowledged] = react.useState(false)
|
|
1199
1214
|
/**
|
|
@@ -1323,8 +1338,11 @@ try {
|
|
|
1323
1338
|
return
|
|
1324
1339
|
}
|
|
1325
1340
|
const assistants = Array.isArray(result.assistants) ? result.assistants : []
|
|
1341
|
+
const choices = Array.isArray(result.postures) ? result.postures.filter((item) => item !== null && typeof item === "object" && typeof item.id === "string") : []
|
|
1326
1342
|
setListFailed(false)
|
|
1327
1343
|
setList(assistants)
|
|
1344
|
+
setPostureChoices(choices)
|
|
1345
|
+
setPosture((current) => (choices.some((item) => item.id === current) ? current : choices.length > 0 ? choices[0].id : "develop"))
|
|
1328
1346
|
const wanted =
|
|
1329
1347
|
typeof preferId === "string" && preferId !== ""
|
|
1330
1348
|
? preferId
|
|
@@ -1455,7 +1473,10 @@ try {
|
|
|
1455
1473
|
}
|
|
1456
1474
|
setBusy(true)
|
|
1457
1475
|
try {
|
|
1458
|
-
const
|
|
1476
|
+
const body = { name, locale: activeLanguage(localeRef) }
|
|
1477
|
+
if (from !== undefined) body.from = from
|
|
1478
|
+
else if (postureChoices.some((item) => item.id === posture)) body.posture = posture
|
|
1479
|
+
const result = await postJson(ROUTES.create, body)
|
|
1459
1480
|
if (result !== null && result !== undefined && result.ok === true) {
|
|
1460
1481
|
setNewName("")
|
|
1461
1482
|
setFailed(false)
|
|
@@ -1693,6 +1714,64 @@ try {
|
|
|
1693
1714
|
: "cpfe-status cpfe-ok"
|
|
1694
1715
|
const shown = dirty && status === "" ? t("msg.unsaved") : status
|
|
1695
1716
|
|
|
1717
|
+
const createGroup = react.createElement(
|
|
1718
|
+
"section",
|
|
1719
|
+
{ className: "cpfe-create" },
|
|
1720
|
+
react.createElement("h2", { className: "cpfe-h" }, t("create.heading")),
|
|
1721
|
+
react.createElement(SectionHint, { text: t("posture.hint") }),
|
|
1722
|
+
postureChoices.length === 0
|
|
1723
|
+
? null
|
|
1724
|
+
: react.createElement(
|
|
1725
|
+
"div",
|
|
1726
|
+
null,
|
|
1727
|
+
react.createElement(
|
|
1728
|
+
"div",
|
|
1729
|
+
{ className: "cpfe-pills", role: "radiogroup", "aria-label": t("posture.hint") },
|
|
1730
|
+
postureChoices.map((item) =>
|
|
1731
|
+
react.createElement(
|
|
1732
|
+
A.Pill,
|
|
1733
|
+
{
|
|
1734
|
+
key: item.id,
|
|
1735
|
+
active: item.id === posture,
|
|
1736
|
+
disabled: busy,
|
|
1737
|
+
"aria-pressed": item.id === posture,
|
|
1738
|
+
onClick: () => setPosture(item.id),
|
|
1739
|
+
},
|
|
1740
|
+
t("posture." + item.id + ".label", item.id),
|
|
1741
|
+
),
|
|
1742
|
+
),
|
|
1743
|
+
),
|
|
1744
|
+
react.createElement("p", { className: "cpfe-note" }, t("posture." + posture + ".note", "")),
|
|
1745
|
+
),
|
|
1746
|
+
react.createElement(
|
|
1747
|
+
"div",
|
|
1748
|
+
{ className: "cpfe-newrow" },
|
|
1749
|
+
react.createElement(A.Input, {
|
|
1750
|
+
className: "cpfe-newinput",
|
|
1751
|
+
value: newName,
|
|
1752
|
+
placeholder: t("assistant.newPlaceholder"),
|
|
1753
|
+
"aria-label": t("assistant.newPlaceholder"),
|
|
1754
|
+
onKeyDown: (event) => {
|
|
1755
|
+
if (event.key === "Enter" && busy !== true) create()
|
|
1756
|
+
},
|
|
1757
|
+
onChange: (event) => {
|
|
1758
|
+
setNewName(event.target.value)
|
|
1759
|
+
setStatus("")
|
|
1760
|
+
},
|
|
1761
|
+
}),
|
|
1762
|
+
react.createElement(
|
|
1763
|
+
A.Button,
|
|
1764
|
+
{
|
|
1765
|
+
variant: "outline",
|
|
1766
|
+
icon: A.IconPlusOutline16 === undefined ? null : react.createElement(A.IconPlusOutline16),
|
|
1767
|
+
disabled: busy,
|
|
1768
|
+
onClick: () => create(),
|
|
1769
|
+
},
|
|
1770
|
+
busy ? t("btn.creating") : t("btn.create"),
|
|
1771
|
+
),
|
|
1772
|
+
),
|
|
1773
|
+
)
|
|
1774
|
+
|
|
1696
1775
|
// ── assistant list ────────────────────────────────────────────────────
|
|
1697
1776
|
const assistantList = react.createElement(
|
|
1698
1777
|
"section",
|
|
@@ -1794,33 +1873,6 @@ try {
|
|
|
1794
1873
|
)
|
|
1795
1874
|
: null,
|
|
1796
1875
|
),
|
|
1797
|
-
react.createElement(
|
|
1798
|
-
"div",
|
|
1799
|
-
{ className: "cpfe-newrow" },
|
|
1800
|
-
react.createElement(A.Input, {
|
|
1801
|
-
className: "cpfe-newinput",
|
|
1802
|
-
value: newName,
|
|
1803
|
-
placeholder: t("assistant.newPlaceholder"),
|
|
1804
|
-
"aria-label": t("assistant.newPlaceholder"),
|
|
1805
|
-
onKeyDown: (event) => {
|
|
1806
|
-
if (event.key === "Enter" && busy !== true) create()
|
|
1807
|
-
},
|
|
1808
|
-
onChange: (event) => {
|
|
1809
|
-
setNewName(event.target.value)
|
|
1810
|
-
setStatus("")
|
|
1811
|
-
},
|
|
1812
|
-
}),
|
|
1813
|
-
react.createElement(
|
|
1814
|
-
A.Button,
|
|
1815
|
-
{
|
|
1816
|
-
variant: "outline",
|
|
1817
|
-
icon: A.IconPlusOutline16 === undefined ? null : react.createElement(A.IconPlusOutline16),
|
|
1818
|
-
disabled: busy,
|
|
1819
|
-
onClick: () => create(),
|
|
1820
|
-
},
|
|
1821
|
-
busy ? t("btn.creating") : t("btn.create"),
|
|
1822
|
-
),
|
|
1823
|
-
),
|
|
1824
1876
|
editorReady
|
|
1825
1877
|
? react.createElement(
|
|
1826
1878
|
"div",
|
|
@@ -1953,8 +2005,6 @@ try {
|
|
|
1953
2005
|
react.createElement(
|
|
1954
2006
|
"section",
|
|
1955
2007
|
{ key: "rows" },
|
|
1956
|
-
react.createElement("h2", { className: "cpfe-h" }, t("rows.heading")),
|
|
1957
|
-
react.createElement(SectionHint, { text: t("rows.hint") }),
|
|
1958
2008
|
draft.baseUnavailable !== null
|
|
1959
2009
|
? react.createElement("p", { className: "cpfe-note" }, t("rows.unavailable"))
|
|
1960
2010
|
: react.createElement(
|
|
@@ -2020,7 +2070,7 @@ try {
|
|
|
2020
2070
|
react.createElement(
|
|
2021
2071
|
A.Button,
|
|
2022
2072
|
{
|
|
2023
|
-
variant: "
|
|
2073
|
+
variant: "ghost",
|
|
2024
2074
|
size: "sm",
|
|
2025
2075
|
disabled:
|
|
2026
2076
|
busy ||
|
|
@@ -2197,7 +2247,8 @@ try {
|
|
|
2197
2247
|
),
|
|
2198
2248
|
),
|
|
2199
2249
|
),
|
|
2200
|
-
...(editorReady ? editorSections.filter((section) => section.key === "
|
|
2250
|
+
...(editorReady ? editorSections.filter((section) => section.key === "prompt") : []),
|
|
2251
|
+
...(editorReady ? editorSections.filter((section) => section.key === "name") : []),
|
|
2201
2252
|
react.createElement(
|
|
2202
2253
|
"div",
|
|
2203
2254
|
{ className: "cpfe-bar" },
|
|
@@ -2228,23 +2279,18 @@ try {
|
|
|
2228
2279
|
dirty ? t("btn.reloadDiscard") : t("btn.reload"),
|
|
2229
2280
|
),
|
|
2230
2281
|
react.createElement("span", { className: statusClass }, shown),
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
// (实测:干净机器上按名安装装到 1.0.1,而 latest 是 1.9.x)。
|
|
2236
|
-
react.createElement(
|
|
2237
|
-
"span",
|
|
2282
|
+
),
|
|
2283
|
+
editorReady
|
|
2284
|
+
? react.createElement(
|
|
2285
|
+
"p",
|
|
2238
2286
|
{
|
|
2239
2287
|
className: "cpfe-version",
|
|
2240
|
-
title:
|
|
2241
|
-
(editorReady ? String(payload.compositionPath ?? "") + "\n" : "") + t("meta.versionHint"),
|
|
2288
|
+
title: String(payload.compositionPath ?? "") + "\n" + t("meta.versionHint"),
|
|
2242
2289
|
},
|
|
2243
|
-
|
|
2244
|
-
)
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
),
|
|
2290
|
+
"v" + String(payload.version ?? "?"),
|
|
2291
|
+
)
|
|
2292
|
+
: null,
|
|
2293
|
+
...(editorReady ? editorSections.filter((section) => section.key === "mode") : []),
|
|
2248
2294
|
editorReady
|
|
2249
2295
|
? react.createElement(
|
|
2250
2296
|
"section",
|
|
@@ -2264,12 +2310,19 @@ try {
|
|
|
2264
2310
|
: capOpen
|
|
2265
2311
|
? "▾"
|
|
2266
2312
|
: "▸",
|
|
2267
|
-
t("
|
|
2313
|
+
t("rows.heading"),
|
|
2268
2314
|
),
|
|
2269
|
-
|
|
2270
|
-
|
|
2315
|
+
capOpen
|
|
2316
|
+
? react.createElement(
|
|
2317
|
+
"div",
|
|
2318
|
+
null,
|
|
2319
|
+
react.createElement(SectionHint, { text: t("cap.hint") }),
|
|
2320
|
+
editorSections.filter((section) => section.key === "rows"),
|
|
2321
|
+
)
|
|
2322
|
+
: null,
|
|
2271
2323
|
)
|
|
2272
2324
|
: null,
|
|
2325
|
+
createGroup,
|
|
2273
2326
|
// The confirmation is a portal: rendering it here keeps every piece of this page's
|
|
2274
2327
|
// state in one component.
|
|
2275
2328
|
renderable(A.RiskConfirmation) && editorReady
|