@lingjingai/scriptctl 0.34.0 → 0.36.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.
Files changed (375) hide show
  1. package/README.md +30 -5
  2. package/changes/0.35.0.md +22 -0
  3. package/changes/0.36.0.md +22 -0
  4. package/changes/unreleased.md +3 -5
  5. package/dist/cli.d.ts +2 -1
  6. package/dist/cli.js +56 -128
  7. package/dist/cli.js.map +1 -1
  8. package/dist/common.d.ts +0 -16
  9. package/dist/common.js +2 -342
  10. package/dist/common.js.map +1 -1
  11. package/dist/domain/ingest/apply-plan.d.ts +23 -0
  12. package/dist/domain/ingest/apply-plan.js +210 -0
  13. package/dist/domain/ingest/apply-plan.js.map +1 -0
  14. package/dist/domain/ingest/assembler.d.ts +57 -0
  15. package/dist/domain/ingest/assembler.js +181 -0
  16. package/dist/domain/ingest/assembler.js.map +1 -0
  17. package/dist/domain/ingest/chunker.d.ts +9 -0
  18. package/dist/domain/ingest/chunker.js +38 -0
  19. package/dist/domain/ingest/chunker.js.map +1 -0
  20. package/dist/domain/ingest/evidence.d.ts +5 -0
  21. package/dist/domain/ingest/evidence.js +66 -0
  22. package/dist/domain/ingest/evidence.js.map +1 -0
  23. package/dist/domain/ingest/govern.d.ts +3 -0
  24. package/dist/domain/ingest/govern.js +127 -0
  25. package/dist/domain/ingest/govern.js.map +1 -0
  26. package/dist/domain/ingest/jsonl-parser.d.ts +6 -0
  27. package/dist/domain/ingest/jsonl-parser.js +187 -0
  28. package/dist/domain/ingest/jsonl-parser.js.map +1 -0
  29. package/dist/domain/ingest/markdown-parser.d.ts +6 -0
  30. package/dist/domain/ingest/markdown-parser.js +186 -0
  31. package/dist/domain/ingest/markdown-parser.js.map +1 -0
  32. package/dist/domain/ingest/records.d.ts +71 -0
  33. package/dist/domain/ingest/records.js +9 -0
  34. package/dist/domain/ingest/records.js.map +1 -0
  35. package/dist/domain/ingest/renumber.d.ts +14 -0
  36. package/dist/domain/ingest/renumber.js +130 -0
  37. package/dist/domain/ingest/renumber.js.map +1 -0
  38. package/dist/domain/ingest/script-v3.d.ts +94 -0
  39. package/dist/domain/ingest/script-v3.js +7 -0
  40. package/dist/domain/ingest/script-v3.js.map +1 -0
  41. package/dist/domain/ingest/state-reconcile.d.ts +11 -0
  42. package/dist/domain/ingest/state-reconcile.js +90 -0
  43. package/dist/domain/ingest/state-reconcile.js.map +1 -0
  44. package/dist/domain/ingest/validation.d.ts +11 -0
  45. package/dist/domain/ingest/validation.js +168 -0
  46. package/dist/domain/ingest/validation.js.map +1 -0
  47. package/dist/domain/ingest/video-aggregate.d.ts +23 -0
  48. package/dist/domain/ingest/video-aggregate.js +89 -0
  49. package/dist/domain/ingest/video-aggregate.js.map +1 -0
  50. package/dist/domain/ingest/video-apply.d.ts +37 -0
  51. package/dist/domain/ingest/video-apply.js +236 -0
  52. package/dist/domain/ingest/video-apply.js.map +1 -0
  53. package/dist/domain/ingest/video-md-parser.d.ts +2 -0
  54. package/dist/domain/ingest/video-md-parser.js +233 -0
  55. package/dist/domain/ingest/video-md-parser.js.map +1 -0
  56. package/dist/domain/ingest/video-records.d.ts +56 -0
  57. package/dist/domain/ingest/video-records.js +9 -0
  58. package/dist/domain/ingest/video-records.js.map +1 -0
  59. package/dist/domain/loom/index.d.ts +2 -1
  60. package/dist/domain/loom/index.js +12 -10
  61. package/dist/domain/loom/index.js.map +1 -1
  62. package/dist/domain/loom/types.d.ts +3 -2
  63. package/dist/domain/script/lookups.d.ts +3 -2
  64. package/dist/domain/script/lookups.js +25 -8
  65. package/dist/domain/script/lookups.js.map +1 -1
  66. package/dist/domain/script/patch/apply.js +2 -2
  67. package/dist/domain/script/patch/apply.js.map +1 -1
  68. package/dist/domain/script/patch/helpers.d.ts +3 -7
  69. package/dist/domain/script/patch/helpers.js +23 -96
  70. package/dist/domain/script/patch/helpers.js.map +1 -1
  71. package/dist/domain/script/patch/ops-action.d.ts +0 -2
  72. package/dist/domain/script/patch/ops-action.js +34 -100
  73. package/dist/domain/script/patch/ops-action.js.map +1 -1
  74. package/dist/domain/script/patch/ops-asset.d.ts +1 -0
  75. package/dist/domain/script/patch/ops-asset.js +102 -155
  76. package/dist/domain/script/patch/ops-asset.js.map +1 -1
  77. package/dist/domain/script/patch/ops-dialogue.d.ts +1 -4
  78. package/dist/domain/script/patch/ops-dialogue.js +43 -220
  79. package/dist/domain/script/patch/ops-dialogue.js.map +1 -1
  80. package/dist/domain/script/patch/ops-extend.js +8 -2
  81. package/dist/domain/script/patch/ops-extend.js.map +1 -1
  82. package/dist/domain/script/patch/ops-meta.js.map +1 -1
  83. package/dist/domain/script/patch/ops-scene.js +26 -39
  84. package/dist/domain/script/patch/ops-scene.js.map +1 -1
  85. package/dist/domain/script/patch/ops-state.d.ts +3 -3
  86. package/dist/domain/script/patch/ops-state.js +33 -49
  87. package/dist/domain/script/patch/ops-state.js.map +1 -1
  88. package/dist/domain/script/patch/registry.js +9 -13
  89. package/dist/domain/script/patch/registry.js.map +1 -1
  90. package/dist/domain/script/refs.js +23 -111
  91. package/dist/domain/script/refs.js.map +1 -1
  92. package/dist/domain/script/scene-refs.d.ts +3 -0
  93. package/dist/domain/script/scene-refs.js +35 -0
  94. package/dist/domain/script/scene-refs.js.map +1 -0
  95. package/dist/domain/script/schema.js +17 -21
  96. package/dist/domain/script/schema.js.map +1 -1
  97. package/dist/domain/script/text-util.d.ts +7 -0
  98. package/dist/domain/script/text-util.js +91 -0
  99. package/dist/domain/script/text-util.js.map +1 -0
  100. package/dist/help-text.js +145 -414
  101. package/dist/help-text.js.map +1 -1
  102. package/dist/infra/converters.js +1 -1
  103. package/dist/infra/converters.js.map +1 -1
  104. package/dist/infra/episode-title.d.ts +4 -0
  105. package/dist/infra/episode-title.js +129 -0
  106. package/dist/infra/episode-title.js.map +1 -0
  107. package/dist/infra/ingest/review-renderer.d.ts +1 -0
  108. package/dist/infra/ingest/review-renderer.js +431 -0
  109. package/dist/infra/ingest/review-renderer.js.map +1 -0
  110. package/dist/infra/ingest/source-resolver.d.ts +21 -0
  111. package/dist/infra/ingest/source-resolver.js +51 -0
  112. package/dist/infra/ingest/source-resolver.js.map +1 -0
  113. package/dist/infra/ingest/text-reader.d.ts +3 -0
  114. package/dist/infra/ingest/text-reader.js +27 -0
  115. package/dist/infra/ingest/text-reader.js.map +1 -0
  116. package/dist/infra/ingest/video-discovery.d.ts +8 -0
  117. package/dist/infra/ingest/video-discovery.js +60 -0
  118. package/dist/infra/ingest/video-discovery.js.map +1 -0
  119. package/dist/infra/ingest/workspace-store.d.ts +18 -0
  120. package/dist/infra/ingest/workspace-store.js +70 -0
  121. package/dist/infra/ingest/workspace-store.js.map +1 -0
  122. package/dist/infra/llm/anthropic-model.d.ts +11 -0
  123. package/dist/infra/llm/anthropic-model.js +109 -0
  124. package/dist/infra/llm/anthropic-model.js.map +1 -0
  125. package/dist/infra/llm/gemini-upload.d.ts +9 -0
  126. package/dist/infra/llm/gemini-upload.js +94 -0
  127. package/dist/infra/llm/gemini-upload.js.map +1 -0
  128. package/dist/infra/llm/gemini-video-model.d.ts +47 -0
  129. package/dist/infra/llm/gemini-video-model.js +167 -0
  130. package/dist/infra/llm/gemini-video-model.js.map +1 -0
  131. package/dist/infra/llm/openai-compatible-model.d.ts +13 -0
  132. package/dist/infra/llm/openai-compatible-model.js +143 -0
  133. package/dist/infra/llm/openai-compatible-model.js.map +1 -0
  134. package/dist/infra/llm/proxy.d.ts +1 -0
  135. package/dist/infra/llm/proxy.js +30 -0
  136. package/dist/infra/llm/proxy.js.map +1 -0
  137. package/dist/infra/llm/retry.d.ts +5 -0
  138. package/dist/infra/llm/retry.js +20 -0
  139. package/dist/infra/llm/retry.js.map +1 -0
  140. package/dist/llm/composition.d.ts +5 -0
  141. package/dist/llm/composition.js +5 -0
  142. package/dist/llm/composition.js.map +1 -0
  143. package/dist/llm/config.d.ts +26 -0
  144. package/dist/llm/config.js +201 -0
  145. package/dist/llm/config.js.map +1 -0
  146. package/dist/llm/registry.d.ts +44 -0
  147. package/dist/llm/registry.js +48 -0
  148. package/dist/llm/registry.js.map +1 -0
  149. package/dist/llm/router.d.ts +23 -0
  150. package/dist/llm/router.js +0 -0
  151. package/dist/llm/router.js.map +1 -0
  152. package/dist/llm/tasks/ingest/asset-curate.d.ts +13 -0
  153. package/dist/llm/tasks/ingest/asset-curate.js +45 -0
  154. package/dist/llm/tasks/ingest/asset-curate.js.map +1 -0
  155. package/dist/llm/tasks/ingest/asset-extract.d.ts +12 -0
  156. package/dist/llm/tasks/ingest/asset-extract.js +51 -0
  157. package/dist/llm/tasks/ingest/asset-extract.js.map +1 -0
  158. package/dist/llm/tasks/ingest/asset-govern.d.ts +22 -0
  159. package/dist/llm/tasks/ingest/asset-govern.js +143 -0
  160. package/dist/llm/tasks/ingest/asset-govern.js.map +1 -0
  161. package/dist/llm/tasks/ingest/mention-resolve.d.ts +9 -0
  162. package/dist/llm/tasks/ingest/mention-resolve.js +39 -0
  163. package/dist/llm/tasks/ingest/mention-resolve.js.map +1 -0
  164. package/dist/llm/tasks/ingest/plot-speaker.d.ts +11 -0
  165. package/dist/llm/tasks/ingest/plot-speaker.js +72 -0
  166. package/dist/llm/tasks/ingest/plot-speaker.js.map +1 -0
  167. package/dist/llm/tasks/ingest/roster-merge.d.ts +46 -0
  168. package/dist/llm/tasks/ingest/roster-merge.js +235 -0
  169. package/dist/llm/tasks/ingest/roster-merge.js.map +1 -0
  170. package/dist/llm/tasks/ingest/state-merge.d.ts +10 -0
  171. package/dist/llm/tasks/ingest/state-merge.js +84 -0
  172. package/dist/llm/tasks/ingest/state-merge.js.map +1 -0
  173. package/dist/llm/tasks/ingest/state-reconcile.d.ts +8 -0
  174. package/dist/llm/tasks/ingest/state-reconcile.js +44 -0
  175. package/dist/llm/tasks/ingest/state-reconcile.js.map +1 -0
  176. package/dist/llm/tasks/ingest/text-normalize.d.ts +10 -0
  177. package/dist/llm/tasks/ingest/text-normalize.js +89 -0
  178. package/dist/llm/tasks/ingest/text-normalize.js.map +1 -0
  179. package/dist/llm/tasks/ingest/video-correct.d.ts +30 -0
  180. package/dist/llm/tasks/ingest/video-correct.js +144 -0
  181. package/dist/llm/tasks/ingest/video-correct.js.map +1 -0
  182. package/dist/llm/tasks/ingest/video-transcribe.d.ts +4 -0
  183. package/dist/llm/tasks/ingest/video-transcribe.js +105 -0
  184. package/dist/llm/tasks/ingest/video-transcribe.js.map +1 -0
  185. package/dist/llm/tasks/schemas.d.ts +5 -0
  186. package/dist/llm/tasks/schemas.js +107 -0
  187. package/dist/llm/tasks/schemas.js.map +1 -0
  188. package/dist/llm/types.d.ts +97 -0
  189. package/dist/llm/types.js +13 -0
  190. package/dist/llm/types.js.map +1 -0
  191. package/dist/usecases/doctor.d.ts +1 -1
  192. package/dist/usecases/doctor.js +36 -9
  193. package/dist/usecases/doctor.js.map +1 -1
  194. package/dist/usecases/ingest/command.d.ts +5 -0
  195. package/dist/usecases/ingest/command.js +57 -0
  196. package/dist/usecases/ingest/command.js.map +1 -0
  197. package/dist/usecases/ingest/fanout.d.ts +10 -0
  198. package/dist/usecases/ingest/fanout.js +23 -0
  199. package/dist/usecases/ingest/fanout.js.map +1 -0
  200. package/dist/usecases/ingest/pass4-mention-resolve.d.ts +11 -0
  201. package/dist/usecases/ingest/pass4-mention-resolve.js +52 -0
  202. package/dist/usecases/ingest/pass4-mention-resolve.js.map +1 -0
  203. package/dist/usecases/ingest/pass5-extract.d.ts +7 -0
  204. package/dist/usecases/ingest/pass5-extract.js +50 -0
  205. package/dist/usecases/ingest/pass5-extract.js.map +1 -0
  206. package/dist/usecases/ingest/pass5-govern.d.ts +13 -0
  207. package/dist/usecases/ingest/pass5-govern.js +155 -0
  208. package/dist/usecases/ingest/pass5-govern.js.map +1 -0
  209. package/dist/usecases/ingest/pipeline.d.ts +28 -0
  210. package/dist/usecases/ingest/pipeline.js +144 -0
  211. package/dist/usecases/ingest/pipeline.js.map +1 -0
  212. package/dist/usecases/ingest/publish-command.d.ts +4 -0
  213. package/dist/usecases/ingest/publish-command.js +77 -0
  214. package/dist/usecases/ingest/publish-command.js.map +1 -0
  215. package/dist/usecases/ingest/status.d.ts +39 -0
  216. package/dist/usecases/ingest/status.js +155 -0
  217. package/dist/usecases/ingest/status.js.map +1 -0
  218. package/dist/usecases/ingest/video-pass3.d.ts +26 -0
  219. package/dist/usecases/ingest/video-pass3.js +0 -0
  220. package/dist/usecases/ingest/video-pass3.js.map +1 -0
  221. package/dist/usecases/ingest/video-pipeline.d.ts +32 -0
  222. package/dist/usecases/ingest/video-pipeline.js +202 -0
  223. package/dist/usecases/ingest/video-pipeline.js.map +1 -0
  224. package/dist/usecases/ingest/view-command.d.ts +4 -0
  225. package/dist/usecases/ingest/view-command.js +51 -0
  226. package/dist/usecases/ingest/view-command.js.map +1 -0
  227. package/dist/usecases/script/actions.js +2 -2
  228. package/dist/usecases/script/actions.js.map +1 -1
  229. package/dist/usecases/script/actor.js.map +1 -1
  230. package/dist/usecases/script/actors.js +1 -0
  231. package/dist/usecases/script/actors.js.map +1 -1
  232. package/dist/usecases/script/add-actor.js.map +1 -1
  233. package/dist/usecases/script/add-episode.js.map +1 -1
  234. package/dist/usecases/script/add-location.js.map +1 -1
  235. package/dist/usecases/script/add-prop.js.map +1 -1
  236. package/dist/usecases/script/alias.js.map +1 -1
  237. package/dist/usecases/script/assets.js +2 -1
  238. package/dist/usecases/script/assets.js.map +1 -1
  239. package/dist/usecases/script/context.js.map +1 -1
  240. package/dist/usecases/script/create.js +3 -6
  241. package/dist/usecases/script/create.js.map +1 -1
  242. package/dist/usecases/script/delete.js.map +1 -1
  243. package/dist/usecases/script/describe.js.map +1 -1
  244. package/dist/usecases/script/dialogue.js +6 -13
  245. package/dist/usecases/script/dialogue.js.map +1 -1
  246. package/dist/usecases/script/do.js +1 -1
  247. package/dist/usecases/script/do.js.map +1 -1
  248. package/dist/usecases/script/episodes.js.map +1 -1
  249. package/dist/usecases/script/{add-speaker.d.ts → importance.d.ts} +1 -1
  250. package/dist/usecases/script/importance.js +17 -0
  251. package/dist/usecases/script/importance.js.map +1 -0
  252. package/dist/usecases/script/insert.js.map +1 -1
  253. package/dist/usecases/script/issues.js.map +1 -1
  254. package/dist/usecases/script/lib.d.ts +19 -6
  255. package/dist/usecases/script/lib.js +173 -99
  256. package/dist/usecases/script/lib.js.map +1 -1
  257. package/dist/usecases/script/locations.js +1 -0
  258. package/dist/usecases/script/locations.js.map +1 -1
  259. package/dist/usecases/script/merge.js.map +1 -1
  260. package/dist/usecases/script/move.js.map +1 -1
  261. package/dist/usecases/script/props.js +1 -0
  262. package/dist/usecases/script/props.js.map +1 -1
  263. package/dist/usecases/script/refs.js.map +1 -1
  264. package/dist/usecases/script/rename.js.map +1 -1
  265. package/dist/usecases/script/replace.js.map +1 -1
  266. package/dist/usecases/script/role.js.map +1 -1
  267. package/dist/usecases/script/scenes.js +8 -15
  268. package/dist/usecases/script/scenes.js.map +1 -1
  269. package/dist/usecases/script/script-patch.js +1 -1
  270. package/dist/usecases/script/script-patch.js.map +1 -1
  271. package/dist/usecases/script/script-validate.js +1 -1
  272. package/dist/usecases/script/script-validate.js.map +1 -1
  273. package/dist/usecases/script/session.d.ts +4 -4
  274. package/dist/usecases/script/session.js +57 -78
  275. package/dist/usecases/script/session.js.map +1 -1
  276. package/dist/usecases/script/split.js.map +1 -1
  277. package/dist/usecases/script/state-add.js.map +1 -1
  278. package/dist/usecases/script/state-delete.js.map +1 -1
  279. package/dist/usecases/script/state-rename.js.map +1 -1
  280. package/dist/usecases/script/states.js +58 -13
  281. package/dist/usecases/script/states.js.map +1 -1
  282. package/dist/usecases/script/summary.js +8 -0
  283. package/dist/usecases/script/summary.js.map +1 -1
  284. package/dist/usecases/script/synopsis-generate.d.ts +4 -5
  285. package/dist/usecases/script/synopsis-generate.js +30 -46
  286. package/dist/usecases/script/synopsis-generate.js.map +1 -1
  287. package/dist/usecases/script/transition.js.map +1 -1
  288. package/dist/usecases/script/type.js.map +1 -1
  289. package/dist/usecases/script/worldview.js.map +1 -1
  290. package/package.json +11 -3
  291. package/scripts/install-skill.mjs +120 -0
  292. package/skills/scriptctl/SKILL.md +293 -0
  293. package/skills/scriptctl/references/atomic-write-workflow.md +117 -0
  294. package/skills/scriptctl/references/ingest-workflow.md +85 -0
  295. package/skills/scriptctl/references/state-reference-repair.md +59 -0
  296. package/dist/domain/direct/runner.d.ts +0 -25
  297. package/dist/domain/direct/runner.js +0 -88
  298. package/dist/domain/direct/runner.js.map +0 -1
  299. package/dist/domain/direct/stage.d.ts +0 -108
  300. package/dist/domain/direct/stage.js +0 -134
  301. package/dist/domain/direct/stage.js.map +0 -1
  302. package/dist/domain/direct/stages/asset-curation.d.ts +0 -2
  303. package/dist/domain/direct/stages/asset-curation.js +0 -10
  304. package/dist/domain/direct/stages/asset-curation.js.map +0 -1
  305. package/dist/domain/direct/stages/batch-extract.d.ts +0 -2
  306. package/dist/domain/direct/stages/batch-extract.js +0 -12
  307. package/dist/domain/direct/stages/batch-extract.js.map +0 -1
  308. package/dist/domain/direct/stages/batch-plan.d.ts +0 -2
  309. package/dist/domain/direct/stages/batch-plan.js +0 -9
  310. package/dist/domain/direct/stages/batch-plan.js.map +0 -1
  311. package/dist/domain/direct/stages/episode-merge.d.ts +0 -2
  312. package/dist/domain/direct/stages/episode-merge.js +0 -11
  313. package/dist/domain/direct/stages/episode-merge.js.map +0 -1
  314. package/dist/domain/direct/stages/episode-plan.d.ts +0 -2
  315. package/dist/domain/direct/stages/episode-plan.js +0 -9
  316. package/dist/domain/direct/stages/episode-plan.js.map +0 -1
  317. package/dist/domain/direct/stages/episode-synopsis.d.ts +0 -2
  318. package/dist/domain/direct/stages/episode-synopsis.js +0 -12
  319. package/dist/domain/direct/stages/episode-synopsis.js.map +0 -1
  320. package/dist/domain/direct/stages/episode-titles.d.ts +0 -2
  321. package/dist/domain/direct/stages/episode-titles.js +0 -12
  322. package/dist/domain/direct/stages/episode-titles.js.map +0 -1
  323. package/dist/domain/direct/stages/index.d.ts +0 -19
  324. package/dist/domain/direct/stages/index.js +0 -41
  325. package/dist/domain/direct/stages/index.js.map +0 -1
  326. package/dist/domain/direct/stages/metadata.d.ts +0 -2
  327. package/dist/domain/direct/stages/metadata.js +0 -11
  328. package/dist/domain/direct/stages/metadata.js.map +0 -1
  329. package/dist/domain/direct/stages/script-merge.d.ts +0 -2
  330. package/dist/domain/direct/stages/script-merge.js +0 -15
  331. package/dist/domain/direct/stages/script-merge.js.map +0 -1
  332. package/dist/domain/direct/stages/script-synopsis.d.ts +0 -2
  333. package/dist/domain/direct/stages/script-synopsis.js +0 -12
  334. package/dist/domain/direct/stages/script-synopsis.js.map +0 -1
  335. package/dist/domain/direct/stages/source-prepare.d.ts +0 -2
  336. package/dist/domain/direct/stages/source-prepare.js +0 -9
  337. package/dist/domain/direct/stages/source-prepare.js.map +0 -1
  338. package/dist/domain/direct/stages/state-binding.d.ts +0 -2
  339. package/dist/domain/direct/stages/state-binding.js +0 -9
  340. package/dist/domain/direct/stages/state-binding.js.map +0 -1
  341. package/dist/domain/direct/stages/state-curation.d.ts +0 -2
  342. package/dist/domain/direct/stages/state-curation.js +0 -10
  343. package/dist/domain/direct/stages/state-curation.js.map +0 -1
  344. package/dist/domain/direct/stages/validate.d.ts +0 -2
  345. package/dist/domain/direct/stages/validate.js +0 -10
  346. package/dist/domain/direct/stages/validate.js.map +0 -1
  347. package/dist/domain/direct-core.d.ts +0 -313
  348. package/dist/domain/direct-core.js +0 -8516
  349. package/dist/domain/direct-core.js.map +0 -1
  350. package/dist/domain/script/validate.d.ts +0 -22
  351. package/dist/domain/script/validate.js +0 -997
  352. package/dist/domain/script/validate.js.map +0 -1
  353. package/dist/infra/providers.d.ts +0 -97
  354. package/dist/infra/providers.js +0 -1396
  355. package/dist/infra/providers.js.map +0 -1
  356. package/dist/usecases/direct.d.ts +0 -27
  357. package/dist/usecases/direct.js +0 -4172
  358. package/dist/usecases/direct.js.map +0 -1
  359. package/dist/usecases/parse.d.ts +0 -15
  360. package/dist/usecases/parse.js +0 -429
  361. package/dist/usecases/parse.js.map +0 -1
  362. package/dist/usecases/script/add-speaker.js +0 -22
  363. package/dist/usecases/script/add-speaker.js.map +0 -1
  364. package/dist/usecases/script/export.d.ts +0 -3
  365. package/dist/usecases/script/export.js +0 -111
  366. package/dist/usecases/script/export.js.map +0 -1
  367. package/dist/usecases/script/overlap.d.ts +0 -3
  368. package/dist/usecases/script/overlap.js +0 -21
  369. package/dist/usecases/script/overlap.js.map +0 -1
  370. package/dist/usecases/script/speakers.d.ts +0 -3
  371. package/dist/usecases/script/speakers.js +0 -28
  372. package/dist/usecases/script/speakers.js.map +0 -1
  373. package/dist/usecases/script/state-change.d.ts +0 -3
  374. package/dist/usecases/script/state-change.js +0 -24
  375. package/dist/usecases/script/state-change.js.map +0 -1
