@hit-sudomaker/ccw 0.5.0 → 0.5.1
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.md +2 -2
- package/dist/render.js +1 -0
- package/dist/terminal-view.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# CCW 0.5.
|
|
1
|
+
# CCW 0.5.1
|
|
2
2
|
|
|
3
3
|
CCW 是一个管理 Claude Code 及其常用扩展的终端工具。安装、更新和移除前,CCW 会先展示变更预览,确认后再执行。
|
|
4
4
|
|
|
@@ -72,7 +72,7 @@ npm start
|
|
|
72
72
|
```powershell
|
|
73
73
|
New-Item -ItemType Directory -Force .scratch | Out-Null
|
|
74
74
|
npm pack ./packages/ccw --pack-destination .scratch
|
|
75
|
-
pnpm add --global --force ./.scratch/hit-sudomaker-ccw-0.5.
|
|
75
|
+
pnpm add --global --force ./.scratch/hit-sudomaker-ccw-0.5.1.tgz
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
重新打包后再安装,关闭旧的 CCW 窗口并运行 `ccw`,即可使用新版本。如果原来使用 npm 全局安装,可将最后一行换成 `npm install -g`,并指定同一个安装包。打包和本地安装不会发布版本。
|
package/dist/render.js
CHANGED
|
@@ -37,6 +37,7 @@ const ACTION_NAMES = {
|
|
|
37
37
|
/** 模型配置表单的字段键与显示顺序 */
|
|
38
38
|
export const MODEL_FIELDS = [
|
|
39
39
|
{ key: 'model', label: '默认模型' },
|
|
40
|
+
{ key: 'fable', label: 'Fable' },
|
|
40
41
|
{ key: 'opus', label: 'Opus' },
|
|
41
42
|
{ key: 'sonnet', label: 'Sonnet' },
|
|
42
43
|
{ key: 'haiku', label: 'Haiku' },
|
package/dist/terminal-view.js
CHANGED
|
@@ -283,6 +283,7 @@ function InlineForm({ title, fields, validate, interrupt, done, }) {
|
|
|
283
283
|
};
|
|
284
284
|
const [problem, setProblem] = useState(null);
|
|
285
285
|
const size = useWindowSize();
|
|
286
|
+
const labelWidth = Math.max(0, ...fields.map(field => stringWidth(field.label)));
|
|
286
287
|
const append = (text) => {
|
|
287
288
|
const field = fields[activeRef.current];
|
|
288
289
|
if (field) {
|
|
@@ -355,14 +356,14 @@ function InlineForm({ title, fields, validate, interrupt, done, }) {
|
|
|
355
356
|
: (values[field.key] ?? '');
|
|
356
357
|
const characters = Array.from(text);
|
|
357
358
|
const caret = index === active ? cursor : characters.length;
|
|
358
|
-
const available = Math.max(1, size.columns -
|
|
359
|
+
const available = Math.max(1, size.columns - labelWidth - LAYOUT.formDecorationColumns);
|
|
359
360
|
let from = caret;
|
|
360
361
|
while (from > 0 && stringWidth(characters.slice(from - 1, caret).join('')) < available)
|
|
361
362
|
from--;
|
|
362
363
|
let to = caret;
|
|
363
364
|
while (to < characters.length && stringWidth(characters.slice(from, to + 1).join('')) < available)
|
|
364
365
|
to++;
|
|
365
|
-
return (_jsxs(Text, { wrap: "truncate-end", ...(index === active ? { color: ACCENT } : {}), children: [index === active ? '› ' : ' ', field.label, "\uFF1A", safeText(characters.slice(from, caret).join('')), index === active && _jsx(Text, { inverse: true, children: characters[caret] ?? ' ' }), safeText(characters.slice(caret + (index === active ? 1 : 0), to).join('')), !values[field.key] && field.placeholder ? ' ' + field.placeholder : ''] }, field.key));
|
|
366
|
+
return (_jsxs(Text, { wrap: "truncate-end", ...(index === active ? { color: ACCENT } : {}), children: [index === active ? '› ' : ' ', field.label, ' '.repeat(labelWidth - stringWidth(field.label)), "\uFF1A", safeText(characters.slice(from, caret).join('')), index === active && _jsx(Text, { inverse: true, children: characters[caret] ?? ' ' }), safeText(characters.slice(caret + (index === active ? 1 : 0), to).join('')), !values[field.key] && field.placeholder ? ' ' + field.placeholder : ''] }, field.key));
|
|
366
367
|
}), _jsxs(Text, { ...(active === fields.length ? { color: ACCENT } : {}), children: [active === fields.length ? '› ' : ' ', "\u4FDD\u5B58"] }), _jsxs(Text, { ...(active === fields.length + 1 ? { color: ACCENT } : {}), children: [active === fields.length + 1 ? '› ' : ' ', "\u8FD4\u56DE"] }), problem && _jsx(Text, { color: "red", children: problem.message })] }));
|
|
367
368
|
} }));
|
|
368
369
|
}
|