@lingjingai/scriptctl 0.35.0 → 0.36.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.
Files changed (364) hide show
  1. package/README.md +21 -5
  2. package/changes/0.36.0.md +24 -0
  3. package/dist/bin.js +0 -0
  4. package/dist/cli.d.ts +2 -1
  5. package/dist/cli.js +52 -128
  6. package/dist/cli.js.map +1 -1
  7. package/dist/common.d.ts +0 -16
  8. package/dist/common.js +2 -342
  9. package/dist/common.js.map +1 -1
  10. package/dist/domain/ingest/apply-plan.d.ts +23 -0
  11. package/dist/domain/ingest/apply-plan.js +210 -0
  12. package/dist/domain/ingest/apply-plan.js.map +1 -0
  13. package/dist/domain/ingest/assembler.d.ts +57 -0
  14. package/dist/domain/ingest/assembler.js +181 -0
  15. package/dist/domain/ingest/assembler.js.map +1 -0
  16. package/dist/domain/ingest/chunker.d.ts +9 -0
  17. package/dist/domain/ingest/chunker.js +38 -0
  18. package/dist/domain/ingest/chunker.js.map +1 -0
  19. package/dist/domain/ingest/evidence.d.ts +5 -0
  20. package/dist/domain/ingest/evidence.js +66 -0
  21. package/dist/domain/ingest/evidence.js.map +1 -0
  22. package/dist/domain/ingest/govern.d.ts +3 -0
  23. package/dist/domain/ingest/govern.js +127 -0
  24. package/dist/domain/ingest/govern.js.map +1 -0
  25. package/dist/domain/ingest/jsonl-parser.d.ts +6 -0
  26. package/dist/domain/ingest/jsonl-parser.js +187 -0
  27. package/dist/domain/ingest/jsonl-parser.js.map +1 -0
  28. package/dist/domain/ingest/markdown-parser.d.ts +6 -0
  29. package/dist/domain/ingest/markdown-parser.js +186 -0
  30. package/dist/domain/ingest/markdown-parser.js.map +1 -0
  31. package/dist/domain/ingest/records.d.ts +71 -0
  32. package/dist/domain/ingest/records.js +9 -0
  33. package/dist/domain/ingest/records.js.map +1 -0
  34. package/dist/domain/ingest/renumber.d.ts +14 -0
  35. package/dist/domain/ingest/renumber.js +130 -0
  36. package/dist/domain/ingest/renumber.js.map +1 -0
  37. package/dist/domain/ingest/script-v3.d.ts +94 -0
  38. package/dist/domain/ingest/script-v3.js +7 -0
  39. package/dist/domain/ingest/script-v3.js.map +1 -0
  40. package/dist/domain/ingest/state-reconcile.d.ts +11 -0
  41. package/dist/domain/ingest/state-reconcile.js +90 -0
  42. package/dist/domain/ingest/state-reconcile.js.map +1 -0
  43. package/dist/domain/ingest/validation.d.ts +11 -0
  44. package/dist/domain/ingest/validation.js +168 -0
  45. package/dist/domain/ingest/validation.js.map +1 -0
  46. package/dist/domain/ingest/video-aggregate.d.ts +23 -0
  47. package/dist/domain/ingest/video-aggregate.js +89 -0
  48. package/dist/domain/ingest/video-aggregate.js.map +1 -0
  49. package/dist/domain/ingest/video-apply.d.ts +37 -0
  50. package/dist/domain/ingest/video-apply.js +236 -0
  51. package/dist/domain/ingest/video-apply.js.map +1 -0
  52. package/dist/domain/ingest/video-md-parser.d.ts +2 -0
  53. package/dist/domain/ingest/video-md-parser.js +233 -0
  54. package/dist/domain/ingest/video-md-parser.js.map +1 -0
  55. package/dist/domain/ingest/video-records.d.ts +56 -0
  56. package/dist/domain/ingest/video-records.js +9 -0
  57. package/dist/domain/ingest/video-records.js.map +1 -0
  58. package/dist/domain/loom/index.d.ts +2 -1
  59. package/dist/domain/loom/index.js +12 -10
  60. package/dist/domain/loom/index.js.map +1 -1
  61. package/dist/domain/loom/types.d.ts +3 -2
  62. package/dist/domain/script/lookups.d.ts +3 -2
  63. package/dist/domain/script/lookups.js +25 -8
  64. package/dist/domain/script/lookups.js.map +1 -1
  65. package/dist/domain/script/patch/apply.js +2 -2
  66. package/dist/domain/script/patch/apply.js.map +1 -1
  67. package/dist/domain/script/patch/helpers.d.ts +3 -7
  68. package/dist/domain/script/patch/helpers.js +23 -96
  69. package/dist/domain/script/patch/helpers.js.map +1 -1
  70. package/dist/domain/script/patch/ops-action.d.ts +0 -2
  71. package/dist/domain/script/patch/ops-action.js +34 -100
  72. package/dist/domain/script/patch/ops-action.js.map +1 -1
  73. package/dist/domain/script/patch/ops-asset.d.ts +1 -0
  74. package/dist/domain/script/patch/ops-asset.js +102 -155
  75. package/dist/domain/script/patch/ops-asset.js.map +1 -1
  76. package/dist/domain/script/patch/ops-dialogue.d.ts +1 -4
  77. package/dist/domain/script/patch/ops-dialogue.js +43 -220
  78. package/dist/domain/script/patch/ops-dialogue.js.map +1 -1
  79. package/dist/domain/script/patch/ops-extend.js +8 -2
  80. package/dist/domain/script/patch/ops-extend.js.map +1 -1
  81. package/dist/domain/script/patch/ops-meta.js.map +1 -1
  82. package/dist/domain/script/patch/ops-scene.js +26 -39
  83. package/dist/domain/script/patch/ops-scene.js.map +1 -1
  84. package/dist/domain/script/patch/ops-state.d.ts +3 -3
  85. package/dist/domain/script/patch/ops-state.js +33 -49
  86. package/dist/domain/script/patch/ops-state.js.map +1 -1
  87. package/dist/domain/script/patch/registry.js +9 -13
  88. package/dist/domain/script/patch/registry.js.map +1 -1
  89. package/dist/domain/script/refs.js +23 -111
  90. package/dist/domain/script/refs.js.map +1 -1
  91. package/dist/domain/script/scene-refs.d.ts +3 -0
  92. package/dist/domain/script/scene-refs.js +35 -0
  93. package/dist/domain/script/scene-refs.js.map +1 -0
  94. package/dist/domain/script/schema.js +17 -21
  95. package/dist/domain/script/schema.js.map +1 -1
  96. package/dist/domain/script/text-util.d.ts +7 -0
  97. package/dist/domain/script/text-util.js +91 -0
  98. package/dist/domain/script/text-util.js.map +1 -0
  99. package/dist/help-text.js +117 -410
  100. package/dist/help-text.js.map +1 -1
  101. package/dist/infra/converters.js +1 -1
  102. package/dist/infra/converters.js.map +1 -1
  103. package/dist/infra/episode-title.d.ts +4 -0
  104. package/dist/infra/episode-title.js +129 -0
  105. package/dist/infra/episode-title.js.map +1 -0
  106. package/dist/infra/ingest/review-renderer.d.ts +1 -0
  107. package/dist/infra/ingest/review-renderer.js +431 -0
  108. package/dist/infra/ingest/review-renderer.js.map +1 -0
  109. package/dist/infra/ingest/source-resolver.d.ts +21 -0
  110. package/dist/infra/ingest/source-resolver.js +51 -0
  111. package/dist/infra/ingest/source-resolver.js.map +1 -0
  112. package/dist/infra/ingest/text-reader.d.ts +3 -0
  113. package/dist/infra/ingest/text-reader.js +27 -0
  114. package/dist/infra/ingest/text-reader.js.map +1 -0
  115. package/dist/infra/ingest/video-discovery.d.ts +8 -0
  116. package/dist/infra/ingest/video-discovery.js +60 -0
  117. package/dist/infra/ingest/video-discovery.js.map +1 -0
  118. package/dist/infra/ingest/workspace-store.d.ts +18 -0
  119. package/dist/infra/ingest/workspace-store.js +70 -0
  120. package/dist/infra/ingest/workspace-store.js.map +1 -0
  121. package/dist/infra/llm/anthropic-model.d.ts +11 -0
  122. package/dist/infra/llm/anthropic-model.js +109 -0
  123. package/dist/infra/llm/anthropic-model.js.map +1 -0
  124. package/dist/infra/llm/gemini-upload.d.ts +9 -0
  125. package/dist/infra/llm/gemini-upload.js +94 -0
  126. package/dist/infra/llm/gemini-upload.js.map +1 -0
  127. package/dist/infra/llm/gemini-video-model.d.ts +47 -0
  128. package/dist/infra/llm/gemini-video-model.js +163 -0
  129. package/dist/infra/llm/gemini-video-model.js.map +1 -0
  130. package/dist/infra/llm/openai-compatible-model.d.ts +14 -0
  131. package/dist/infra/llm/openai-compatible-model.js +157 -0
  132. package/dist/infra/llm/openai-compatible-model.js.map +1 -0
  133. package/dist/infra/llm/retry.d.ts +5 -0
  134. package/dist/infra/llm/retry.js +20 -0
  135. package/dist/infra/llm/retry.js.map +1 -0
  136. package/dist/llm/composition.d.ts +5 -0
  137. package/dist/llm/composition.js +5 -0
  138. package/dist/llm/composition.js.map +1 -0
  139. package/dist/llm/config.d.ts +26 -0
  140. package/dist/llm/config.js +201 -0
  141. package/dist/llm/config.js.map +1 -0
  142. package/dist/llm/registry.d.ts +44 -0
  143. package/dist/llm/registry.js +48 -0
  144. package/dist/llm/registry.js.map +1 -0
  145. package/dist/llm/router.d.ts +23 -0
  146. package/dist/llm/router.js +0 -0
  147. package/dist/llm/router.js.map +1 -0
  148. package/dist/llm/tasks/ingest/asset-curate.d.ts +13 -0
  149. package/dist/llm/tasks/ingest/asset-curate.js +45 -0
  150. package/dist/llm/tasks/ingest/asset-curate.js.map +1 -0
  151. package/dist/llm/tasks/ingest/asset-extract.d.ts +12 -0
  152. package/dist/llm/tasks/ingest/asset-extract.js +51 -0
  153. package/dist/llm/tasks/ingest/asset-extract.js.map +1 -0
  154. package/dist/llm/tasks/ingest/asset-govern.d.ts +22 -0
  155. package/dist/llm/tasks/ingest/asset-govern.js +143 -0
  156. package/dist/llm/tasks/ingest/asset-govern.js.map +1 -0
  157. package/dist/llm/tasks/ingest/mention-resolve.d.ts +9 -0
  158. package/dist/llm/tasks/ingest/mention-resolve.js +39 -0
  159. package/dist/llm/tasks/ingest/mention-resolve.js.map +1 -0
  160. package/dist/llm/tasks/ingest/plot-speaker.d.ts +11 -0
  161. package/dist/llm/tasks/ingest/plot-speaker.js +72 -0
  162. package/dist/llm/tasks/ingest/plot-speaker.js.map +1 -0
  163. package/dist/llm/tasks/ingest/roster-merge.d.ts +46 -0
  164. package/dist/llm/tasks/ingest/roster-merge.js +235 -0
  165. package/dist/llm/tasks/ingest/roster-merge.js.map +1 -0
  166. package/dist/llm/tasks/ingest/state-merge.d.ts +10 -0
  167. package/dist/llm/tasks/ingest/state-merge.js +84 -0
  168. package/dist/llm/tasks/ingest/state-merge.js.map +1 -0
  169. package/dist/llm/tasks/ingest/state-reconcile.d.ts +8 -0
  170. package/dist/llm/tasks/ingest/state-reconcile.js +44 -0
  171. package/dist/llm/tasks/ingest/state-reconcile.js.map +1 -0
  172. package/dist/llm/tasks/ingest/text-normalize.d.ts +10 -0
  173. package/dist/llm/tasks/ingest/text-normalize.js +89 -0
  174. package/dist/llm/tasks/ingest/text-normalize.js.map +1 -0
  175. package/dist/llm/tasks/ingest/video-correct.d.ts +30 -0
  176. package/dist/llm/tasks/ingest/video-correct.js +144 -0
  177. package/dist/llm/tasks/ingest/video-correct.js.map +1 -0
  178. package/dist/llm/tasks/ingest/video-transcribe.d.ts +4 -0
  179. package/dist/llm/tasks/ingest/video-transcribe.js +105 -0
  180. package/dist/llm/tasks/ingest/video-transcribe.js.map +1 -0
  181. package/dist/llm/tasks/schemas.d.ts +5 -0
  182. package/dist/llm/tasks/schemas.js +107 -0
  183. package/dist/llm/tasks/schemas.js.map +1 -0
  184. package/dist/llm/types.d.ts +97 -0
  185. package/dist/llm/types.js +13 -0
  186. package/dist/llm/types.js.map +1 -0
  187. package/dist/usecases/doctor.d.ts +1 -1
  188. package/dist/usecases/doctor.js +62 -9
  189. package/dist/usecases/doctor.js.map +1 -1
  190. package/dist/usecases/ingest/command.d.ts +5 -0
  191. package/dist/usecases/ingest/command.js +64 -0
  192. package/dist/usecases/ingest/command.js.map +1 -0
  193. package/dist/usecases/ingest/fanout.d.ts +10 -0
  194. package/dist/usecases/ingest/fanout.js +23 -0
  195. package/dist/usecases/ingest/fanout.js.map +1 -0
  196. package/dist/usecases/ingest/pass4-mention-resolve.d.ts +11 -0
  197. package/dist/usecases/ingest/pass4-mention-resolve.js +52 -0
  198. package/dist/usecases/ingest/pass4-mention-resolve.js.map +1 -0
  199. package/dist/usecases/ingest/pass5-extract.d.ts +7 -0
  200. package/dist/usecases/ingest/pass5-extract.js +50 -0
  201. package/dist/usecases/ingest/pass5-extract.js.map +1 -0
  202. package/dist/usecases/ingest/pass5-govern.d.ts +13 -0
  203. package/dist/usecases/ingest/pass5-govern.js +155 -0
  204. package/dist/usecases/ingest/pass5-govern.js.map +1 -0
  205. package/dist/usecases/ingest/pipeline.d.ts +28 -0
  206. package/dist/usecases/ingest/pipeline.js +144 -0
  207. package/dist/usecases/ingest/pipeline.js.map +1 -0
  208. package/dist/usecases/ingest/publish-command.d.ts +4 -0
  209. package/dist/usecases/ingest/publish-command.js +77 -0
  210. package/dist/usecases/ingest/publish-command.js.map +1 -0
  211. package/dist/usecases/ingest/status.d.ts +39 -0
  212. package/dist/usecases/ingest/status.js +155 -0
  213. package/dist/usecases/ingest/status.js.map +1 -0
  214. package/dist/usecases/ingest/video-pass3.d.ts +26 -0
  215. package/dist/usecases/ingest/video-pass3.js +0 -0
  216. package/dist/usecases/ingest/video-pass3.js.map +1 -0
  217. package/dist/usecases/ingest/video-pipeline.d.ts +32 -0
  218. package/dist/usecases/ingest/video-pipeline.js +202 -0
  219. package/dist/usecases/ingest/video-pipeline.js.map +1 -0
  220. package/dist/usecases/ingest/view-command.d.ts +4 -0
  221. package/dist/usecases/ingest/view-command.js +51 -0
  222. package/dist/usecases/ingest/view-command.js.map +1 -0
  223. package/dist/usecases/script/actions.js +2 -2
  224. package/dist/usecases/script/actions.js.map +1 -1
  225. package/dist/usecases/script/actor.js.map +1 -1
  226. package/dist/usecases/script/actors.js.map +1 -1
  227. package/dist/usecases/script/add-actor.js.map +1 -1
  228. package/dist/usecases/script/add-episode.js.map +1 -1
  229. package/dist/usecases/script/add-location.js.map +1 -1
  230. package/dist/usecases/script/add-prop.js.map +1 -1
  231. package/dist/usecases/script/alias.js.map +1 -1
  232. package/dist/usecases/script/assets.js.map +1 -1
  233. package/dist/usecases/script/context.js.map +1 -1
  234. package/dist/usecases/script/create.js +3 -6
  235. package/dist/usecases/script/create.js.map +1 -1
  236. package/dist/usecases/script/delete.js.map +1 -1
  237. package/dist/usecases/script/describe.js.map +1 -1
  238. package/dist/usecases/script/dialogue.js +6 -13
  239. package/dist/usecases/script/dialogue.js.map +1 -1
  240. package/dist/usecases/script/do.js +1 -1
  241. package/dist/usecases/script/do.js.map +1 -1
  242. package/dist/usecases/script/episodes.js.map +1 -1
  243. package/dist/usecases/script/{add-speaker.d.ts → importance.d.ts} +1 -1
  244. package/dist/usecases/script/importance.js +17 -0
  245. package/dist/usecases/script/importance.js.map +1 -0
  246. package/dist/usecases/script/insert.js.map +1 -1
  247. package/dist/usecases/script/issues.js.map +1 -1
  248. package/dist/usecases/script/lib.d.ts +8 -6
  249. package/dist/usecases/script/lib.js +81 -97
  250. package/dist/usecases/script/lib.js.map +1 -1
  251. package/dist/usecases/script/locations.js.map +1 -1
  252. package/dist/usecases/script/merge.js.map +1 -1
  253. package/dist/usecases/script/move.js.map +1 -1
  254. package/dist/usecases/script/props.js.map +1 -1
  255. package/dist/usecases/script/refs.js.map +1 -1
  256. package/dist/usecases/script/rename.js.map +1 -1
  257. package/dist/usecases/script/replace.js.map +1 -1
  258. package/dist/usecases/script/role.js.map +1 -1
  259. package/dist/usecases/script/scenes.js +8 -15
  260. package/dist/usecases/script/scenes.js.map +1 -1
  261. package/dist/usecases/script/script-patch.js +1 -1
  262. package/dist/usecases/script/script-patch.js.map +1 -1
  263. package/dist/usecases/script/script-validate.js +1 -1
  264. package/dist/usecases/script/script-validate.js.map +1 -1
  265. package/dist/usecases/script/session.d.ts +4 -4
  266. package/dist/usecases/script/session.js +57 -78
  267. package/dist/usecases/script/session.js.map +1 -1
  268. package/dist/usecases/script/split.js.map +1 -1
  269. package/dist/usecases/script/state-add.js.map +1 -1
  270. package/dist/usecases/script/state-delete.js.map +1 -1
  271. package/dist/usecases/script/state-rename.js.map +1 -1
  272. package/dist/usecases/script/summary.js.map +1 -1
  273. package/dist/usecases/script/synopsis-generate.d.ts +4 -5
  274. package/dist/usecases/script/synopsis-generate.js +30 -46
  275. package/dist/usecases/script/synopsis-generate.js.map +1 -1
  276. package/dist/usecases/script/transition.js.map +1 -1
  277. package/dist/usecases/script/type.js.map +1 -1
  278. package/dist/usecases/script/worldview.js.map +1 -1
  279. package/package.json +21 -17
  280. package/skills/scriptctl/SKILL.md +140 -120
  281. package/skills/scriptctl/references/atomic-write-workflow.md +12 -9
  282. package/skills/scriptctl/references/ingest-workflow.md +85 -0
  283. package/skills/scriptctl/references/state-reference-repair.md +26 -39
  284. package/dist/domain/direct/runner.d.ts +0 -25
  285. package/dist/domain/direct/runner.js +0 -88
  286. package/dist/domain/direct/runner.js.map +0 -1
  287. package/dist/domain/direct/stage.d.ts +0 -108
  288. package/dist/domain/direct/stage.js +0 -134
  289. package/dist/domain/direct/stage.js.map +0 -1
  290. package/dist/domain/direct/stages/asset-curation.d.ts +0 -2
  291. package/dist/domain/direct/stages/asset-curation.js +0 -10
  292. package/dist/domain/direct/stages/asset-curation.js.map +0 -1
  293. package/dist/domain/direct/stages/batch-extract.d.ts +0 -2
  294. package/dist/domain/direct/stages/batch-extract.js +0 -12
  295. package/dist/domain/direct/stages/batch-extract.js.map +0 -1
  296. package/dist/domain/direct/stages/batch-plan.d.ts +0 -2
  297. package/dist/domain/direct/stages/batch-plan.js +0 -9
  298. package/dist/domain/direct/stages/batch-plan.js.map +0 -1
  299. package/dist/domain/direct/stages/episode-merge.d.ts +0 -2
  300. package/dist/domain/direct/stages/episode-merge.js +0 -11
  301. package/dist/domain/direct/stages/episode-merge.js.map +0 -1
  302. package/dist/domain/direct/stages/episode-plan.d.ts +0 -2
  303. package/dist/domain/direct/stages/episode-plan.js +0 -9
  304. package/dist/domain/direct/stages/episode-plan.js.map +0 -1
  305. package/dist/domain/direct/stages/episode-synopsis.d.ts +0 -2
  306. package/dist/domain/direct/stages/episode-synopsis.js +0 -12
  307. package/dist/domain/direct/stages/episode-synopsis.js.map +0 -1
  308. package/dist/domain/direct/stages/episode-titles.d.ts +0 -2
  309. package/dist/domain/direct/stages/episode-titles.js +0 -12
  310. package/dist/domain/direct/stages/episode-titles.js.map +0 -1
  311. package/dist/domain/direct/stages/index.d.ts +0 -19
  312. package/dist/domain/direct/stages/index.js +0 -41
  313. package/dist/domain/direct/stages/index.js.map +0 -1
  314. package/dist/domain/direct/stages/metadata.d.ts +0 -2
  315. package/dist/domain/direct/stages/metadata.js +0 -11
  316. package/dist/domain/direct/stages/metadata.js.map +0 -1
  317. package/dist/domain/direct/stages/script-merge.d.ts +0 -2
  318. package/dist/domain/direct/stages/script-merge.js +0 -15
  319. package/dist/domain/direct/stages/script-merge.js.map +0 -1
  320. package/dist/domain/direct/stages/script-synopsis.d.ts +0 -2
  321. package/dist/domain/direct/stages/script-synopsis.js +0 -12
  322. package/dist/domain/direct/stages/script-synopsis.js.map +0 -1
  323. package/dist/domain/direct/stages/source-prepare.d.ts +0 -2
  324. package/dist/domain/direct/stages/source-prepare.js +0 -9
  325. package/dist/domain/direct/stages/source-prepare.js.map +0 -1
  326. package/dist/domain/direct/stages/state-binding.d.ts +0 -2
  327. package/dist/domain/direct/stages/state-binding.js +0 -9
  328. package/dist/domain/direct/stages/state-binding.js.map +0 -1
  329. package/dist/domain/direct/stages/state-curation.d.ts +0 -2
  330. package/dist/domain/direct/stages/state-curation.js +0 -10
  331. package/dist/domain/direct/stages/state-curation.js.map +0 -1
  332. package/dist/domain/direct/stages/validate.d.ts +0 -2
  333. package/dist/domain/direct/stages/validate.js +0 -10
  334. package/dist/domain/direct/stages/validate.js.map +0 -1
  335. package/dist/domain/direct-core.d.ts +0 -313
  336. package/dist/domain/direct-core.js +0 -8514
  337. package/dist/domain/direct-core.js.map +0 -1
  338. package/dist/domain/script/validate.d.ts +0 -22
  339. package/dist/domain/script/validate.js +0 -997
  340. package/dist/domain/script/validate.js.map +0 -1
  341. package/dist/infra/providers.d.ts +0 -97
  342. package/dist/infra/providers.js +0 -1396
  343. package/dist/infra/providers.js.map +0 -1
  344. package/dist/usecases/direct.d.ts +0 -27
  345. package/dist/usecases/direct.js +0 -4172
  346. package/dist/usecases/direct.js.map +0 -1
  347. package/dist/usecases/parse.d.ts +0 -15
  348. package/dist/usecases/parse.js +0 -429
  349. package/dist/usecases/parse.js.map +0 -1
  350. package/dist/usecases/script/add-speaker.js +0 -22
  351. package/dist/usecases/script/add-speaker.js.map +0 -1
  352. package/dist/usecases/script/export.d.ts +0 -3
  353. package/dist/usecases/script/export.js +0 -111
  354. package/dist/usecases/script/export.js.map +0 -1
  355. package/dist/usecases/script/overlap.d.ts +0 -3
  356. package/dist/usecases/script/overlap.js +0 -21
  357. package/dist/usecases/script/overlap.js.map +0 -1
  358. package/dist/usecases/script/speakers.d.ts +0 -3
  359. package/dist/usecases/script/speakers.js +0 -28
  360. package/dist/usecases/script/speakers.js.map +0 -1
  361. package/dist/usecases/script/state-change.d.ts +0 -3
  362. package/dist/usecases/script/state-change.js +0 -24
  363. package/dist/usecases/script/state-change.js.map +0 -1
  364. package/skills/scriptctl/references/direct-workflow.md +0 -72
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.
122
-
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.
138
-
139
- 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.
144
-
145
- 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.
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.
161
117
 
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.
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.
206
123
 