package/dist/help-text.js CHANGED
@@ -6,25 +6,25 @@ const HELP_ENTRIES = [
6
6
  Usage
7
7
  - scriptctl <query> [flags] # read a script
8
8
  - scriptctl <verb> <address> [flags] # edit a script
9
- - scriptctl direct <command> [flags] # existing material draft script
10
- - scriptctl parse [dir] [flags] # md workspace → script
9
+ - scriptctl ingest --source-path SRC # txt/md/docx/videoScript v3
11
10
 
12
11
  Workflows
13
- - direct Existing source conversion. Run: scriptctl direct --help
14
- - parse Deterministic md assembly. Run: scriptctl parse --help
12
+ - ingest txt/md/docx/video Script v3 workspace. Run: scriptctl ingest --help
13
+ - view Render a workspace script.json to review.html (no model)
14
+ - publish Validate a workspace script.json + write to the output store
15
15
 
16
16
  Read
17
17
  - summary | episodes | scenes | actions
18
- - actors | locations | props | assets | states | speakers
18
+ - actors | locations | props | assets | states
19
19
  - issues | refs | validate
20
20
 
21
21
  Write
22
- - create | add-actor | add-location | add-prop | add-episode | add-speaker
22
+ - create | add-actor | add-location | add-prop | add-episode
23
23
  - replace | type | actor | emotion
24
24
  - insert | delete | move | split | merge
25
- - rename | describe | alias | role | worldview | synopsis | extend
26
- - state-add | state-rename | state-delete | state-change | transition | context
27
- - dialogue | overlap
25
+ - rename | describe | alias | role | importance | worldview | synopsis | extend
26
+ - state-add | state-rename | state-delete | transition | scene-ref
27
+ - dialogue
28
28
 
29
29
  Batch
30
30
  - do [file|-] run one CLI verb per line as one transaction
@@ -34,7 +34,7 @@ Tools
34
34
  - doctor | update | changelog
35
35
 
36
36
  Target
37
- - --script-path FILE | --draft | --remote | --local | --project-group-no NO
37
+ - --script-path FILE | --remote | --local | --project-group-no NO
38
38
  - selection where supported: --in SELECTOR plus filters; see command help
39
39
 
40
40
  Output
@@ -44,7 +44,6 @@ Output
44
44
 
45
45
  More help
46
46
  - scriptctl <command> --help
47
- - scriptctl direct --help
48
47
  - scriptctl patch --schema
49
48
 
50
49
  Exit codes
@@ -95,325 +94,95 @@ Usage
95
94
  - scriptctl doctor [options]
96
95
 
97
96
  Options
97
+ - --llm-config <path> LLM task/model routing YAML. Otherwise env, fixed global path, then built-in config.
98
98
  - --json Print machine-readable JSON.
99
99
  - --help Show this help.
100
100
 
101
101
  Checks
102
102
  - Node version
103
- - optional source-conversion/provider dependencies
104
- - Anthropic API key presence
103
+ - optional source-conversion/LLM dependencies
104
+ - resolved LLM config, providers, profiles, task routes, and referenced credentials
105
105
  - local .env discovery
106
106
  - storage backend
107
107
  `,
108
108
  ],
109
109
  [
110
- ["direct"],
111
- `scriptctl direct converts existing scripts without using ep*.md.
110
+ ["ingest"],
111
+ `Convert a txt/md/docx or video source into a Script v3 workspace.
112
112
 
113
- Usage
114
- - scriptctl direct <command> [options]
115
-
116
- Commands
117
- - init Build source manifest, episode plan, initial script, validation.
118
- - run Re-run one direct stage, e.g. state-binding or metadata.
119
- - validate Validate script.initial.json.
120
- - review Proofread the draft: curation/issues, or --episode N for source↔extract.
121
- - export Export script.initial.json to the final script store.
113
+ Text pipeline: pass1 chunk → pass2 normalize (cheap model emits markdown, parsed
114
+ deterministically) pass3 merge → compile (provisional script.initial.json +
115
+ evidence) → pass5 govern (asset recall + refine → merge/canonical/prune) →
116
+ script.json (v3-validated). Fully decoupled from direct.
122
117
 
123
- Options
124
- - --json Print machine-readable JSON.
125
- - --help Show help for a command.
126
-
127
- Exit codes
128
- - 0 success
129
- - 64 usage or arguments error
130
- - 66 input file unavailable
131
- - 70 provider or runtime failure
132
- - 78 validation failed; agent repair needed
133
- `,
134
- ],
135
- [
136
- ["direct", "init"],
137
- `Build an initial structured script from an existing script file.
118
+ Video pipeline (file or directory of episodes): pass1 Gemini transcribe → pass2
119
+ parse pass3 anchor-driven cross-episode roster merge + state merge → pass4
120
+ second-pass video correction pass5 pure-plot speaker audit → pass6 apply +
121
+ converge onto the SAME govern tail as text → identical Script v3 (timestamps ride
122
+ extend.timestamp). Needs GEMINI_API_KEY.
138
123
 
139
124
  Usage
140
- - scriptctl direct init --source-path <file> [options]
141
-
142
- Required
143
- - --source-path Existing source file. Supported: txt, md, docx, xlsx, pdf, json.
125
+ - scriptctl ingest --source-path <file|dir> [options]
144
126
 
145
127
  Options
146
- - --workspace-path Workspace directory. Default: workspace
147
- - --provider LLM provider: anthropic, mock(test only). Default: anthropic
148
- - --model Provider model. Default: claude-sonnet-4-6-aihubmix
149
- - --concurrency Parallel episode extraction workers. Default: 80
150
- - --batch-mode Batch planning mode: episode. Default: episode
151
- - --batch-target-lines Target non-metadata content lines per batch. Default: 36
152
- - --batch-max-chars Soft character cap per batch. Default: 1800
153
- - --batch-min-lines Minimum content lines before soft cuts. Default: 12
154
- - --episodes <list> Force re-run these episodes' batches (comma-separated, e.g. 27 or 1,2,27).
155
- - --batches <list> Force re-run these specific batch keys (comma-separated, e.g. bat_0063,bat_0065).
156
- - --retry-errors Force re-run every batch that currently has an error.
157
- - --all Re-run every batch from scratch.
158
- - --skip-metadata Skip metadata extraction and asset description enrichment.
159
- - --json Print machine-readable JSON.
160
- - --help Show this help.
161
-
162
- Progress
163
- - init prints live status to stderr for humans and agents. TTY stderr refreshes
164
- a spinner/progress-bar view with user-facing stage names while work is running,
165
- then collapses to the stage summary when it completes. Non-TTY stderr logs one
166
- line per update. Status words are colored on TTY stderr; set NO_COLOR=1 to
167
- disable color. --json keeps stdout as one final JSON envelope for scripts.
168
-
169
- Resume / re-run
170
- - init is resumable: a batch with a result file is reused, a batch with an error
171
- file is sticky (skipped on a plain rerun so a content filter can't loop), a
172
- never-run batch runs. Plain rerun only fills never-run batches.
173
- - Use --episodes / --batches / --retry-errors / --all to force specific units;
174
- re-running a unit only touches that unit's files, never other episodes.
175
- - run "scriptctl direct status" to see what is done / errored / pending.
176
-
177
- Writes
178
- - workspace/source.txt
179
- - workspace/draft/scriptctl/direct/source_manifest.json
180
- - workspace/draft/scriptctl/direct/episode_plan.json
181
- - workspace/draft/scriptctl/direct/batch_plan.json
182
- - workspace/draft/scriptctl/direct/batch_results/*.json
183
- - workspace/draft/scriptctl/direct/batch_results/*.error.json
184
- - workspace/draft/scriptctl/direct/episode_results/*.json
185
- - workspace/draft/scriptctl/direct/asset_grouping.json
186
- - workspace/draft/scriptctl/direct/asset_curation.json
187
- - workspace/draft/scriptctl/direct/state_curation.json
188
- - workspace/draft/scriptctl/direct/state_binding.json
189
- - workspace/draft/scriptctl/direct/asset_metadata.json (unless --skip-metadata)
190
- - workspace/draft/scriptctl/direct/script.initial.json
191
- - workspace/draft/scriptctl/direct/validation.json
192
- - workspace/draft/scriptctl/direct/run_state.json
193
- - workspace/draft/scriptctl/direct/timings.json
194
-
195
- Exit codes
196
- - 0 initial script ready
197
- - 64 usage or arguments error
198
- - 66 source file unavailable
199
- - 70 provider or runtime failure
200
- - 78 initial script written but agent repair is needed
201
- `,
202
- ],
203
- [
204
- ["direct", "run"],
205
- `Re-run one direct pipeline stage against an existing workspace.
206
-
207
- Usage
208
- - scriptctl direct run <stage> [options]
209
-
210
- Stages
211
- - source-prepare
212
- - episode-plan
213
- - episode-titles
214
- - batch-plan
215
- - batch-extract
216
- - episode-merge
217
- - episode-synopsis
218
- - script-merge
219
- - asset-curation
220
- - state-curation
221
- - state-binding
222
- - metadata
223
- - script-synopsis
224
- - validate
225
-
226
- Options
227
- - --workspace-path Workspace directory. Default: workspace
228
- - --force Re-run the stage even when its primary artifact exists.
229
- - --provider LLM provider for provider-backed stages. Default: anthropic
230
- - --model Provider model. Default: claude-sonnet-4-6-aihubmix
231
- - --episodes <list> Force re-run these episodes' batches where relevant.
232
- - --batches <list> Force re-run these batch keys where relevant.
233
- - --retry-errors Force re-run batches with existing error markers.
234
- - --skip-metadata When running metadata, delete asset_metadata.json and mark metadata skipped.
235
- - --json Print machine-readable JSON.
236
- - --help Show this help.
128
+ - --source-path <path> txt/md/docx file, or a video file/directory. Required.
129
+ - --workspace-path <dir> Workspace root (manifest + pass dirs + products). Default: workspace.
130
+ - --llm-config <path> LLM config override.
131
+ - --concurrency <n> Text/merge fanout concurrency. Default: text 80 / video 30.
132
+ - --video-concurrency <n> Video upload+transcribe fanout. Default: 10.
133
+ - --fps <n> Video sampling fps (>1 unlocks sub-second timecodes). Default: 3.
134
+ - --force Same-source rerun: clears ingest products and redoes. Cannot switch sources.
237
135
 
238
136
  Notes
239
- - Script-mutating stages persist script.initial.json when run standalone:
240
- script-merge, asset-curation, state-curation, state-binding, metadata.
241
- - state-curation writes state_curation.json and compresses asset state catalogs
242
- to reusable production visual states before scene-level binding.
243
- - state-binding writes state_binding.json and updates scene state refs /
244
- action state_changes using existing assets and states only.
245
-
246
- Exit codes
247
- - 0 stage completed
248
- - 64 usage or arguments error
249
- - 66 required artifact unavailable
250
- - 70 provider or runtime failure
251
- - 78 stage wrote diagnostics but agent repair is needed
137
+ - Resumes from per-unit checkpoints (text: chunk markdown; video: pass1/pass4/pass5);
138
+ a cross-source workspace fails (choose a fresh --workspace-path). Unsupported
139
+ inputs (pdf/json/xlsx) are refused.
140
+ - script.json validates without synopsis/metadata; enrich later with those commands.
141
+ - Video: run \`scriptctl view\` for the click-to-seek review UI; episode numbering is
142
+ by filename number (all-or-none; mixed fails).
252
143
  `,
253
144
  ],
