@clipen/clipen-cli 1.0.0 → 1.0.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.
Files changed (132) hide show
  1. package/README.md +56 -48
  2. package/apps/web/dist/assets/{index-D5D2HiB1.js → index-DPHwA954.js} +1 -1
  3. package/apps/web/dist/index.html +1 -1
  4. package/bin/clipen.js +1 -1
  5. package/package.json +7 -6
  6. package/pyproject.toml +18 -2
  7. package/requirements/dev.txt +2 -0
  8. package/src/clipen/__init__.py +1 -1
  9. package/src/clipen/analysis/__init__.py +7 -7
  10. package/src/clipen/analysis/artifacts.py +4 -10
  11. package/src/clipen/analysis/audio.py +10 -8
  12. package/src/clipen/analysis/evidence_service.py +345 -167
  13. package/src/clipen/analysis/image_similarity.py +5 -14
  14. package/src/clipen/analysis/keyframes.py +5 -17
  15. package/src/clipen/analysis/models.py +5 -7
  16. package/src/clipen/analysis/qwen_worker.py +19 -54
  17. package/src/clipen/analysis/resources.py +2 -1
  18. package/src/clipen/analysis/runtime.py +1 -3
  19. package/src/clipen/analysis/service.py +16 -48
  20. package/src/clipen/analysis/setup.py +11 -25
  21. package/src/clipen/analysis/setup_cli.py +5 -15
  22. package/src/clipen/analysis/storage.py +96 -278
  23. package/src/clipen/analysis/transcription.py +40 -82
  24. package/src/clipen/analysis/visual.py +109 -48
  25. package/src/clipen/annotations/__init__.py +5 -2
  26. package/src/clipen/annotations/models.py +1 -1
  27. package/src/clipen/annotations/storage.py +132 -84
  28. package/src/clipen/annotations/suggestions.py +3 -8
  29. package/src/clipen/asr_release.py +4 -11
  30. package/src/clipen/bootstrap.py +71 -61
  31. package/src/clipen/{planning/models.py → candidates.py} +29 -47
  32. package/src/clipen/cli.py +4 -9
  33. package/src/clipen/controller/app.py +401 -214
  34. package/src/clipen/controller/server.py +28 -38
  35. package/src/clipen/domain/__init__.py +1 -1
  36. package/src/clipen/domain/media_time.py +3 -10
  37. package/src/clipen/domain/timeline.py +45 -47
  38. package/src/clipen/domain/validation.py +0 -1
  39. package/src/clipen/editing/__init__.py +1 -1
  40. package/src/clipen/editing/agent_models.py +4 -11
  41. package/src/clipen/editing/agent_repository.py +393 -172
  42. package/src/clipen/editing/agent_tools.py +180 -99
  43. package/src/clipen/editing/alignment.py +92 -52
  44. package/src/clipen/editing/alignment_setup.py +118 -70
  45. package/src/clipen/editing/alignment_worker.py +11 -9
  46. package/src/clipen/editing/change_report.py +95 -38
  47. package/src/clipen/editing/compiler.py +0 -1
  48. package/src/clipen/editing/component_looks.py +58 -34
  49. package/src/clipen/editing/component_review.py +34 -38
  50. package/src/clipen/editing/coordinator.py +213 -92
  51. package/src/clipen/editing/editorial_review.py +217 -95
  52. package/src/clipen/editing/evidence_jobs.py +457 -200
  53. package/src/clipen/editing/history_changes.py +129 -68
  54. package/src/clipen/editing/music_choices.py +8 -5
  55. package/src/clipen/editing/production_catalog.py +573 -136
  56. package/src/clipen/editing/production_limits.py +43 -17
  57. package/src/clipen/editing/production_media.py +376 -167
  58. package/src/clipen/editing/production_preview.py +322 -129
  59. package/src/clipen/editing/production_progress.py +164 -69
  60. package/src/clipen/editing/production_requirements.py +106 -39
  61. package/src/clipen/editing/production_tools.py +1064 -462
  62. package/src/clipen/editing/program_audio.py +211 -81
  63. package/src/clipen/editing/program_direction.py +59 -25
  64. package/src/clipen/editing/program_story.py +83 -45
  65. package/src/clipen/editing/program_subtitles.py +194 -96
  66. package/src/clipen/editing/programme_review.py +98 -50
  67. package/src/clipen/editing/prompt_history.py +64 -27
  68. package/src/clipen/editing/recut.py +65 -25
  69. package/src/clipen/editing/refinement_references.py +176 -86
  70. package/src/clipen/editing/resolve_export.py +449 -218
  71. package/src/clipen/editing/resolve_titles.py +162 -105
  72. package/src/clipen/editing/skill_tools.py +530 -154
  73. package/src/clipen/editing/source_dialogue.py +177 -67
  74. package/src/clipen/editing/speech_coverage.py +42 -22
  75. package/src/clipen/editing/speech_quality.py +6 -1
  76. package/src/clipen/editing/tool_receipts.py +78 -32
  77. package/src/clipen/editing/versions.py +122 -64
  78. package/src/clipen/editing/visual_preview.py +157 -61
  79. package/src/clipen/editing/workbench.py +104 -42
  80. package/src/clipen/finishing/audio.py +69 -30
  81. package/src/clipen/finishing/catalog.py +176 -93
  82. package/src/clipen/finishing/models.py +1 -1
  83. package/src/clipen/finishing/renderer.py +33 -14
  84. package/src/clipen/mcp_editing/__main__.py +3 -1
  85. package/src/clipen/mcp_editing/server.py +77 -34
  86. package/src/clipen/media/__init__.py +3 -3
  87. package/src/clipen/media/discovery.py +7 -20
  88. package/src/clipen/media/models.py +7 -18
  89. package/src/clipen/media/preview.py +14 -24
  90. package/src/clipen/media/probe.py +16 -44
  91. package/src/clipen/media/service.py +6 -19
  92. package/src/clipen/media/storage.py +33 -81
  93. package/src/clipen/music_vocabulary.py +33 -4
  94. package/src/clipen/power.py +8 -3
  95. package/src/clipen/projects/__init__.py +1 -1
  96. package/src/clipen/projects/deletion.py +19 -32
  97. package/src/clipen/projects/finishing_schema.py +3 -1
  98. package/src/clipen/projects/models.py +2 -5
  99. package/src/clipen/projects/picker.py +13 -37
  100. package/src/clipen/projects/service.py +8 -24
  101. package/src/clipen/projects/storage.py +226 -246
  102. package/src/clipen/provider_registry.py +9 -20
  103. package/src/clipen/providers/account.py +86 -35
  104. package/src/clipen/providers/claude.py +59 -25
  105. package/src/clipen/providers/claude_editing.py +14 -7
  106. package/src/clipen/providers/codex.py +73 -118
  107. package/src/clipen/providers/codex_editing.py +2 -2
  108. package/src/clipen/providers/editing_agent.py +19 -17
  109. package/src/clipen/providers/recovery.py +7 -8
  110. package/src/clipen/rendering/cover.py +18 -5
  111. package/src/clipen/rendering/custom_components.py +167 -79
  112. package/src/clipen/rendering/custom_render.py +62 -41
  113. package/src/clipen/rendering/production_effects.py +77 -45
  114. package/src/clipen/rendering/program_components.py +134 -73
  115. package/src/clipen/rendering/program_creator.py +432 -277
  116. package/src/clipen/rendering/program_identities.py +277 -182
  117. package/src/clipen/rendering/program_motion.py +140 -95
  118. package/src/clipen/rendering/program_studio.py +175 -116
  119. package/src/clipen/rendering/program_styles.py +231 -145
  120. package/src/clipen/rendering/program_subtitles.py +71 -34
  121. package/src/clipen/rendering/renderer.py +150 -121
  122. package/src/clipen/rendering/storage.py +9 -22
  123. package/src/clipen/rendering/titles.py +193 -86
  124. package/src/clipen/skills/__init__.py +1 -0
  125. package/src/clipen/skills/catalog.py +151 -55
  126. package/src/clipen/skills/library.py +13 -7
  127. package/src/clipen/skills/package.py +46 -23
  128. package/src/clipen/skills/visual_styles.py +29 -18
  129. package/src/clipen/workspace.py +15 -44
  130. package/install +0 -25
  131. package/src/clipen/planning/__init__.py +0 -9
  132. package/uninstall +0 -25