207
124
  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
125
+ - scriptctl ingest --source-path <file|dir> [options]
225
126
 
226
127
  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
252
- `,
253
- ],
254
- [
255
- ["direct", "status"],
256
- `Direct workflow state, derived from disk artifacts (run_state only records internal runtime notes).
257
-
258
- Usage
259
- - scriptctl direct status [options]
260
-
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
300
-
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
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).
306
143
  `,
307
144
  ],
308
145
  [
309
- ["direct", "review"],
310
- `Proofread the direct draft. Read-only; no state side effects.
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.
311
151
 
312
152
  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
153
+ - scriptctl ingest status [--workspace-path <dir>] [--json]
315
154
 
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.
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.
321
160
 
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,7 @@ Notes
421
190
  // =========================================================================
422
191
  [
423
192
  ["summary"],
424
- `Show title, counts (episodes / scenes / actions / actors / locations / props / speakers)
193
+ `Show title, counts (episodes / scenes / actions / actors / locations / props)
425
194
  and the whole-script overview fields when present: worldview (+ worldview_raw),
426
195
  style, logline, theme, synopsis, main characters.
427
196
 
@@ -435,7 +204,6 @@ Target selection (applies to every query / edit verb)
435
204
  - --remote Read/write the project DB (project group). Pairs with
436
205
  --project-group-no.
437
206
  - --local Read/write the conventional local store (output/ dir).
438
- - --draft Edit the direct intermediate draft (script.initial.json).
439
207
  - --project-group-no Project group no (implies remote). Default: SANDBOX_PROJECT_GROUP_NO.
440
208
  - (inferred remote) When SANDBOX_PROJECT_GROUP_NO is set (the sandbox injects it)
441
209
  a bare command auto-targets that project's DB — no flag needed.
@@ -463,7 +231,7 @@ Options
463
231
  - --min-chars <n> Only episodes with total chars >= N.
464
232
  - --max-chars <n> Only episodes with total chars <= N.
465
233
  - --format addr Print only episode ids.
466
- - --draft / --project-group-no / --workspace-path / --json / --help
234
+ - --project-group-no / --workspace-path / --json / --help
467
235
 
468
236
  Default output
469
237
  - TSV header + one row per episode:
@@ -488,7 +256,7 @@ Options
488
256
  - --has-actor <id> Only scenes whose context references this actor.
489
257
  - --has-location <id> Only scenes whose context references this location.
490
258
  - --has-prop <id> Only scenes whose context references this prop.
491
- - --draft / --project-group-no / --workspace-path / --json / --help
259
+ - --project-group-no / --workspace-path / --json / --help
492
260
 
493
261
  Output line
494
262
  - ep_NNN/scn_NNN [space time] location=loc_NNN(name) actors=... props=... actions=N t=<t_start>..<t_end>
@@ -504,7 +272,7 @@ Examples
504
272
  [
505
273
  ["actions"],
506
274
  `Search actions across the script (the workhorse for "find where to edit").
507
- Default output is TSV: addr, timestamp, type, delivery, speaker, actor, emotion, content.
275
+ Default output is TSV: addr, timestamp, type, speaker, actor, emotion, content.
508
276
  timestamp is the action's extend.timestamp (episode-local "M:SS"; empty when
509
277
  absent) — the anchor for event-level alignment (an event spans first→last ts).
510
278
 
@@ -513,26 +281,25 @@ Usage
513
281
 
514
282
  Options
515
283
  - --in <addr> Scope to ep_NNN / ep_NNN/scn_NNN / ep_NNN/scn_NNN#idx.
516
- - --grep <text> Literal substring (default) or /regex/flags. Matches action.content + lines[].content.
517
- - --type <type> dialogue | inner_thought | action.
518
- - --actor <id> Actions where this actor speaks (resolves speaker→actor) or is action.actor_id.
519
- - --speaker <id> Actions where this speaker appears.
520
- - --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).
521
288
  - --context <n> Include N actions before/after each hit (for context windows).
522
- - --draft / --project-group-no / --workspace-path / --json / --help
289
+ - --project-group-no / --workspace-path / --json / --help
523
290
 
524
291
  Requires at least one of: --in, --grep, --type, --actor, --speaker, --has. Bare \`scriptctl actions\`
525
292
  errors out — dumping every action across all episodes is too large.
526
293
 
527
294
  Default output
528
295
  - TSV header + one row per action:
529
- addr timestamp type delivery speaker actor emotion content
296
+ addr timestamp type speaker actor emotion content
530
297
 
531
298
  Examples
532
299
  - scriptctl actions --grep "台下掌声雷动"
533
300
  - scriptctl actions --in ep_001 --type dialogue
534
301
  - scriptctl actions --grep "金碧辉煌" --context 2
535
- - scriptctl actions --actor act_001 --has state-changes
302
+ - scriptctl actions --actor act_001 --has speaker
536
303
  `,
537
304
  ],
538
305
  [
@@ -548,7 +315,7 @@ Options
548
315
  - --in <addr> Restrict to actors referenced under this address (ep/scn/action).
549
316
  - --counts Append appearance counts: scenes=N episodes_count=M episodes=<ranges>
550
317
  (scene-context presence, compacted to episode ranges).
551
- - --draft / --project-group-no / --workspace-path / --json / --help
318
+ - --project-group-no / --workspace-path / --json / --help
552
319
 
553
320
  Examples
554
321
  - scriptctl actors --name "陈"
@@ -602,7 +369,7 @@ Options
602
369
  - --name <substr> Match name substring.
603
370
  - --in <addr> Restrict to assets referenced under this address.
604
371
  - --counts Append scene / episode appearance counts per asset.
605
- - --draft / --project-group-no / --workspace-path / --json / --help
372
+ - --project-group-no / --workspace-path / --json / --help
606
373
 
607
374
  Examples
608
375
  - scriptctl assets --name "陈"
@@ -638,24 +405,6 @@ Examples
638
405
  Then edit by the printed address:
639
406
  - scriptctl rename actor:act_001/st_010 "平静(新)"
640
407
  - scriptctl delete actor:act_001/st_010 --strategy remove
641
- `,
642
- ],
643
- [
644
- ["speakers"],
645
- `List speakers with source kind / source id.
646
-
647
- Usage
648
- - scriptctl speakers [options]
649
-
650
- Options
651
- - --id <speaker_id> Filter to one speaker.
652
- - --name <substr> Match display_name substring.
653
- - --kind <kind> Filter by source_kind (actor / location / prop / system / broadcast / group / other).
654
- - --draft / --project-group-no / --workspace-path / --json / --help
655
-
656
- Examples
657
- - scriptctl speakers --kind system
658
- - scriptctl speakers --name "陈"
659
408
  `,
660
409
  ],
661
410
  [
@@ -668,7 +417,7 @@ Usage
668
417
  Options
669
418
  - --severity <severity> Filter by severity (error / warning / info / blocking).
670
419
  - --code <code> Filter by issue code (e.g. STATE_NOT_FOUND).
671
- - --draft / --project-group-no / --workspace-path / --json / --help
420
+ - --project-group-no / --workspace-path / --json / --help
672
421
 
673
422
  Output line
674
423
  - <severity> <code>: <summary> [<location>]
@@ -692,7 +441,7 @@ Address forms
692
441
 
693
442
  Options
694
443
  - --level <scene|action> Restrict to scene-level or action-level refs only.
695
- - --draft / --project-group-no / --workspace-path / --json / --help
444
+ - --project-group-no / --workspace-path / --json / --help
696
445
 
697
446
  Output line
698
447
  - <location> [<role>] (e.g. ep_001/scn_001#3.actor_id [action_actor])
@@ -712,7 +461,7 @@ Usage
712
461
  - scriptctl validate [options]
713
462
 
714
463
  Options
715
- - --draft / --project-group-no / --workspace-path / --json / --help
464
+ - --project-group-no / --workspace-path / --json / --help
716
465
 
717
466
  Exit codes
718
467
  - 0 passed
@@ -736,9 +485,7 @@ Required
736
485
  Options
737
486
  - --to Replacement text. Default: "" (delete the substring).
738
487
  - --all Replace every occurrence in the action. Without it, multiple matches reject.
739
- - --draft / --project-group-no / --workspace-path / --request-id / --json / --help
740
-
741
- Refuses overlap dialogue actions — use \`scriptctl overlap\` to rewrite their lines.
488
+ - --project-group-no / --workspace-path / --request-id / --json / --help
742
489
 
743
490
  Example
744
491
  - scriptctl replace ep_001/scn_001#3 --from ",台下掌声雷动" --to ""
@@ -797,14 +544,13 @@ Usage
797
544
  - scriptctl insert <ep> --location <loc_id> [position-flags] [options] # scene insert
798
545
 
799
546
  Action insert (first arg is ep/scn)
800
- - --type dialogue / action / inner_thought.
547
+ - --type dialogue / action / inner_thought / transition.
801
548
  - --content Action content text.
802
549
  - --emotion <text> Optional action.emotion.
803
- - --actor <id> Optional action.actor_id.
804
- - --speaker <id> Optional action.speaker_id.
550
+ - --actor <id> Optional: set the line's inline speaker to an actor (action.speaker).
805
551
 
806
552
  Scene insert (first arg is ep)
807
- - --location <id> Required: the scene's primary location.
553
+ - --location <id> Required: the scene's location.
808
554
  - --time <time> Default: day.
809
555
  - --space <space> Default: interior.
810
556
  - --scene-id <id> Optional explicit scene id (auto-assigned otherwise).
@@ -898,29 +644,6 @@ Examples
898
644
  // =========================================================================
899
645
  // Edit verbs — state / transition / context on actions+scenes
900
646
  // =========================================================================
901
- [
902
- ["state-change"],
903
- `Add or clear a state_change on a specific action.
904
-
905
- Usage
906
- - scriptctl state-change <at> <kind:id> --to <state_id> [--from <state_id>] [--effective <after|before>]
907
- - scriptctl state-change <at> <kind:id> --clear
908
-
909
- Required
910
- - <at> Action address.
911
- - <kind:id> Asset target (actor/location/prop).
912
-
913
- Options
914
- - --to Target state_id. Required unless --clear.
915
- - --from Optional explicit from-state. Otherwise inferred from prior scene context.
916
- - --effective after (default) or before.
917
- - --clear Remove the existing state_change for this target on this action.
918
-
919
- Examples
920
- - scriptctl state-change ep_001/scn_001#3 actor:act_001 --to st_shock
921
- - scriptctl state-change ep_001/scn_001#3 actor:act_001 --clear
922
- `,
923
- ],
924
647
  [
925
648
  ["transition"],
926
649
  `Set or clear an action.transition_prompt (process + contrast for visual generation).
@@ -935,20 +658,22 @@ Examples
935
658
  `,
936
659
  ],
937
660
  [
938
- ["context"],
939
- `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).
940
663
 
941
664
  Usage
942
- - scriptctl context <ep/scn> <kind:id> --state <state_id> # upsert ref + set state
943
- - scriptctl context <ep/scn> <kind:id> --state none # upsert ref, no state
944
- - scriptctl context <ep/scn> <kind:id> --clear # keep ref, clear state
945
- - 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
946
669
 
670
+ kind is actor / location / prop. Location is single-valued per scene (set replaces).
947
671
  Exactly one of --state / --clear / --remove must be passed.
948
672
 
949
673
  Examples
950
- - scriptctl context ep_001/scn_001 actor:act_001 --state st_calm
951
- - 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
952
677
  `,
953
678
  ],
954
679
  // =========================================================================
@@ -1006,6 +731,21 @@ Only valid on actor:* addresses.
1006
731
 
1007
732
  Example
1008
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
1009
749
  `,
1010
750
  ],