254
145
  [
255
- ["direct", "status"],
256
- `Direct workflow state, derived from disk artifacts (run_state only records internal runtime notes).
146
+ ["ingest", "status"],
147
+ `Report ingest progress from the workspace's REAL file state (no model, no store).
148
+ Status is a pure function of the on-disk files — there is no separate state file
149
+ to drift out of sync. This is the authoritative status: the runtime watcher and
150
+ frontend consume \`--json\` instead of re-deriving it.
257
151
 
258
152
  Usage
259
- - scriptctl direct status [options]
153
+ - scriptctl ingest status [--workspace-path <dir>] [--json]
260
154
 
261
- Options
262
- - --workspace-path Workspace directory. Default: workspace
263
- - --json Print machine-readable JSON.
264
- - --help Show this help.
265
-
266
- Output
267
- - Overall status, stage status, episode status, and non-success detail ids.
268
- - Status values: success / running / pending / warning / error / skipped.
269
- - --json includes overall_status, running_stage, stages, episodes, and batches.
270
- - status can report an early snapshot as soon as source.txt exists, before planning finishes.
271
-
272
- Exit codes
273
- - 0 required stages complete (warnings may still be present)
274
- - 78 some required stage errored or pending (re-run with direct init --episodes/--batches/--retry-errors)
275
- `,
276
- ],
277
- [
278
- ["direct", "validate"],
279
- `Validate the current initial structured script.
280
-
281
- Usage
282
- - scriptctl direct validate [options]
283
-
284
- Required
285
- - none
286
-
287
- Options
288
- - --workspace-path Workspace directory. Default: workspace
289
- - --script-path Script JSON to validate. Default: workspace/draft/scriptctl/direct/script.initial.json
290
- - --json Print machine-readable JSON.
291
- - --help Show this help.
292
-
293
- Reads
294
- - workspace/source.txt
295
- - workspace/draft/scriptctl/direct/episode_plan.json
296
- - script.initial.json or --script-path
297
-
298
- Writes
299
- - workspace/draft/scriptctl/direct/validation.json
155
+ State (top-level, folded from the files)
156
+ - empty No ingest workspace (no manifest.json).
157
+ - incomplete Started, not finished, no hard error (rerun \`scriptctl ingest\` to resume).
158
+ - failed Leftover unit error sidecars OR final v3 validation failed.
159
+ - ready script.json present and v3-validated.
300
160
 
301
- Exit codes
302
- - 0 validation passed
303
- - 64 usage or arguments error
304
- - 66 required artifact unavailable
305
- - 78 validation failed; agent repair needed
306
- `,
307
- ],
308
- [
309
- ["direct", "review"],
310
- `Proofread the direct draft. Read-only; no state side effects.
311
-
312
- Usage
313
- - scriptctl direct review [options] # curation/state-binding decisions + issues
314
- - scriptctl direct review --episode <n>[,<n>...] # source.txt ↔ script.initial.json side-by-side per episode
315
-
316
- Options
317
- - --workspace-path Workspace directory. Default: workspace
318
- - --episode Comma-separated episode numbers for source↔extract alignment, e.g. 1 or 1,15,30.
319
- - --json Print machine-readable JSON.
320
- - --help Show this help.
321
-
322
- Notes
323
- - Generic per-episode / per-asset listings live on the top-level queries
324
- (\`scriptctl episodes --draft\`, \`scriptctl assets --draft\`, ...).
325
- - Fix a wrong extraction by editing the draft with --draft, e.g.
326
- \`scriptctl replace ep_001/scn_001#3 --from "…" --to "…" --draft\`.
327
-
328
- Reads
329
- - workspace/draft/scriptctl/direct/script.initial.json
330
- - workspace/draft/scriptctl/direct/asset_grouping.json
331
- - workspace/draft/scriptctl/direct/asset_curation.json
332
- - workspace/draft/scriptctl/direct/state_curation.json
333
- - workspace/draft/scriptctl/direct/state_binding.json
334
- - workspace/draft/scriptctl/direct/batch_results/*.error.json
335
- - workspace/draft/scriptctl/direct/episode_plan.json (--episode)
336
- - workspace/source.txt (--episode)
161
+ --json payload (.status)
162
+ - { workspace, exists, kind, state, phase, passes[], units, script, validation, errors[], updated }
163
+ passes[] = per-pass {name, done, unit?{total,done,failed}}; units = primary bar
164
+ (text: chunks; video: episodes). Liveness (is a run active?) is deliberately
165
+ NOT here — it can't be read from files; that's the watcher's / agent's concern.
337
166
 
338
- Exit codes
339
- - 0 review available
340
- - 64 usage or arguments error
341
- - 66 required artifact unavailable
167
+ Examples
168
+ - scriptctl ingest status
169
+ - scriptctl ingest status --workspace-path 1_script/workspace --json
342
170
  `,
343
171
  ],