@@ -7,7 +7,7 @@
7
7
  <meta name="description" content="Clipen 本機 AI 剪輯工作台" />
8
8
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
9
9
  <title>Clipen · 你的作品</title>
10
- <script type="module" crossorigin src="/assets/index-D5D2HiB1.js"></script>
10
+ <script type="module" crossorigin src="/assets/index-DPHwA954.js"></script>
11
11
  <link rel="stylesheet" crossorigin href="/assets/index-DIMuOXSu.css">
12
12
  </head>
13
13
  <body>
package/bin/clipen.js CHANGED
@@ -23,7 +23,7 @@ const PYTHON = {
23
23
  bytes: 25035343,
24
24
  }
25
25
  // What the program needs at run time; the rest of the package (this launcher) stays in npx's cache.
26
- const PROGRAM = ['src', 'apps/web/dist', 'requirements', 'pyproject.toml', 'clipen', 'install', 'uninstall', 'README.md', 'LICENSE']
26
+ const PROGRAM = ['src', 'apps/web/dist', 'requirements', 'pyproject.toml', 'clipen', 'README.md', 'LICENSE']
27
27
  const FONTS = 'src/clipen/rendering/fonts'
28
28
 
29
29
  function dataRoot() {
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@clipen/clipen-cli",
3
- "version": "1.0.0",
4
- "description": "Clipen:本機 AI 剪輯工作台",
3
+ "version": "1.0.2",
4
+ "description": "讓 AI 用 Claude Code 或 Codex 幫你剪影片,再用時間線上的審片注記修改",
5
5
  "keywords": [
6
6
  "video-editing",
7
7
  "ai",
8
- "claude",
8
+ "claude-code",
9
9
  "codex",
10
10
  "vlog",
11
+ "local-first",
11
12
  "cli"
12
13
  ],
13
14
  "homepage": "https://github.com/IMGMANISME/clipen#readme",
@@ -31,8 +32,6 @@
31
32
  "requirements/",
32
33
  "pyproject.toml",
33
34
  "clipen",
34
- "install",
35
- "uninstall",
36
35
  "README.md",
37
36
  "LICENSE"
38
37
  ],
