mocode-ai 1.3.4 → 1.3.5
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/dist/i18n/index.js +4 -2
- package/dist/repl/index.js +24 -15
- package/package.json +1 -1
package/dist/i18n/index.js
CHANGED
|
@@ -106,13 +106,14 @@ const zhCN = {
|
|
|
106
106
|
'prompt.revertFiles': '撤销文件改动{detail}',
|
|
107
107
|
'prompt.revertDetail': '({count} 个文件恢复到回滚前)',
|
|
108
108
|
'prompt.messagesOnly': '只撤销消息,保留文件改动',
|
|
109
|
-
'prompt.emptyPlaceholder': '输入需求,按 Enter
|
|
109
|
+
'prompt.emptyPlaceholder': '输入需求,按 Enter 开始干活;或者可按 Ctrl+G 打开输入面板去编辑你的需求',
|
|
110
110
|
'prompt.confirmSendHint': '再按一次 Enter 发送 · 其它键继续编辑',
|
|
111
111
|
'composer.title': '输入面板',
|
|
112
112
|
'composer.pos': '{row}/{total} 行 · {col} 列 · {chars} 字',
|
|
113
113
|
'composer.hint': 'Enter 换行 · Ctrl+S 回填 · Esc 取消 · Ctrl+Z 撤销 · Ctrl+C/X/V 复制/剪切/粘贴 · Ctrl+A 全选 · Shift+方向键 选择',
|
|
114
114
|
'history.hint': '输入过滤 · ↑↓ 选择 · Enter 填入输入框 · Ctrl+Enter 直接发送 · Esc 取消',
|
|
115
115
|
'history.empty': '(无匹配的历史输入)',
|
|
116
|
+
'welcome.ideNotice': '在电脑原生终端运行 mocode 可获得比IDE集成终端更佳的操作体验',
|
|
116
117
|
'welcome.gettingStarted': '快速上手',
|
|
117
118
|
'welcome.start1': '直接输入消息,按 Enter 发送;Shift+Tab 切换 auto / plan 模式',
|
|
118
119
|
'welcome.start2': '输入 / 打开命令菜单;输入 /help 查看全部命令',
|
|
@@ -396,13 +397,14 @@ const en = {
|
|
|
396
397
|
'prompt.revertFiles': 'Revert file changes{detail}',
|
|
397
398
|
'prompt.revertDetail': ' ({count} files restored to before the rollback)',
|
|
398
399
|
'prompt.messagesOnly': 'Roll back messages only; keep file changes',
|
|
399
|
-
'prompt.emptyPlaceholder': 'Type
|
|
400
|
+
'prompt.emptyPlaceholder': 'Type what you need, press Enter to get started; or press Ctrl+G to open the composer panel and edit your request',
|
|
400
401
|
'prompt.confirmSendHint': 'Press Enter again to send · any other key keeps editing',
|
|
401
402
|
'composer.title': 'Composer',
|
|
402
403
|
'composer.pos': '{row}/{total} lines · col {col} · {chars} chars',
|
|
403
404
|
'composer.hint': 'Enter Newline · Ctrl+S Fill input · Esc Cancel · Ctrl+Z Undo · Ctrl+C/X/V Copy/Cut/Paste · Ctrl+A Select all · Shift+Arrows Select',
|
|
404
405
|
'history.hint': 'Type to filter · ↑↓ Select · Enter Fill input · Ctrl+Enter Send · Esc Cancel',
|
|
405
406
|
'history.empty': '(no matching history)',
|
|
407
|
+
'welcome.ideNotice': 'Running mocode in a native terminal provides a better experience than an IDE integrated terminal',
|
|
406
408
|
'welcome.gettingStarted': 'Getting started',
|
|
407
409
|
'welcome.start1': 'Type a message and press Enter; Shift+Tab toggles auto / plan mode',
|
|
408
410
|
'welcome.start2': 'Type / for the command menu; /help lists all commands',
|
package/dist/repl/index.js
CHANGED
|
@@ -920,21 +920,30 @@ export async function startRepl(initialHistory, sessionId, sandboxRootOverride,
|
|
|
920
920
|
* 首次提交任何输入(消息或斜杠命令)前由 layout.dismissWelcomeBlock 整块撤掉——
|
|
921
921
|
* 「一打开就能看见,开始干活就消失」。/clear 清空后重新写一次(回到空会话状态)。
|
|
922
922
|
*/
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
923
|
+
// 欢迎块整块按终端宽度居中:先按纯文本(displayWidth 不剥 ANSI)算左缩进,再套色;
|
|
924
|
+
// 余数列归左,与输入框提示行的居中策略一致;超宽行由 contentWrite 兜底折行。
|
|
925
|
+
const welcomeLines = () => {
|
|
926
|
+
const cols = layout.getGeo().cols;
|
|
927
|
+
const pad = (plain) => ' '.repeat(Math.max(0, Math.floor((cols - displayWidth(plain)) / 2)));
|
|
928
|
+
const ideNotice = `⚠ ${t('welcome.ideNotice')}`;
|
|
929
|
+
return [
|
|
930
|
+
'',
|
|
931
|
+
`${pad(ideNotice)}${ui.yellow}${ui.bold}${ideNotice}${ui.reset}`,
|
|
932
|
+
'',
|
|
933
|
+
`${pad(t('welcome.gettingStarted'))}${ui.accent}${ui.bold}${t('welcome.gettingStarted')}${ui.reset}`,
|
|
934
|
+
`${pad(`· ${t('welcome.start1')}`)}${ui.dim}· ${t('welcome.start1')}${ui.reset}`,
|
|
935
|
+
`${pad(`· ${t('welcome.start2')}`)}${ui.dim}· ${t('welcome.start2')}${ui.reset}`,
|
|
936
|
+
`${pad(`· ${t('welcome.start3')}`)}${ui.dim}· ${t('welcome.start3')}${ui.reset}`,
|
|
937
|
+
'',
|
|
938
|
+
`${pad(t('welcome.capabilities'))}${ui.accent}${ui.bold}${t('welcome.capabilities')}${ui.reset}`,
|
|
939
|
+
`${pad(`· ${t('welcome.cap1')}`)}${ui.dim}· ${t('welcome.cap1')}${ui.reset}`,
|
|
940
|
+
`${pad(`· ${t('welcome.cap2')}`)}${ui.dim}· ${t('welcome.cap2')}${ui.reset}`,
|
|
941
|
+
`${pad(`· ${t('welcome.cap3')}`)}${ui.dim}· ${t('welcome.cap3')}${ui.reset}`,
|
|
942
|
+
'',
|
|
943
|
+
`${pad(t('welcome.try'))}${ui.dim}${t('welcome.try')}${ui.reset}`,
|
|
944
|
+
'',
|
|
945
|
+
];
|
|
946
|
+
};
|
|
938
947
|
// 开场:按 config.theme 切主题(横幅 / 状态行 / 后续渲染皆用新色),再进 alt screen + 状态基线 + 清内容区。
|
|
939
948
|
// --resume 有历史则渲染对话,否则横幅。
|
|
940
949
|
setTheme(config.theme);
|