344
172
  [
345
- ["direct", "export"],
346
- `Export the current initial script to the final script store through Gateway.
173
+ ["view"],
174
+ `Render a workspace's script.json into review.html at the workspace root. No model.
347
175
 
348
176
  Usage
349
- - scriptctl direct export [options]
350
-
351
- Required
352
- - none
353
-
354
- Options
355
- - --workspace-path Workspace directory. Default: workspace
356
- - --project-group-no Project group no. Default: SANDBOX_PROJECT_GROUP_NO
357
- - --request-id Optional idempotency key. Default: scriptctl-direct-export:<script-sha256>
358
- - --output-path Deprecated; accepted for old invocations, no local file is written.
359
- - --force Export with non-error validation issues only; errors still block.
360
- - --json Print machine-readable JSON.
361
- - --help Show this help.
362
-
363
- Reads
364
- - workspace/draft/scriptctl/direct/script.initial.json
365
- - workspace/draft/scriptctl/direct/validation.json
366
-
367
- Writes
368
- - Workbench script-output DB via Gateway
369
- - workspace/draft/scriptctl/direct/validation.json
370
-
371
- Exit codes
372
- - 0 script exported
373
- - 64 usage or arguments error
374
- - 66 required artifact unavailable
375
- - 78 validation, provider, or agent review blocks export
177
+ - scriptctl view [--workspace-path <dir>]
376
178
  `,
377
179
  ],
378
180
  [
379
- ["parse"],
380
- `Assemble an agent-authored markdown workspace into a structured script
381
- deterministic, no LLM. You write the md (per-episode body + 人物/场景/道具/发声源
382
- docs); parse turns it into a schema-v2 script.
383
-
384
- Two inputs are supported:
385
- - 正文 + 资产 docs → assemble directly (deterministic, no LLM).
386
- - 正文 only → first run \`parse <dir> --extract-assets\` to derive the asset docs
387
- with an LLM (descriptions / worldview / 主角), review them, then assemble.
181
+ ["publish"],
182
+ `Validate a workspace's script.json (v3) and write it to the output store.
388
183
 
389
184
  Usage
390
- - scriptctl parse [dir] [options]
391
- - scriptctl parse [dir] --extract-assets derive 人物/场景/道具/发声源.md + 元信息.md from body (LLM)
392
- - scriptctl parse --spec print the md grammar parse accepts
393
-
394
- Options
395
- - [dir] md workspace directory. Default: <workspace>/parse.
396
- - --workspace-path <path> Workspace root behind the default md dir (<workspace>/parse). Default: workspace.
397
- - --md-dir <path> Point directly at the md workspace root (overrides [dir] / --workspace-path).
398
- - --episodes-dir <path> Override the per-episode body directory.
399
- - --title <title> Script title when the workspace omits 元信息.md.
400
- - --extract-assets Derive asset docs from body-only episodes via an LLM, write them
401
- back for review. Writes md only — no script.json, no publish.
402
- - --provider <name> Provider for --extract-assets (anthropic | mock). Default: anthropic.
403
- - --model <model> Model for --extract-assets. Default: claude-sonnet-4-6-aihubmix.
404
- - --force Overwrite existing asset docs when --extract-assets is set.
405
- - --publish Validate then store the assembled script in the DB
406
- (omit to assemble + validate only, no write).
407
- - --project-group-no <no> Target project for --publish.
408
- - --request-id <id> Idempotency key for --publish.
409
-
410
- Notes
411
- - --extract-assets is a one-time seed step: it writes reviewable 资产 md, then you
412
- re-run plain \`parse <dir>\` (deterministic) to assemble script.json. It never
413
- publishes. Refuses to overwrite existing asset docs unless --force.
414
- - Completeness gaps (empty episode/scene, missing description) are warnings, not
415
- blockers — same semantics as validate. Only integrity errors block --publish.
416
- - Run \`scriptctl parse --spec\` first to see the exact md layout and line grammar.
185
+ - scriptctl publish [--workspace-path <dir>] [--remote|--local] [--project-group-no <no>] [--request-id <id>]
417
186
  `,
418
187
  ],