@@ -46,7 +45,9 @@
46
45
  "arm64"
47
46
  ],
48
47
  "scripts": {
49
- "test": "node --test tests/npm/"
48
+ "prepack": "npm --prefix apps/web run build 1>&2",
49
+ "test": "node --test tests/npm/",
50
+ "release": "node scripts/release.mjs"
50
51
  },
51
52
  "publishConfig": {
52
53
  "access": "public"
package/pyproject.toml CHANGED
@@ -4,11 +4,22 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "clipen"
7
- version = "1.0.0"
8
- description = "Local AI-assisted video editing workspace"
7
+ version = "1.0.2"
8
+ description = "Let AI cut your video with Claude Code or Codex, and review it with notes on the timeline"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
11
11
  license = { text = "MIT" }
12
+ authors = [{ name = "GMAN" }]
13
+ keywords = ["video-editing", "ai", "claude-code", "codex", "vlog", "local-first"]
14
+ classifiers = [
15
+ "Development Status :: 5 - Production/Stable",
16
+ "Environment :: MacOS X",
17
+ "Intended Audience :: End Users/Desktop",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Operating System :: MacOS",
20
+ "Programming Language :: Python :: 3",
21
+ "Topic :: Multimedia :: Video :: Non-Linear Editor",
22
+ ]
12
23
  dependencies = [
13
24
  "cryptography==50.0.1",
14
25
  "jsonschema==4.26.0",
@@ -18,6 +29,11 @@ dependencies = [
18
29
  "uvicorn==0.52.4",
19
30
  ]
20
31
 
32
+ [project.urls]
33
+ Homepage = "https://github.com/IMGMANISME/clipen"
34
+ Issues = "https://github.com/IMGMANISME/clipen/issues"
35
+ npm = "https://www.npmjs.com/package/@clipen/clipen-cli"
36
+
21
37
  [tool.setuptools.packages.find]
22
38
  where = ["src"]
23
39
 
@@ -0,0 +1,2 @@
1
+ # Tools for working on Clipen itself; the app does not need them.
2
+ ruff==0.14.6
@@ -1,3 +1,3 @@
1
1
  """Clipen product package."""
2
2
 
3
- __version__ = "1.0.0"
3
+ __version__ = "1.0.2"
@@ -13,6 +13,7 @@ from .audio import (
13
13
  inspect_normalized_audio,
14
14
  project_samples_to_source,
15
15
  )
16
+ from .keyframes import AdaptiveKeyframeSelector, KeyframeCandidate, KeyframeSelection
16
17
  from .models import (
17
18
  ArtifactKind,
18
19
  ArtifactRecord,
@@ -23,7 +24,9 @@ from .models import (
23
24
  PreparationState,
24
25
  TimelineSegment,
25
26
  )
26
- from .keyframes import AdaptiveKeyframeSelector, KeyframeCandidate, KeyframeSelection
27
+ from .runtime import ManagedAnalysisRuntime
28
+ from .service import PreparationCoordinator, PreparationRecipe
29
+ from .setup import ASRSetupError, ASRSetupManager, ASRSetupState, ASRSetupStatus
27
30
  from .storage import (
28
31
  PreparationChunk,
29
32
  PreparationRepository,
@@ -31,16 +34,13 @@ from .storage import (
31
34
  PreparationTarget,
32
35
  PreparationWorkItem,
33
36
  )
34
- from .service import PreparationCoordinator, PreparationRecipe
35
- from .runtime import ManagedAnalysisRuntime
36
- from .setup import ASRSetupError, ASRSetupManager, ASRSetupState, ASRSetupStatus
37
37
  from .transcription import (
38
- Qwen3ASRAdapter,
39
38
  LocalModelSnapshot,
40
- TranscriptSegment,
41
- TranscriptWord,
39
+ Qwen3ASRAdapter,
42
40
  TranscriptionError,
43
41
  TranscriptionResult,
42
+ TranscriptSegment,
43
+ TranscriptWord,
44
44
  hash_model_directory,
45
45
  )
46
46
 
@@ -3,14 +3,14 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import hashlib
6
- from functools import wraps
7
6
  import json
8
7
  import os
9
- from pathlib import Path
10
8
  import re
11
9
  import secrets
12
10
  import stat
13
11
  import threading
12
+ from functools import wraps
13
+ from pathlib import Path
14
14
  from typing import Callable, Iterable, Mapping, TypeVar
15
15
 
16
16
  from clipen.filesystem import restrict_permissions
@@ -26,7 +26,6 @@ from .models import (
26
26
  validate_recipe_id,
27
27
  )
28
28
 
29
-
30
29
  _READ_SIZE = 1024 * 1024
31
30
  _BLOB_PATH = re.compile(r"artifacts/sha256/([0-9a-f]{2})/([0-9a-f]{64})\Z")
32
31
  _STORE_LOCKS_GUARD = threading.Lock()
@@ -228,9 +227,7 @@ class ArtifactStore:
228
227
  with self.projects.connect(project_id) as connection:
229
228
  live = {
230
229
  row["relative_path"]
231
- for row in connection.execute(
232
- "SELECT DISTINCT relative_path FROM artifacts"
233
- ).fetchall()
230
+ for row in connection.execute("SELECT DISTINCT relative_path FROM artifacts").fetchall()
234
231
  }
235
232
  project_root = self._project_root(project_id)
236
233
  removed = 0
@@ -239,10 +236,7 @@ class ArtifactStore:
239
236
  try:
240
237
  parent = candidate.parent.resolve(strict=True)
241
238
  expected_parent = project_root / "artifacts" / "sha256" / candidate.parent.name
242
- if (
243
- parent != expected_parent
244
- or candidate.is_symlink()
245
- ):
239
+ if parent != expected_parent or candidate.is_symlink():
246
240
  continue
247
241
  info = os.lstat(candidate)
248
242
  if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1:
@@ -2,11 +2,8 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from dataclasses import dataclass
6
- from fractions import Fraction
7
5
  import math
8
6
  import os
9
- from pathlib import Path
10
7
  import re
11
8
  import shutil
12
9
  import signal
@@ -15,18 +12,19 @@ import subprocess
15
12
  import tempfile
16
13
  import threading
17
14
  import time
18
- from typing import Callable
19
15
  import wave
16
+ from dataclasses import dataclass
17
+ from fractions import Fraction
18
+ from pathlib import Path
19
+ from typing import Callable
20
20
 
21
+ from clipen.domain.media_time import Rational, SourceSpan
21
22
  from clipen.media import InventoryRoot, bounded_file_fingerprint
22
23
  from clipen.media.discovery import DiscoveryError, open_file_beneath
23
24
  from clipen.media.models import validate_relative_path
24
25
 
25
26
  from .resources import local_analysis_slot
26
27
 
27
- from .models import Rational, SourceSpan
28
-
29
-
30
28
  _VERSION_ID = re.compile(r"av_[0-9a-f]{32}\Z")
31
29
  _POLL_SECONDS = 0.05
32
30
  _MAX_CAPTURE_BYTES = 1024 * 1024
@@ -200,7 +198,11 @@ class FFmpegAudioAdapter:
200
198
  *,
201
199
  observed_output: Path | None = None,
202
200
  ) -> tuple[bytes, bytes, int]:
203
- with local_analysis_slot(cancel, lambda: AudioPreparationError("cancelled")), tempfile.TemporaryFile() as stdout_file, tempfile.TemporaryFile() as stderr_file:
201
+ with (
202
+ local_analysis_slot(cancel, lambda: AudioPreparationError("cancelled")),
203
+ tempfile.TemporaryFile() as stdout_file,
204
+ tempfile.TemporaryFile() as stderr_file,
205
+ ):
204
206
  deadline = time.monotonic() + self.timeout_seconds
205
207
  try:
206
208
  process = subprocess.Popen(