1011
751
  [
@@ -1057,8 +797,7 @@ Behavior
1057
797
  - Uses a text-output contract and parser, not tool_use.
1058
798
 
1059
799
  Options
1060
- - --provider <name> openai | anthropic | mock. Default: openai
1061
- - --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
1062
801
  - --concurrency <n> parallel chunk extraction, default 30
1063
802
  - --checkpoint <dir> checkpoint directory, default workspace direct loom dir
1064
803
  - --overwrite regenerate existing synopsis fields
@@ -1162,50 +901,18 @@ Examples
1162
901
  // =========================================================================
1163
902
  [
1164
903
  ["dialogue"],
1165
- `Convert an action to a dialogue and attach speaker(s).
1166
-
1167
- Usage
1168
- - scriptctl dialogue <at> --speakers <id1[,id2,...]> [--delivery <single|simultaneous|group>]
1169
-
1170
- Speakers can be a comma-separated list. Delivery defaults to single (1 speaker) or simultaneous (>1).
1171
-
1172
- Examples
1173
- - scriptctl dialogue ep_001/scn_001#3 --speakers spk_chenmu
1174
- - scriptctl dialogue ep_001/scn_001#3 --speakers spk_a,spk_b --delivery simultaneous
1175
- `,
1176
- ],
1177
- [
1178
- ["overlap"],
1179
- `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.
1180
906
 
1181
907
  Usage
1182
- - scriptctl overlap <at> --line "<speaker_id>:<content>" [--line ...]
1183
-
1184
- 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>]
1185
910
 
1186
- Example
1187
- - scriptctl overlap ep_001/scn_001#3 --line "spk_chenmu:你好" --line "spk_other:hi"
1188
- `,
1189
- ],
1190
- [
1191
- ["add-speaker"],
1192
- `Register a new speaker entity.
1193
-
1194
- Usage
1195
- - scriptctl add-speaker --kind <kind> --name <display_name> [options]
1196
-
1197
- Required
1198
- - --kind actor | location | prop | system | broadcast | group | other.
1199
- - --name Display name.
1200
-
1201
- Options
1202
- - --source-id <id> For kind=actor/location/prop, points at the asset.
1203
- - --voice-desc <text> Free-form voice description.
1204
- - --speaker-id <id> Optional explicit id (auto-assigned otherwise).
911
+ Pass exactly one of --actor (an actor) or --kind (a non-actor source).
1205
912
 
1206
913
  Examples
1207
- - scriptctl add-speaker --kind actor --name "陈默" --source-id act_001
1208
- - 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 广播
1209
916
  `,
1210
917
  ],
1211
918
  // =========================================================================
@@ -1234,7 +941,7 @@ Use \`scriptctl patch --schema\` to see every supported op + its required fields
1234
941
  Options
1235
942
  - --schema [<op>] Dump op schema (JSON) instead of applying. With <op>, dump just that op.
1236
943
  - --dry-run Apply to an in-memory copy, run validate, do NOT write to gateway.
1237
- - --draft / --project-group-no / --workspace-path / --request-id / --json / --help
944
+ - --project-group-no / --workspace-path / --request-id / --json / --help
1238
945
 
1239
946
  Examples
1240
947
  - scriptctl patch changes.json