419
188
  // =========================================================================
@@ -421,7 +190,9 @@ Notes
421
190
  // =========================================================================
422
191
  [
423
192
  ["summary"],
424
- `Show title and counts (episodes / scenes / actions / actors / locations / props / speakers).
193
+ `Show title, counts (episodes / scenes / actions / actors / locations / props)
194
+ and the whole-script overview fields when present: worldview (+ worldview_raw),
195
+ style, logline, theme, synopsis, main characters.
425
196
 
426
197
  Usage
427
198
  - scriptctl summary [options]
@@ -433,7 +204,6 @@ Target selection (applies to every query / edit verb)
433
204
  - --remote Read/write the project DB (project group). Pairs with
434
205
  --project-group-no.
435
206
  - --local Read/write the conventional local store (output/ dir).
436
- - --draft Edit the direct intermediate draft (script.initial.json).
437
207
  - --project-group-no Project group no (implies remote). Default: SANDBOX_PROJECT_GROUP_NO.
438
208
  - (inferred remote) When SANDBOX_PROJECT_GROUP_NO is set (the sandbox injects it)
439
209
  a bare command auto-targets that project's DB — no flag needed.
@@ -461,7 +231,7 @@ Options
461
231
  - --min-chars <n> Only episodes with total chars >= N.
462
232
  - --max-chars <n> Only episodes with total chars <= N.
463
233
  - --format addr Print only episode ids.
464
- - --draft / --project-group-no / --workspace-path / --json / --help
234
+ - --project-group-no / --workspace-path / --json / --help
465
235
 
466
236
  Default output
467
237
  - TSV header + one row per episode:
@@ -486,10 +256,12 @@ Options
486
256
  - --has-actor <id> Only scenes whose context references this actor.
487
257
  - --has-location <id> Only scenes whose context references this location.
488
258
  - --has-prop <id> Only scenes whose context references this prop.
489
- - --draft / --project-group-no / --workspace-path / --json / --help
259
+ - --project-group-no / --workspace-path / --json / --help
490
260
 
491
261
  Output line
492
- - ep_NNN/scn_NNN [space time] location=loc_NNN(name) actors=... props=... actions=N
262
+ - ep_NNN/scn_NNN [space time] location=loc_NNN(name) actors=... props=... actions=N t=<t_start>..<t_end>
263
+ t_start / t_end are the first / last action extend.timestamp in the scene
264
+ (omitted when the scene carries no timestamps).
493
265
 
494
266
  Examples
495
267
  - scriptctl scenes --in ep_007
@@ -500,33 +272,34 @@ Examples
500
272
  [
501
273
  ["actions"],
502
274
  `Search actions across the script (the workhorse for "find where to edit").
503
- Default output is TSV: addr, type, delivery, speaker, actor, content.
275
+ Default output is TSV: addr, timestamp, type, speaker, actor, emotion, content.
276
+ timestamp is the action's extend.timestamp (episode-local "M:SS"; empty when
277
+ absent) — the anchor for event-level alignment (an event spans first→last ts).
504
278
 
505
279
  Usage
506
280
  - scriptctl actions [options]
507
281
 
508
282
  Options
509
283
  - --in <addr> Scope to ep_NNN / ep_NNN/scn_NNN / ep_NNN/scn_NNN#idx.
510
- - --grep <text> Literal substring (default) or /regex/flags. Matches action.content + lines[].content.
511
- - --type <type> dialogue | inner_thought | action.
512
- - --actor <id> Actions where this actor speaks (resolves speaker→actor) or is action.actor_id.
513
- - --speaker <id> Actions where this speaker appears.
514
- - --has <kind> state-changes | transition | lines (filter by structural feature).
284
+ - --grep <text> Literal substring (default) or /regex/flags. Matches action.content.
285
+ - --type <type> dialogue | inner_thought | action | transition.
286
+ - --actor <id> Actions whose inline speaker is this actor (action.speaker.actor_id).
287
+ - --has <kind> transition | speaker (filter by structural feature).
515
288
  - --context <n> Include N actions before/after each hit (for context windows).
516
- - --draft / --project-group-no / --workspace-path / --json / --help
289
+ - --project-group-no / --workspace-path / --json / --help
517
290
 
518
291
  Requires at least one of: --in, --grep, --type, --actor, --speaker, --has. Bare \`scriptctl actions\`
519
292
  errors out — dumping every action across all episodes is too large.
520
293
 
521
294
  Default output
522
295
  - TSV header + one row per action:
523
- addr type delivery speaker actor content
296
+ addr timestamp type speaker actor emotion content
524
297
 
525
298
  Examples
526
299
  - scriptctl actions --grep "台下掌声雷动"
527
300
  - scriptctl actions --in ep_001 --type dialogue
528
301
  - scriptctl actions --grep "金碧辉煌" --context 2
529
- - scriptctl actions --actor act_001 --has state-changes
302
+ - scriptctl actions --actor act_001 --has speaker
530
303
  `,
531
304
  ],
532
305
  [
@@ -540,10 +313,13 @@ Options
540
313
  - --id <actor_id> Filter to one actor.
541
314
  - --name <substr> Match name substring (case-sensitive).
542
315
  - --in <addr> Restrict to actors referenced under this address (ep/scn/action).
543
- - --draft / --project-group-no / --workspace-path / --json / --help
316
+ - --counts Append appearance counts: scenes=N episodes_count=M episodes=<ranges>
317
+ (scene-context presence, compacted to episode ranges).
318
+ - --project-group-no / --workspace-path / --json / --help
544
319
 
545
320
  Examples
546
321
  - scriptctl actors --name "陈"
322
+ - scriptctl actors --counts
547
323
  - scriptctl actors --in ep_023
548
324
  - scriptctl actors --in ep_001/scn_001
549
325
  `,
@@ -555,10 +331,12 @@ Examples
555
331
  Usage
556
332
  - scriptctl locations [options]
557
333
 
558
- Options mirror \`scriptctl actors\`: --id, --name, --in, --project-group-no, etc.
334
+ Options mirror \`scriptctl actors\`: --id, --name, --in, --counts, --project-group-no, etc.
335
+ --counts appends scenes / episode-count / episode ranges of scene-context presence.
559
336
 
560
337
  Examples
561
338
  - scriptctl locations --name "办公室"
339
+ - scriptctl locations --counts
562
340
  - scriptctl locations --in ep_007
563
341
  `,
564
342
  ],
@@ -569,10 +347,12 @@ Examples
569
347
  Usage
570
348
  - scriptctl props [options]
571
349
 
572
- Options mirror \`scriptctl actors\`: --id, --name, --in, --project-group-no, etc.
350
+ Options mirror \`scriptctl actors\`: --id, --name, --in, --counts, --project-group-no, etc.
351
+ --counts appends scenes / episode-count / episode ranges of scene-context presence.
573
352
 
574
353
  Examples
575
354
  - scriptctl props --name "公文包"
355
+ - scriptctl props --counts
576
356
  - scriptctl props --in ep_001/scn_001
577
357
  `,
578
358
  ],
