@clipen/clipen-cli 1.0.6 → 1.0.8
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 +5 -4
- package/apps/web/dist/assets/{index-CaxEZKLc.css → index-CJ80KHsQ.css} +1 -1
- package/apps/web/dist/assets/index-C_4u_hVf.js +16 -0
- package/apps/web/dist/index.html +2 -2
- package/bin/clipen.js +237 -78
- package/package.json +8 -2
- package/pyproject.toml +1 -1
- package/src/clipen/__init__.py +1 -1
- package/src/clipen/analysis/qwen_worker.py +13 -4
- package/src/clipen/analysis/setup.py +26 -1
- package/src/clipen/analysis/setup_cli.py +59 -10
- package/src/clipen/bootstrap.py +411 -176
- package/src/clipen/cli.py +40 -15
- package/src/clipen/controller/app.py +37 -17
- package/src/clipen/controller/server.py +65 -27
- package/src/clipen/editing/agent_repository.py +8 -0
- package/src/clipen/editing/alignment_setup.py +40 -15
- package/src/clipen/editing/change_report.py +17 -0
- package/src/clipen/editing/coordinator.py +6 -0
- package/src/clipen/editing/evidence_jobs.py +3 -1
- package/src/clipen/editing/history_changes.py +56 -27
- package/src/clipen/editing/production_catalog.py +3 -3
- package/src/clipen/editing/production_media.py +18 -0
- package/src/clipen/editing/production_progress.py +46 -3
- package/src/clipen/editing/production_tools.py +3 -1
- package/src/clipen/editing/versions.py +53 -10
- package/src/clipen/finishing/audio.py +59 -45
- package/src/clipen/i18n.py +155 -0
- package/src/clipen/locale_en.py +528 -0
- package/src/clipen/mcp_editing/__main__.py +8 -0
- package/src/clipen/own_python.py +43 -0
- package/src/clipen/projects/models.py +16 -1
- package/src/clipen/projects/picker.py +3 -1
- package/src/clipen/projects/storage.py +17 -1
- package/src/clipen/providers/claude_editing.py +3 -1
- package/src/clipen/providers/codex_editing.py +3 -1
- package/src/clipen/providers/editing_agent.py +36 -1
- package/src/clipen/providers/liveness.py +39 -0
- package/src/clipen/rendering/custom_components.py +104 -2
- package/src/clipen/rendering/custom_render.py +45 -0
- package/src/clipen/skills/builtin/display.en.json +89 -0
- package/src/clipen/skills/builtin/references/graphics.md +1 -2
- package/src/clipen/skills/catalog.py +22 -0
- package/src/clipen/terminal.py +344 -0
- package/src/clipen/workspace.py +97 -28
- package/apps/web/dist/assets/index-C3Zw0WaM.js +0 -14
|
@@ -8,6 +8,7 @@ import time
|
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
|
|
10
10
|
from clipen.asr_release import NOTICE_VERSION, PROGRESS_RECORD_PREFIX
|
|
11
|
+
from clipen.i18n import speaking, system_language, tr
|
|
11
12
|
|
|
12
13
|
from .setup import ASRSetupError, ASRSetupManager, ASRSetupState, ASRSetupStatus
|
|
13
14
|
|
|
@@ -26,14 +27,23 @@ def _progress_line(status: ASRSetupStatus, elapsed: int) -> str:
|
|
|
26
27
|
percent = max(0, min(100, status.progress_percent))
|
|
27
28
|
width = 24
|
|
28
29
|
filled = min(width, percent * width // 100)
|
|
29
|
-
bar = "
|
|
30
|
+
bar = "━" * filled + "─" * (width - filled)
|
|
30
31
|
detail = ""
|
|
31
32
|
if status.detail_total_bytes > 0:
|
|
32
33
|
detail = f" · {_format_bytes(status.detail_completed_bytes)} / {_format_bytes(status.detail_total_bytes)}"
|
|
33
|
-
return
|
|
34
|
+
return tr(
|
|
35
|
+
f"{bar} {percent:3d}% {status.message}{detail} · {elapsed // 60} 分 {elapsed % 60} 秒",
|
|
36
|
+
f"{bar} {percent:3d}% {tr(status.message)}{detail} · {elapsed // 60}m {elapsed % 60}s",
|
|
37
|
+
)
|
|
34
38
|
|
|
35
39
|
|
|
36
40
|
def main(arguments: list[str] | None = None) -> int:
|
|
41
|
+
# The installer runs this in its own process; it speaks the same language.
|
|
42
|
+
with speaking(system_language()):
|
|
43
|
+
return _main(arguments)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _main(arguments: list[str] | None) -> int:
|
|
37
47
|
parser = argparse.ArgumentParser(add_help=False)
|
|
38
48
|
parser.add_argument("--data-root", required=True)
|
|
39
49
|
parser.add_argument("--requirements", required=True)
|
|
@@ -44,18 +54,44 @@ def main(arguments: list[str] | None = None) -> int:
|
|
|
44
54
|
Path(options.requirements),
|
|
45
55
|
)
|
|
46
56
|
except (OSError, ValueError, ASRSetupError) as error:
|
|
47
|
-
print(
|
|
57
|
+
print(
|
|
58
|
+
tr(f"無法準備本機語音辨識:{error}", f"Cannot prepare local speech recognition: {error}"),
|
|
59
|
+
file=sys.stderr,
|
|
60
|
+
flush=True,
|
|
61
|
+
)
|
|
48
62
|
return 1
|
|
49
63
|
|
|
50
64
|
try:
|
|
51
65
|
state = manager.status().state
|
|
52
66
|
if state is ASRSetupState.READY:
|
|
53
|
-
print(
|
|
67
|
+
print(
|
|
68
|
+
tr(
|
|
69
|
+
"正在確認語音辨識環境使用 Clipen 自己的 Python…",
|
|
70
|
+
"Checking speech recognition runs on Clipen's own Python…",
|
|
71
|
+
),
|
|
72
|
+
flush=True,
|
|
73
|
+
)
|
|
74
|
+
if manager.reseat_runtime():
|
|
75
|
+
print(
|
|
76
|
+
tr(
|
|
77
|
+
"✓ 已改用 Clipen 自己的 Python 重建語音辨識環境(模型沿用)",
|
|
78
|
+
"✓ Rebuilt speech recognition on Clipen's own Python (model kept)",
|
|
79
|
+
),
|
|
80
|
+
flush=True,
|
|
81
|
+
)
|
|
82
|
+
print(tr("✓ 本機語音辨識已準備完成", "✓ Local speech recognition is ready"), flush=True)
|
|
54
83
|
return 0
|
|
55
84
|
if state is ASRSetupState.FAILED:
|
|
56
85
|
removed = manager.remove()
|
|
57
86
|
if removed.state is not ASRSetupState.SETUP_REQUIRED:
|
|
58
|
-
print(
|
|
87
|
+
print(
|
|
88
|
+
tr(
|
|
89
|
+
"無法安全清除不完整的語音辨識安裝",
|
|
90
|
+
"Cannot safely clear the incomplete speech recognition install",
|
|
91
|
+
),
|
|
92
|
+
file=sys.stderr,
|
|
93
|
+
flush=True,
|
|
94
|
+
)
|
|
59
95
|
return 1
|
|
60
96
|
manager.start_install(NOTICE_VERSION)
|
|
61
97
|
last_phase = None
|
|
@@ -78,26 +114,39 @@ def main(arguments: list[str] | None = None) -> int:
|
|
|
78
114
|
last_percent = status.progress_percent
|
|
79
115
|
last_reported_at = now
|
|
80
116
|
if status.state is ASRSetupState.READY:
|
|
81
|
-
print(
|
|
117
|
+
print(
|
|
118
|
+
tr(
|
|
119
|
+
"✓ 本機語音辨識與固定模型安裝完成",
|
|
120
|
+
"✓ Local speech recognition and its pinned model are installed",
|
|
121
|
+
),
|
|
122
|
+
flush=True,
|
|
123
|
+
)
|
|
82
124
|
return 0
|
|
83
125
|
if status.state is not ASRSetupState.INSTALLING:
|
|
84
126
|
diagnostics = manager.diagnostic_lines()
|
|
85
127
|
if diagnostics:
|
|
86
|
-
print("安裝器最後訊息:", file=sys.stderr, flush=True)
|
|
128
|
+
print(tr("安裝器最後訊息:", "Last installer output:"), file=sys.stderr, flush=True)
|
|
87
129
|
for line in diagnostics:
|
|
88
130
|
print(f" {line}", file=sys.stderr, flush=True)
|
|
89
131
|
print(
|
|
90
|
-
|
|
132
|
+
tr(
|
|
133
|
+
f"本機語音辨識設定失敗:{status.error_code or status.phase}",
|
|
134
|
+
f"Setting up local speech recognition failed: {status.error_code or status.phase}",
|
|
135
|
+
),
|
|
91
136
|
file=sys.stderr,
|
|
92
137
|
flush=True,
|
|
93
138
|
)
|
|
94
139
|
return 1
|
|
95
140
|
time.sleep(0.1)
|
|
96
141
|
except KeyboardInterrupt:
|
|
97
|
-
print("正在取消本機語音辨識設定…", flush=True)
|
|
142
|
+
print(tr("正在取消本機語音辨識設定…", "Cancelling the speech recognition setup…"), flush=True)
|
|
98
143
|
return 130
|
|
99
144
|
except ASRSetupError as error:
|
|
100
|
-
print(
|
|
145
|
+
print(
|
|
146
|
+
tr(f"本機語音辨識設定失敗:{error.code}", f"Setting up local speech recognition failed: {error.code}"),
|
|
147
|
+
file=sys.stderr,
|
|
148
|
+
flush=True,
|
|
149
|
+
)
|
|
101
150
|
return 1
|
|
102
151
|
finally:
|
|
103
152
|
manager.close(timeout=10)
|