@@ -588,7 +368,8 @@ Options
588
368
  - --id <id> Filter by id.
589
369
  - --name <substr> Match name substring.
590
370
  - --in <addr> Restrict to assets referenced under this address.
591
- - --draft / --project-group-no / --workspace-path / --json / --help
371
+ - --counts Append scene / episode appearance counts per asset.
372
+ - --project-group-no / --workspace-path / --json / --help
592
373
 
593
374
  Examples
594
375
  - scriptctl assets --name "陈"
@@ -597,41 +378,33 @@ Examples
597
378
  ],
598
379
  [
599
380
  ["states"],
600
- `List every state on one asset: state_id ↔ name ↔ description.
381
+ `List every state on one asset: state_id ↔ name ↔ description ↔ episode arc.
601
382
 
602
383
  This is the read half of the state address space — run it to learn a state's
603
384
  id before editing (rename / delete / describe / state-change), instead of
604
385
  reading the raw script.json. Duplicate ids/names are flagged inline
605
386
  ([DUP_ID] / [DUP_NAME]).
606
387
 
388
+ The address accepts a bare id (act_001 / loc_001 / prp_001) or the tagged form
389
+ (actor:act_001) — the kind is inferred from the id prefix in the bare case.
390
+
391
+ Each state line ends with its episode arc — where the state is bound across the
392
+ script (scene context + action state_changes), compacted to episode ranges:
393
+ actor:act_001/st_002 石膏轮椅装 desc="…" episodes=ep_018..ep_021 (4 eps, 4 scenes)
394
+ This is the character's visual arc: which look is active in which episodes.
395
+ A state bound nowhere shows episodes=none.
396
+
607
397
  Usage
608
398
  - scriptctl states <asset-addr>
609
399
 
610
400
  Examples
401
+ - scriptctl states act_001
611
402
  - scriptctl states actor:act_001
612
403
  - scriptctl states location:loc_003
613
404
 
614
405
  Then edit by the printed address:
615
406
  - scriptctl rename actor:act_001/st_010 "平静(新)"
616
407
  - scriptctl delete actor:act_001/st_010 --strategy remove
617
- `,
618
- ],
619
- [
620
- ["speakers"],
621
- `List speakers with source kind / source id.
622
-
623
- Usage
624
- - scriptctl speakers [options]
625
-
626
- Options
627
- - --id <speaker_id> Filter to one speaker.
628
- - --name <substr> Match display_name substring.
629
- - --kind <kind> Filter by source_kind (actor / location / prop / system / broadcast / group / other).
630
- - --draft / --project-group-no / --workspace-path / --json / --help
631
-
632
- Examples
633
- - scriptctl speakers --kind system
634
- - scriptctl speakers --name "陈"
635
408
  `,
636
409
  ],
637
410
  [
@@ -644,7 +417,7 @@ Usage
644
417
  Options
645
418
  - --severity <severity> Filter by severity (error / warning / info / blocking).
646
419
  - --code <code> Filter by issue code (e.g. STATE_NOT_FOUND).
647
- - --draft / --project-group-no / --workspace-path / --json / --help
420
+ - --project-group-no / --workspace-path / --json / --help
648
421
 
649
422
  Output line
650
423
  - <severity> <code>: <summary> [<location>]
@@ -668,7 +441,7 @@ Address forms
668
441
 
669
442
  Options
670
443
  - --level <scene|action> Restrict to scene-level or action-level refs only.
671
- - --draft / --project-group-no / --workspace-path / --json / --help
444
+ - --project-group-no / --workspace-path / --json / --help
672
445
 
673
446
  Output line
674
447
  - <location> [<role>] (e.g. ep_001/scn_001#3.actor_id [action_actor])
@@ -688,7 +461,7 @@ Usage
688
461
  - scriptctl validate [options]
689
462
 
690
463
  Options
691
- - --draft / --project-group-no / --workspace-path / --json / --help
464
+ - --project-group-no / --workspace-path / --json / --help
692
465
 
693
466
  Exit codes
694
467
  - 0 passed
@@ -712,9 +485,7 @@ Required
712
485
  Options
713
486
  - --to Replacement text. Default: "" (delete the substring).
714
487
  - --all Replace every occurrence in the action. Without it, multiple matches reject.
715
- - --draft / --project-group-no / --workspace-path / --request-id / --json / --help
716
-
717
- Refuses overlap dialogue actions — use \`scriptctl overlap\` to rewrite their lines.
488
+ - --project-group-no / --workspace-path / --request-id / --json / --help
718
489
 
719
490
  Example
720
491
  - scriptctl replace ep_001/scn_001#3 --from ",台下掌声雷动" --to ""
@@ -773,14 +544,13 @@ Usage
773
544
  - scriptctl insert <ep> --location <loc_id> [position-flags] [options] # scene insert
774
545
 
775
546
  Action insert (first arg is ep/scn)
776
- - --type dialogue / action / inner_thought.
547
+ - --type dialogue / action / inner_thought / transition.
777
548
  - --content Action content text.
778
549
  - --emotion <text> Optional action.emotion.
779
- - --actor <id> Optional action.actor_id.
780
- - --speaker <id> Optional action.speaker_id.
550
+ - --actor <id> Optional: set the line's inline speaker to an actor (action.speaker).
781
551
 
782
552
  Scene insert (first arg is ep)
783
- - --location <id> Required: the scene's primary location.
553
+ - --location <id> Required: the scene's location.
784
554
  - --time <time> Default: day.
785
555
  - --space <space> Default: interior.
786
556
  - --scene-id <id> Optional explicit scene id (auto-assigned otherwise).
@@ -874,29 +644,6 @@ Examples
874
644
  // =========================================================================
875
645
  // Edit verbs — state / transition / context on actions+scenes
876
646
  // =========================================================================
877
- [
878
- ["state-change"],
879
- `Add or clear a state_change on a specific action.
880
-
881
- Usage
882
- - scriptctl state-change <at> <kind:id> --to <state_id> [--from <state_id>] [--effective <after|before>]
883
- - scriptctl state-change <at> <kind:id> --clear
884
-
885
- Required
886
- - <at> Action address.
887
- - <kind:id> Asset target (actor/location/prop).
888
-
889
- Options
890
- - --to Target state_id. Required unless --clear.
891
- - --from Optional explicit from-state. Otherwise inferred from prior scene context.
892
- - --effective after (default) or before.
893
- - --clear Remove the existing state_change for this target on this action.
894
-
895
- Examples
896
- - scriptctl state-change ep_001/scn_001#3 actor:act_001 --to st_shock
897
- - scriptctl state-change ep_001/scn_001#3 actor:act_001 --clear
898
- `,
899
- ],
900
647
  [
901
648
  ["transition"],
902
649
  `Set or clear an action.transition_prompt (process + contrast for visual generation).
@@ -911,20 +658,22 @@ Examples
911
658
  `,
912
659
  ],
913
660
  [
914
- ["context"],
915
- `Manage a scene's context.{actors|locations|props} ref.
661
+ ["scene-ref"],
662
+ `Manage a scene's cast / props / location ref (v3: scene.actors[] / props[] / location).
916
663
 
917
664
  Usage
918
- - scriptctl context <ep/scn> <kind:id> --state <state_id> # upsert ref + set state
919
- - scriptctl context <ep/scn> <kind:id> --state none # upsert ref, no state
920
- - scriptctl context <ep/scn> <kind:id> --clear # keep ref, clear state
921
- - scriptctl context <ep/scn> <kind:id> --remove # remove ref entirely
665
+ - scriptctl scene-ref <ep/scn> <kind:id> --state <state_id> # upsert ref + set state
666
+ - scriptctl scene-ref <ep/scn> <kind:id> --state none # upsert ref, no state
667
+ - scriptctl scene-ref <ep/scn> <kind:id> --clear # keep ref, clear state
668
+ - scriptctl scene-ref <ep/scn> <kind:id> --remove # remove ref entirely
922
669
 
670
+ kind is actor / location / prop. Location is single-valued per scene (set replaces).
923
671
  Exactly one of --state / --clear / --remove must be passed.
924
672
 
925
673
  Examples
926
- - scriptctl context ep_001/scn_001 actor:act_001 --state st_calm
927
- - scriptctl context ep_001/scn_001 actor:act_001 --remove
674
+ - scriptctl scene-ref ep_001/scn_001 actor:act_001 --state st_calm
675
+ - scriptctl scene-ref ep_001/scn_001 location:loc_003 --state none
676
+ - scriptctl scene-ref ep_001/scn_001 actor:act_001 --remove
928
677
  `,
929
678
  ],
930
679
  // =========================================================================
@@ -982,6 +731,21 @@ Only valid on actor:* addresses.
982
731
 
983
732
  Example
984
733
  - scriptctl role actor:act_001 主角
734
+ `,
735
+ ],
736
+ [
737
+ ["importance"],
738
+ `Set an asset's importance tier. featured = 主角/配角 (downstream gets a render
739
+ asset + state tracking); background = 龙套/背景 (skipped downstream).
740
+
741
+ Usage
742
+ - scriptctl importance <kind:id> <featured|background>
743
+
744
+ Valid on actor / location / prop addresses.
745
+
746
+ Examples
747
+ - scriptctl importance actor:act_002 background
748
+ - scriptctl importance location:loc_001 featured
985
749
  `,
986
750
  ],
987
751
  [
@@ -1033,8 +797,7 @@ Behavior
1033
797
  - Uses a text-output contract and parser, not tool_use.
1034
798
 
1035
799
  Options
1036
- - --provider <name> openai | anthropic | mock. Default: openai
1037
- - --model <model> model name for the provider. Default: deepseek-v4-pro-packy
800
+ - --llm-config <path> task/model routing YAML; built-in route uses the deepseek gateway
1038
801
  - --concurrency <n> parallel chunk extraction, default 30
1039
802
  - --checkpoint <dir> checkpoint directory, default workspace direct loom dir
1040
803
  - --overwrite regenerate existing synopsis fields
@@ -1138,50 +901,18 @@ Examples
1138
901
  // =========================================================================
1139
902
  [
1140
903
  ["dialogue"],
1141
- `Convert an action to a dialogue and attach speaker(s).
1142
-
1143
- Usage
1144
- - scriptctl dialogue <at> --speakers <id1[,id2,...]> [--delivery <single|simultaneous|group>]
1145
-
1146
- Speakers can be a comma-separated list. Delivery defaults to single (1 speaker) or simultaneous (>1).
1147
-
1148
- Examples
1149
- - scriptctl dialogue ep_001/scn_001#3 --speakers spk_chenmu
1150
- - scriptctl dialogue ep_001/scn_001#3 --speakers spk_a,spk_b --delivery simultaneous
1151
- `,
1152
- ],
1153
- [
1154
- ["overlap"],
1155
- `Set overlapping dialogue (multiple speakers each with their own line) on an action.
904
+ `Set a dialogue line's inline speaker (v3: a single speaker per line). Also flips
905
+ the action to type=dialogue.
1156
906
 
1157
907
  Usage
1158
- - scriptctl overlap <at> --line "<speaker_id>:<content>" [--line ...]
1159
-
1160
- Each --line associates one speaker with one line of dialogue. Repeatable.
908
+ - scriptctl dialogue <at> --actor <actor_id> # an actor speaks
909
+ - scriptctl dialogue <at> --kind <system|broadcast|offscreen|group> [--label <text>]
1161
910
 
1162
- Example
1163
- - scriptctl overlap ep_001/scn_001#3 --line "spk_chenmu:你好" --line "spk_other:hi"
1164
- `,
1165
- ],
1166
- [
1167
- ["add-speaker"],
1168
- `Register a new speaker entity.
1169
-
1170
- Usage
1171
- - scriptctl add-speaker --kind <kind> --name <display_name> [options]
1172
-
1173
- Required
1174
- - --kind actor | location | prop | system | broadcast | group | other.
1175
- - --name Display name.
1176
-
1177
- Options
1178
- - --source-id <id> For kind=actor/location/prop, points at the asset.
1179
- - --voice-desc <text> Free-form voice description.
1180
- - --speaker-id <id> Optional explicit id (auto-assigned otherwise).
911
+ Pass exactly one of --actor (an actor) or --kind (a non-actor source).
1181
912
 
1182
913
  Examples
1183
- - scriptctl add-speaker --kind actor --name "陈默" --source-id act_001
1184
- - scriptctl add-speaker --kind system --name "广播员"
914
+ - scriptctl dialogue ep_001/scn_001#3 --actor act_001
915
+ - scriptctl dialogue ep_001/scn_001#3 --kind broadcast --label 广播
1185
916
  `,
1186
917
  ],
1187
918
  // =========================================================================
@@ -1210,7 +941,7 @@ Use \`scriptctl patch --schema\` to see every supported op + its required fields
1210
941
  Options
1211
942
  - --schema [<op>] Dump op schema (JSON) instead of applying. With <op>, dump just that op.
1212
943
  - --dry-run Apply to an in-memory copy, run validate, do NOT write to gateway.
1213
- - --draft / --project-group-no / --workspace-path / --request-id / --json / --help
944
+ - --project-group-no / --workspace-path / --request-id / --json / --help
1214
945
 
1215
946
  Examples
1216
947
  - scriptctl patch changes.json