@lingjingai/scriptctl 0.50.0 → 0.51.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 (287) hide show
  1. package/changes/0.51.0.md +24 -0
  2. package/changes/0.51.1.md +15 -0
  3. package/changes/unreleased.md +1 -2
  4. package/dist/cli/register-batch.d.ts +3 -0
  5. package/dist/cli/register-batch.js +28 -0
  6. package/dist/cli/register-batch.js.map +1 -0
  7. package/dist/cli/register-edits.d.ts +4 -0
  8. package/dist/cli/register-edits.js +226 -0
  9. package/dist/cli/register-edits.js.map +1 -0
  10. package/dist/cli/register-query.d.ts +4 -0
  11. package/dist/cli/register-query.js +93 -0
  12. package/dist/cli/register-query.js.map +1 -0
  13. package/dist/cli/register-tools.d.ts +3 -0
  14. package/dist/cli/register-tools.js +23 -0
  15. package/dist/cli/register-tools.js.map +1 -0
  16. package/dist/cli/register-workflows.d.ts +4 -0
  17. package/dist/cli/register-workflows.js +71 -0
  18. package/dist/cli/register-workflows.js.map +1 -0
  19. package/dist/cli/registry.d.ts +14 -0
  20. package/dist/cli/registry.js +65 -0
  21. package/dist/cli/registry.js.map +1 -0
  22. package/dist/cli.d.ts +3 -0
  23. package/dist/cli.js +146 -596
  24. package/dist/cli.js.map +1 -1
  25. package/dist/common.d.ts +12 -38
  26. package/dist/common.js +5 -11
  27. package/dist/common.js.map +1 -1
  28. package/dist/domain/authoring/shared/bracket.js +3 -3
  29. package/dist/domain/authoring/shared/bracket.js.map +1 -1
  30. package/dist/domain/authoring/v3/apply.js +3 -3
  31. package/dist/domain/authoring/v3/apply.js.map +1 -1
  32. package/dist/domain/authoring/v4/apply.js +6 -6
  33. package/dist/domain/authoring/v4/apply.js.map +1 -1
  34. package/dist/domain/authoring/v4/parser.js +2 -2
  35. package/dist/domain/authoring/v4/parser.js.map +1 -1
  36. package/dist/domain/authoring/v4/serializer.js +2 -2
  37. package/dist/domain/authoring/v4/serializer.js.map +1 -1
  38. package/dist/domain/ingest/assembler.d.ts +1 -0
  39. package/dist/domain/ingest/assembler.js +8 -2
  40. package/dist/domain/ingest/assembler.js.map +1 -1
  41. package/dist/domain/ingest/video-apply.js +6 -3
  42. package/dist/domain/ingest/video-apply.js.map +1 -1
  43. package/dist/domain/ingest/video-context.js +2 -2
  44. package/dist/domain/ingest/video-context.js.map +1 -1
  45. package/dist/domain/ingest/video-records.d.ts +6 -5
  46. package/dist/domain/ingest/video-serial-md.d.ts +6 -5
  47. package/dist/domain/ingest/video-serial-md.js +11 -4
  48. package/dist/domain/ingest/video-serial-md.js.map +1 -1
  49. package/dist/domain/script/dispatch.js +5 -7
  50. package/dist/domain/script/dispatch.js.map +1 -1
  51. package/dist/domain/script/shared.js +4 -6
  52. package/dist/domain/script/shared.js.map +1 -1
  53. package/dist/domain/script/v3/address.js +29 -38
  54. package/dist/domain/script/v3/address.js.map +1 -1
  55. package/dist/domain/script/v3/lookups.js +31 -32
  56. package/dist/domain/script/v3/lookups.js.map +1 -1
  57. package/dist/domain/script/v3/ordinal.js +4 -5
  58. package/dist/domain/script/v3/ordinal.js.map +1 -1
  59. package/dist/domain/script/v3/parse.js +3 -4
  60. package/dist/domain/script/v3/parse.js.map +1 -1
  61. package/dist/domain/script/v3/patch/helpers.js +6 -8
  62. package/dist/domain/script/v3/patch/helpers.js.map +1 -1
  63. package/dist/domain/script/v3/selector.js +6 -8
  64. package/dist/domain/script/v3/selector.js.map +1 -1
  65. package/dist/domain/script/v4/address.js +2 -3
  66. package/dist/domain/script/v4/address.js.map +1 -1
  67. package/dist/domain/script/v4/ids.js +6 -7
  68. package/dist/domain/script/v4/ids.js.map +1 -1
  69. package/dist/domain/script/v4/ordinal.js +4 -5
  70. package/dist/domain/script/v4/ordinal.js.map +1 -1
  71. package/dist/domain/script/v4/parse.js +3 -4
  72. package/dist/domain/script/v4/parse.js.map +1 -1
  73. package/dist/domain/script/v4/patch/apply.js +3 -3
  74. package/dist/domain/script/v4/patch/apply.js.map +1 -1
  75. package/dist/domain/script/v4/patch/helpers.js +3 -4
  76. package/dist/domain/script/v4/patch/helpers.js.map +1 -1
  77. package/dist/domain/script/v4/patch/ops-action.js +46 -49
  78. package/dist/domain/script/v4/patch/ops-action.js.map +1 -1
  79. package/dist/domain/script/v4/selector.js +2 -3
  80. package/dist/domain/script/v4/selector.js.map +1 -1
  81. package/dist/infra/ingest/video-discovery.js +7 -4
  82. package/dist/infra/ingest/video-discovery.js.map +1 -1
  83. package/dist/infra/script-output-store.js +6 -11
  84. package/dist/infra/script-output-store.js.map +1 -1
  85. package/dist/infra/script-working-copy.js +15 -16
  86. package/dist/infra/script-working-copy.js.map +1 -1
  87. package/dist/llm/config.js +3 -4
  88. package/dist/llm/config.js.map +1 -1
  89. package/dist/llm/router.js +6 -8
  90. package/dist/llm/router.js.map +1 -1
  91. package/dist/llm/tasks/ingest/text-normalize.js +3 -3
  92. package/dist/llm/tasks/ingest/text-normalize.js.map +1 -1
  93. package/dist/llm/tasks/ingest/video-serial.js +29 -22
  94. package/dist/llm/tasks/ingest/video-serial.js.map +1 -1
  95. package/dist/llm/tasks/schemas.js +5 -5
  96. package/dist/llm/tasks/schemas.js.map +1 -1
  97. package/dist/output.d.ts +2 -3
  98. package/dist/output.js +72 -109
  99. package/dist/output.js.map +1 -1
  100. package/dist/usecases/changelog.d.ts +2 -2
  101. package/dist/usecases/changelog.js +28 -36
  102. package/dist/usecases/changelog.js.map +1 -1
  103. package/dist/usecases/doctor.d.ts +2 -2
  104. package/dist/usecases/doctor.js +3 -5
  105. package/dist/usecases/doctor.js.map +1 -1
  106. package/dist/usecases/ingest/command.d.ts +2 -2
  107. package/dist/usecases/ingest/command.js +22 -5
  108. package/dist/usecases/ingest/command.js.map +1 -1
  109. package/dist/usecases/ingest/pass5-extract.js +5 -4
  110. package/dist/usecases/ingest/pass5-extract.js.map +1 -1
  111. package/dist/usecases/ingest/pass5-govern.js +13 -11
  112. package/dist/usecases/ingest/pass5-govern.js.map +1 -1
  113. package/dist/usecases/ingest/pipeline.js +19 -16
  114. package/dist/usecases/ingest/pipeline.js.map +1 -1
  115. package/dist/usecases/ingest/serial-govern.js +5 -4
  116. package/dist/usecases/ingest/serial-govern.js.map +1 -1
  117. package/dist/usecases/ingest/status.d.ts +2 -2
  118. package/dist/usecases/ingest/status.js +1 -1
  119. package/dist/usecases/ingest/status.js.map +1 -1
  120. package/dist/usecases/ingest/video-pipeline.js +23 -17
  121. package/dist/usecases/ingest/video-pipeline.js.map +1 -1
  122. package/dist/usecases/ingest/view-command.d.ts +2 -2
  123. package/dist/usecases/ingest/view-command.js +7 -6
  124. package/dist/usecases/ingest/view-command.js.map +1 -1
  125. package/dist/usecases/ingest/view-server.d.ts +2 -2
  126. package/dist/usecases/ingest/view-server.js +7 -5
  127. package/dist/usecases/ingest/view-server.js.map +1 -1
  128. package/dist/usecases/script/actions.d.ts +2 -2
  129. package/dist/usecases/script/actions.js +12 -13
  130. package/dist/usecases/script/actions.js.map +1 -1
  131. package/dist/usecases/script/actor.d.ts +2 -2
  132. package/dist/usecases/script/actor.js +3 -4
  133. package/dist/usecases/script/actor.js.map +1 -1
  134. package/dist/usecases/script/actors.d.ts +2 -2
  135. package/dist/usecases/script/actors.js +5 -5
  136. package/dist/usecases/script/actors.js.map +1 -1
  137. package/dist/usecases/script/add-actor.d.ts +2 -2
  138. package/dist/usecases/script/add-episode.d.ts +2 -2
  139. package/dist/usecases/script/add-location.d.ts +2 -2
  140. package/dist/usecases/script/add-prop.d.ts +2 -2
  141. package/dist/usecases/script/alias.d.ts +2 -2
  142. package/dist/usecases/script/alias.js +6 -8
  143. package/dist/usecases/script/alias.js.map +1 -1
  144. package/dist/usecases/script/assets.d.ts +2 -2
  145. package/dist/usecases/script/assets.js +15 -7
  146. package/dist/usecases/script/assets.js.map +1 -1
  147. package/dist/usecases/script/audit-assets.d.ts +2 -2
  148. package/dist/usecases/script/audit-assets.js +12 -15
  149. package/dist/usecases/script/audit-assets.js.map +1 -1
  150. package/dist/usecases/script/command-constraints.js +17 -18
  151. package/dist/usecases/script/command-constraints.js.map +1 -1
  152. package/dist/usecases/script/context.d.ts +2 -2
  153. package/dist/usecases/script/context.js +3 -4
  154. package/dist/usecases/script/context.js.map +1 -1
  155. package/dist/usecases/script/create.d.ts +2 -2
  156. package/dist/usecases/script/create.js +3 -4
  157. package/dist/usecases/script/create.js.map +1 -1
  158. package/dist/usecases/script/delete.d.ts +2 -2
  159. package/dist/usecases/script/delete.js +9 -12
  160. package/dist/usecases/script/delete.js.map +1 -1
  161. package/dist/usecases/script/describe.d.ts +2 -2
  162. package/dist/usecases/script/describe.js +6 -8
  163. package/dist/usecases/script/describe.js.map +1 -1
  164. package/dist/usecases/script/dialogue.d.ts +2 -2
  165. package/dist/usecases/script/dialogue.js +5 -6
  166. package/dist/usecases/script/dialogue.js.map +1 -1
  167. package/dist/usecases/script/do.d.ts +2 -2
  168. package/dist/usecases/script/do.js +63 -66
  169. package/dist/usecases/script/do.js.map +1 -1
  170. package/dist/usecases/script/emotion.d.ts +2 -2
  171. package/dist/usecases/script/emotion.js +3 -3
  172. package/dist/usecases/script/emotion.js.map +1 -1
  173. package/dist/usecases/script/episodes.d.ts +2 -2
  174. package/dist/usecases/script/episodes.js +5 -5
  175. package/dist/usecases/script/episodes.js.map +1 -1
  176. package/dist/usecases/script/export-authoring.d.ts +2 -2
  177. package/dist/usecases/script/export-authoring.js +26 -29
  178. package/dist/usecases/script/export-authoring.js.map +1 -1
  179. package/dist/usecases/script/extend.d.ts +2 -2
  180. package/dist/usecases/script/extend.js +22 -18
  181. package/dist/usecases/script/extend.js.map +1 -1
  182. package/dist/usecases/script/ids.d.ts +2 -2
  183. package/dist/usecases/script/ids.js +21 -17
  184. package/dist/usecases/script/ids.js.map +1 -1
  185. package/dist/usecases/script/importance.d.ts +2 -2
  186. package/dist/usecases/script/importance.js +3 -4
  187. package/dist/usecases/script/importance.js.map +1 -1
  188. package/dist/usecases/script/insert.d.ts +2 -2
  189. package/dist/usecases/script/insert.js +8 -10
  190. package/dist/usecases/script/insert.js.map +1 -1
  191. package/dist/usecases/script/issues.d.ts +2 -2
  192. package/dist/usecases/script/issues.js +10 -2
  193. package/dist/usecases/script/issues.js.map +1 -1
  194. package/dist/usecases/script/lib.d.ts +15 -9
  195. package/dist/usecases/script/lib.js +226 -166
  196. package/dist/usecases/script/lib.js.map +1 -1
  197. package/dist/usecases/script/locations.d.ts +2 -2
  198. package/dist/usecases/script/locations.js +5 -5
  199. package/dist/usecases/script/locations.js.map +1 -1
  200. package/dist/usecases/script/merge.d.ts +2 -2
  201. package/dist/usecases/script/merge.js +9 -12
  202. package/dist/usecases/script/merge.js.map +1 -1
  203. package/dist/usecases/script/move.d.ts +2 -2
  204. package/dist/usecases/script/move.js +6 -8
  205. package/dist/usecases/script/move.js.map +1 -1
  206. package/dist/usecases/script/parenthetical.d.ts +2 -2
  207. package/dist/usecases/script/parenthetical.js +9 -12
  208. package/dist/usecases/script/parenthetical.js.map +1 -1
  209. package/dist/usecases/script/props.d.ts +2 -2
  210. package/dist/usecases/script/props.js +5 -5
  211. package/dist/usecases/script/props.js.map +1 -1
  212. package/dist/usecases/script/refs.d.ts +2 -2
  213. package/dist/usecases/script/refs.js +23 -17
  214. package/dist/usecases/script/refs.js.map +1 -1
  215. package/dist/usecases/script/rename.d.ts +2 -2
  216. package/dist/usecases/script/rename.js +6 -8
  217. package/dist/usecases/script/rename.js.map +1 -1
  218. package/dist/usecases/script/replace.d.ts +2 -2
  219. package/dist/usecases/script/replace.js +6 -8
  220. package/dist/usecases/script/replace.js.map +1 -1
  221. package/dist/usecases/script/role.d.ts +2 -2
  222. package/dist/usecases/script/role.js +3 -4
  223. package/dist/usecases/script/role.js.map +1 -1
  224. package/dist/usecases/script/scenes.d.ts +2 -2
  225. package/dist/usecases/script/scenes.js +7 -5
  226. package/dist/usecases/script/scenes.js.map +1 -1
  227. package/dist/usecases/script/script-patch.d.ts +2 -2
  228. package/dist/usecases/script/script-patch.js +95 -112
  229. package/dist/usecases/script/script-patch.js.map +1 -1
  230. package/dist/usecases/script/script-validate.d.ts +2 -2
  231. package/dist/usecases/script/script-validate.js +11 -7
  232. package/dist/usecases/script/script-validate.js.map +1 -1
  233. package/dist/usecases/script/session.js +52 -63
  234. package/dist/usecases/script/session.js.map +1 -1
  235. package/dist/usecases/script/split.d.ts +2 -2
  236. package/dist/usecases/script/split.js +6 -8
  237. package/dist/usecases/script/split.js.map +1 -1
  238. package/dist/usecases/script/state-add.d.ts +2 -2
  239. package/dist/usecases/script/state-add.js +3 -4
  240. package/dist/usecases/script/state-add.js.map +1 -1
  241. package/dist/usecases/script/state-delete.d.ts +2 -2
  242. package/dist/usecases/script/state-delete.js +3 -4
  243. package/dist/usecases/script/state-delete.js.map +1 -1
  244. package/dist/usecases/script/state-rename.d.ts +2 -2
  245. package/dist/usecases/script/state-rename.js +3 -4
  246. package/dist/usecases/script/state-rename.js.map +1 -1
  247. package/dist/usecases/script/states.d.ts +2 -2
  248. package/dist/usecases/script/states.js +54 -27
  249. package/dist/usecases/script/states.js.map +1 -1
  250. package/dist/usecases/script/summary.d.ts +2 -2
  251. package/dist/usecases/script/summary.js +21 -2
  252. package/dist/usecases/script/summary.js.map +1 -1
  253. package/dist/usecases/script/synopsis-generate.d.ts +2 -2
  254. package/dist/usecases/script/synopsis-generate.js +38 -39
  255. package/dist/usecases/script/synopsis-generate.js.map +1 -1
  256. package/dist/usecases/script/synopsis.d.ts +2 -2
  257. package/dist/usecases/script/synopsis.js +9 -12
  258. package/dist/usecases/script/synopsis.js.map +1 -1
  259. package/dist/usecases/script/transition.d.ts +2 -2
  260. package/dist/usecases/script/transition.js +3 -4
  261. package/dist/usecases/script/transition.js.map +1 -1
  262. package/dist/usecases/script/type.d.ts +2 -2
  263. package/dist/usecases/script/type.js +3 -4
  264. package/dist/usecases/script/type.js.map +1 -1
  265. package/dist/usecases/script/v4/queries.d.ts +3 -2
  266. package/dist/usecases/script/v4/queries.js +43 -6
  267. package/dist/usecases/script/v4/queries.js.map +1 -1
  268. package/dist/usecases/script/working-copy.d.ts +4 -4
  269. package/dist/usecases/script/working-copy.js +96 -92
  270. package/dist/usecases/script/working-copy.js.map +1 -1
  271. package/dist/usecases/script/worldview.d.ts +2 -2
  272. package/dist/usecases/script/worldview.js +3 -4
  273. package/dist/usecases/script/worldview.js.map +1 -1
  274. package/dist/usecases/script/write-authoring.d.ts +2 -2
  275. package/dist/usecases/script/write-authoring.js +62 -81
  276. package/dist/usecases/script/write-authoring.js.map +1 -1
  277. package/dist/usecases/update.d.ts +2 -2
  278. package/dist/usecases/update.js +32 -47
  279. package/dist/usecases/update.js.map +1 -1
  280. package/package.json +1 -1
  281. package/skills/scriptctl/SKILL.md +46 -37
  282. package/skills/scriptctl/references/atomic-edit-workflow.md +6 -6
  283. package/skills/scriptctl/references/ingest-workflow.md +20 -20
  284. package/skills/scriptctl/references/state-reference-repair.md +6 -6
  285. package/dist/help-text.d.ts +0 -2
  286. package/dist/help-text.js +0 -1144
  287. package/dist/help-text.js.map +0 -1
package/dist/help-text.js DELETED
@@ -1,1144 +0,0 @@
1
- const HELP_ENTRIES = [
2
- [
3
- [],
4
- `scriptctl — 剧本阶段统一 CLI
5
-
6
- Usage
7
- - scriptctl <query> [flags] # read a script
8
- - scriptctl <verb> <address> [flags] # edit a script
9
- - scriptctl ingest --source-path SRC # txt/md/docx/video → new Script v4
10
-
11
- Workflows
12
- - ingest txt/md/docx/video → Script v4 workspace. Run: scriptctl ingest --help
13
- - view Render a workspace script.json to review.html (no model)
14
- - checkout Download one remote snapshot into a managed local working copy
15
- - status Show whether the local working copy is managed and dirty
16
- - publish Validate and CAS-publish the local working copy
17
- - export Produce canonical file-backed authoring blocks from a local script
18
-
19
- Read
20
- - summary | episodes | scenes | actions
21
- - actors | locations | props | assets | states
22
- - issues | refs | validate | audit-assets
23
-
24
- Write
25
- - create | add-actor | add-location | add-prop | add-episode
26
- - replace | type | actor | emotion (v3) | parenthetical (v4)
27
- - insert | delete | move | split | merge
28
- - rename | describe | alias | role | importance | worldview | synopsis | extend
29
- - state-add | state-rename | state-delete | transition | scene-ref
30
- - dialogue
31
-
32
- Batch
33
- - write <file> plan/apply complete script, episode, scene, or span blocks
34
- - ids generate unreserved canonical ID candidates
35
- - do [file|-] run one CLI verb per line as one transaction
36
- - patch [file|-] apply JSON ops; use --schema to inspect op shapes
37
-
38
- Tools
39
- - doctor | update | changelog
40
-
41
- Target
42
- - reads and edits use --script-path FILE (default: ./workspace/script.json)
43
- - remote access exists only in checkout/publish; project defaults from the environment
44
- - selection where supported: --in SELECTOR plus filters; see command help
45
-
46
- Output
47
- - default text is agent-facing
48
- - --json structured envelope for jq/scripts
49
- - --format addr address stream for xargs / do generation
50
-
51
- More help
52
- - scriptctl <command> --help
53
- - scriptctl patch --schema
54
-
55
- Exit codes
56
- - 0 success
57
- - 64 usage or arguments error
58
- - 66 input file unavailable
59
- - 70 provider or runtime failure
60
- - 78 validation failed; agent repair needed
61
- `,
62
- ],
63
- [
64
- ["update"],
65
- `Update the globally installed scriptctl package.
66
-
67
- Usage
68
- - scriptctl update [options]
69
-
70
- Options
71
- - --dry-run Show the package-manager command without running it.
72
- - --patch Update only within the current major.minor patch line.
73
- - --json Print machine-readable JSON.
74
- - --help Show this help.
75
- `,
76
- ],
77
- [
78
- ["changelog"],
79
- `Show scriptctl feature changes.
80
-
81
- Usage
82
- - scriptctl changelog
83
- - scriptctl changelog <version>
84
- - scriptctl changelog --from <version> [--to <version>]
85
- - scriptctl changelog --unreleased
86
-
87
- Options
88
- - --from <version> Show released changes after this version.
89
- - --to <version> Upper bound for --from. Default: current package version.
90
- - --unreleased Show development changes not yet assigned to a release.
91
- - --json Print machine-readable JSON.
92
- - --help Show this help.
93
- `,
94
- ],
95
- [
96
- ["doctor"],
97
- `Check the standalone scriptctl CLI environment.
98
-
99
- Usage
100
- - scriptctl doctor [options]
101
-
102
- Options
103
- - --llm-config <path> LLM task/model routing YAML. Otherwise env, fixed global path, then built-in config.
104
- - --json Print machine-readable JSON.
105
- - --help Show this help.
106
-
107
- Checks
108
- - Node version
109
- - optional source-conversion/LLM dependencies
110
- - resolved LLM config, providers, profiles, task routes, and referenced credentials
111
- - local .env discovery
112
- - storage backend
113
- `,
114
- ],
115
- [
116
- ["ingest"],
117
- `Convert a txt/md/docx or video source into a Script v4 workspace.
118
-
119
- Text pipeline: pass1 chunk → pass2 normalize (DeepSeek Flash emits structured JSON,
120
- validated deterministically) → pass3 merge → compile (provisional script.initial.json +
121
- evidence) → pass5 govern (asset recall + refine → merge/canonical/prune) →
122
- script.json (v4-validated). Fully decoupled from direct.
123
-
124
- Video pipeline (file or directory of episodes): serial parse — each episode's
125
- Gemini call watches the video WITH the running cross-episode context (character
126
- registry + plot digest + open threads) and returns the episode content plus a
127
- registry delta. Identity is resolved by plot as it goes (unknown people get an
128
- anchored provisional, resolved once a later episode reveals them), so no roster
129
- merge / correction / speaker passes. Converges onto the SAME deterministic tail as
130
- text → identical Script v4 (timestamps ride extend.timestamp). script.json is
131
- rebuilt after every episode so it streams as it grows. Needs GEMINI_API_KEY.
132
-
133
- Usage
134
- - scriptctl ingest --source-path <file|dir> [options]
135
-
136
- Options
137
- - --source-path <path> txt/md/docx file, or a video file/directory. Required.
138
- - --workspace-path <dir> Workspace root (manifest + pass dirs + products). Default: workspace,
139
- resolved under the current directory (<cwd>/workspace). Pass an
140
- explicit dir to place it elsewhere; the resolved absolute path is
141
- echoed in the result (feed the same path to view / publish / ingest status).
142
- - --llm-config <path> LLM config override.
143
- - --concurrency <n> Text pipeline fanout concurrency. Default: 30. (Video is serial — ignored.)
144
- - --fps <n> Video sampling fps (>1 unlocks sub-second timecodes). Default: 3.
145
- - --force Same-source rerun: clears ingest products and redoes. Cannot switch sources.
146
-
147
- Notes
148
- - Resumes from per-unit checkpoints (text: chunk JSON; video: per-episode
149
- ep/ep_NNN.md (raw transcript) + ep/ep_NNN.json + context.json); a cross-source
150
- workspace fails (choose a fresh --workspace-path). Unsupported inputs
151
- (pdf/json/xlsx) are refused.
152
- - script.json validates without synopsis/metadata; enrich later with those commands.
153
- - Video: run \`scriptctl view\` for the click-to-seek review UI; episode numbering is
154
- by filename number (all-or-none; mixed fails).
155
- `,
156
- ],
157
- [
158
- ["ingest", "status"],
159
- `Report ingest progress from the workspace's REAL file state (no model, no store).
160
- Status is a pure function of the on-disk files — there is no separate state file
161
- to drift out of sync. This is the authoritative status: the runtime watcher and
162
- frontend consume \`--json\` instead of re-deriving it.
163
-
164
- Usage
165
- - scriptctl ingest status [--workspace-path <dir>] [--json]
166
-
167
- Options
168
- - --workspace-path <dir> Ingest workspace to inspect. Default: workspace, resolved
169
- under the current directory (<cwd>/workspace). Pass the
170
- same path you gave \`scriptctl ingest\`.
171
- - --json Machine payload under \`.status\` (see below).
172
-
173
- State (top-level, folded from the files)
174
- - empty No ingest workspace (no manifest.json).
175
- - incomplete Started, not finished, no hard error (rerun \`scriptctl ingest\` to resume).
176
- - failed Leftover unit error sidecars OR final v4 validation failed.
177
- - ready script.json present and v4-validated.
178
-
179
- --json payload (.status)
180
- - { workspace, exists, kind, state, phase, passes[], units, script, validation, errors[], updated }
181
- passes[] = per-pass {name, done, unit?{total,done,failed}}; units = primary bar
182
- (text: chunks; video: episodes). Liveness (is a run active?) is deliberately
183
- NOT here — it can't be read from files; that's the watcher's / agent's concern.
184
-
185
- Examples
186
- - scriptctl ingest status
187
- - scriptctl ingest status --workspace-path 1_script/workspace --json
188
- `,
189
- ],
190
- [
191
- ["view"],
192
- `Render a workspace's script.json into review.html at the workspace root. No model.
193
-
194
- Usage
195
- - scriptctl view [--workspace-path <dir>]
196
- `,
197
- ],
198
- [
199
- ["checkout"],
200
- `Create or refresh a managed local working copy from one atomic remote snapshot.
201
-
202
- Usage
203
- - scriptctl checkout [--script-path <file>] [--project-group-no <no>] [--discard-local]
204
-
205
- Options
206
- - --script-path <file> Local target. Default: ./workspace/script.json
207
- - --project-group-no <no> Remote project. Default: SANDBOX_PROJECT_GROUP_NO
208
- - --discard-local Explicitly discard an existing unmanaged or dirty local file.
209
-
210
- Without --discard-local, checkout refuses to overwrite local work.
211
- `,
212
- ],
213
- [
214
- ["status"],
215
- `Show local working-copy state without contacting the network.
216
-
217
- Usage
218
- - scriptctl status [--script-path <file>]
219
-
220
- Reports whether the file exists, whether it is managed, its base revision, and
221
- whether its semantic JSON content differs from the checked-out/published base.
222
- `,
223
- ],
224
- [
225
- ["publish"],
226
- `Validate and publish a local Script v3 or v4 working copy with strict revision CAS.
227
-
228
- Usage
229
- - scriptctl publish [--script-path <file>] [--project-group-no <no>]
230
-
231
- An unmanaged local file may create the first remote revision only. A managed
232
- working copy fetches the latest snapshot and PATCHes its local-wins diff with
233
- strict CAS. Network/CAS failures re-fetch and retry. Clean copies use no network.
234
- `,
235
- ],
236
- [
237
- ["write"],
238
- `Plan or atomically apply one canonical authoring file.
239
-
240
- Usage
241
- - scriptctl write <file> (--create|--replace) [--script-path <file>]
242
- - scriptctl write <file> (--create|--replace) --apply --plan <digest> [--script-path <file>]
243
-
244
- Options
245
- - --create Create script/episode/scene targets. Span targets do not support create.
246
- - --replace Replace existing episode/scene targets or explicit non-empty spans.
247
- - --apply Persist the proposed script atomically.
248
- - --plan <digest> Exact digest returned by a fresh plan; required with --apply.
249
- - --script-path <file> Local target. Default: ./workspace/script.json
250
- - --json Print the complete structured plan.
251
-
252
- The source must be a named file; stdin is not accepted. Default execution is a
253
- no-write plan. The digest binds exact source bytes, mode, resolved targets, and
254
- the current semantic local-script baseline. Every plan and apply invocation
255
- holds the per-script local lock; apply also rechecks the baseline before rename.
256
- `,
257
- ],
258
- [
259
- ["ids"],
260
- `Return unreserved candidate IDs. No script is required; when one exists,
261
- currently live IDs are excluded.
262
-
263
- Usage
264
- - scriptctl ids --kind <kind> --count <n> [--script-path <file>]
265
-
266
- Kinds
267
- - actor | location | prop | state | episode | scene | action
268
-
269
- The command is read-only and does not reserve IDs. Concurrent conflicts are
270
- detected later by the write plan's semantic-baseline binding.
271
- `,
272
- ],
273
- [
274
- ["export"],
275
- `Export canonical .scriptctl authoring files from a local Script v3 or v4.
276
-
277
- Usage
278
- - scriptctl export script --output <file> [--script-path <file>]
279
- - scriptctl export episodes --in <selector> --output <file> [--script-path <file>]
280
- - scriptctl export episode-spans --in <selector> --output <file> [--script-path <file>]
281
- - scriptctl export scenes --in <selector> --output <file> [--script-path <file>]
282
- - scriptctl export scene-spans --in <selector> --output <file> [--script-path <file>]
283
- - scriptctl export action-spans --in <selector> --output <file> [--script-path <file>]
284
-
285
- Selectors are comma-separated points or inclusive from..through regions in
286
- current document order. Each scene span stays in one episode; each action span
287
- stays in one scene. Export writes one homogeneous authoring file atomically.
288
- `,
289
- ],
290
- [
291
- ["export", "script"],
292
- `Export a complete create-only script authoring file, including all formal
293
- metadata, assets, states, episodes, scenes, actions, and extensions.
294
-
295
- Usage
296
- - scriptctl export script --output <file> [--script-path <file>]
297
- `,
298
- ],
299
- [
300
- ["export", "episodes"],
301
- `Export independent complete episode targets for one-to-one batch replacement.
302
-
303
- Usage
304
- - scriptctl export episodes --in "ep_002..ep_004,ep_010" --output <file> [--script-path <file>]
305
- `,
306
- ],
307
- [
308
- ["export", "episode-spans"],
309
- `Export one complete episode-span target per selector region.
310
-
311
- Usage
312
- - scriptctl export episode-spans --in "ep_002..ep_004,ep_010" --output <file> [--script-path <file>]
313
- `,
314
- ],
315
- [
316
- ["export", "scenes"],
317
- `Export independent complete scene targets for one-to-one batch replacement.
318
-
319
- Usage
320
- - scriptctl export scenes --in "ep_003/scn_010..ep_003/scn_012" --output <file> [--script-path <file>]
321
- `,
322
- ],
323
- [
324
- ["export", "scene-spans"],
325
- `Export one complete same-episode scene-span target per selector region.
326
-
327
- Usage
328
- - scriptctl export scene-spans --in "ep_003/scn_010..ep_003/scn_012" --output <file> [--script-path <file>]
329
- `,
330
- ],
331
- [
332
- ["export", "action-spans"],
333
- `Export one complete same-scene, zero-based action-span target per selector region.
334
-
335
- Usage
336
- - scriptctl export action-spans --in "ep_003/scn_010#12..ep_003/scn_010#18" --output <file> [--script-path <file>]
337
- `,
338
- ],
339
- // =========================================================================
340
- // 0.6.0 flat namespace — plural-noun queries
341
- // =========================================================================
342
- [
343
- ["summary"],
344
- `Show title, counts (episodes / scenes / actions / actors / locations / props)
345
- and the whole-script overview fields when present: worldview (+ worldview_raw),
346
- style, logline, theme, synopsis, main characters.
347
-
348
- Usage
349
- - scriptctl summary [options]
350
-
351
- Target selection (applies to every query / edit verb)
352
- - --script-path A local script JSON file. Default: ./workspace/script.json.
353
- All query and atomic edit commands are local-only.
354
-
355
- Options
356
- - --json Print JSON envelope for deterministic programs. Avoid unless parsing.
357
- - --help Show this help.
358
-
359
- Read-only. Always safe to run.
360
- `,
361
- ],
362
- [
363
- ["episodes"],
364
- `List episodes as TSV rows with per-episode counts, char totals, and synopsis.
365
-
366
- Usage
367
- - scriptctl episodes [options]
368
-
369
- Options
370
- - --id <ep_id> Filter to one episode.
371
- - --in <selector> Multi-region selector, e.g. "ep_003..ep_007,ep_010".
372
- - --min-chars <n> Only episodes with total chars >= N.
373
- - --max-chars <n> Only episodes with total chars <= N.
374
- - --format addr Print only episode ids.
375
- - --script-path / --json / --help
376
-
377
- Default output
378
- - TSV header + one row per episode:
379
- addr episode_id title scenes actions chars_total chars_dialogue chars_action synopsis
380
-
381
- Examples
382
- - scriptctl episodes
383
- - scriptctl episodes --min-chars 1000
384
- - scriptctl episodes --id ep_007
385
- - scriptctl episodes --in "ep_003..ep_007"
386
- `,
387
- ],
388
- [
389
- ["scenes"],
390
- `List scenes with their environment, asset refs, and action counts.
391
-
392
- Usage
393
- - scriptctl scenes [options]
394
-
395
- Options
396
- - --in <selector> V4: bare episode/scene IDs, ID ranges, or query-only @ ordinals.
397
- V3: ep_NNN or ep_NNN/scn_NNN.
398
- - --has-actor <id> Only scenes whose context references this actor.
399
- - --has-location <id> Only scenes whose context references this location.
400
- - --has-prop <id> Only scenes whose context references this prop.
401
- - --script-path / --json / --help
402
-
403
- Output line
404
- - V4 addr is the stable scene ID; V3 addr is ep_NNN/scn_NNN.
405
- - <addr> [space time] location=... actors=... props=... actions=N t=<t_start>..<t_end>
406
- t_start / t_end are the first / last action extend.timestamp in the scene
407
- (omitted when the scene carries no timestamps).
408
-
409
- Examples
410
- - scriptctl scenes --in '@ep:7'
411
- - scriptctl scenes --in scnK6wT3c
412
- - scriptctl scenes --in ep_007
413
- - scriptctl scenes --has-actor act_001
414
- `,
415
- ],
416
- [
417
- ["actions"],
418
- `Search actions across the script (the workhorse for "find where to edit").
419
- V4 rows expose parenthetical; V3 rows expose emotion. V4 addr is the stable
420
- Action ID; V3 addr remains ep_NNN/scn_NNN#idx.
421
- timestamp is the action's extend.timestamp (episode-local "M:SS"; empty when
422
- absent) — the anchor for event-level alignment (an event spans first→last ts).
423
-
424
- Usage
425
- - scriptctl actions [options]
426
-
427
- Options
428
- - --in <selector> V4: bare episode/scene/action IDs, same-kind ID ranges,
429
- or query-only 1-based @ ordinals.
430
- V3: existing compound addresses and query-only @ ordinals.
431
- - --grep <text> Literal substring (default) or /regex/flags. Matches action.content.
432
- - --type <type> dialogue | inner_thought | action | transition.
433
- - --actor <id> Actions whose inline speaker is this actor (action.speaker.actor_id).
434
- - --has <kind> transition | speaker (filter by structural feature).
435
- - --context <n> Include N actions before/after each hit (for context windows).
436
- - --script-path / --json / --help
437
-
438
- Requires at least one of: --in, --grep, --type, --actor, --speaker, --has. Bare \`scriptctl actions\`
439
- errors out — dumping every action across all episodes is too large.
440
-
441
- Default output
442
- - TSV header + one row per action:
443
- V4: addr ep_no scene_no global_scene_no action_no global_action_no timestamp type speaker actor parenthetical content
444
- V3: addr ep_no scene_no global_scene_no action_no global_action_no timestamp type speaker actor emotion content
445
-
446
- Examples
447
- - scriptctl actions --in '@ep:2/scn:1'
448
- - scriptctl actions --in acR8cV4n..acT2fG6z
449
- - scriptctl actions --grep "台下掌声雷动"
450
- - scriptctl actions --in ep_001 --type dialogue
451
- - scriptctl actions --grep "金碧辉煌" --context 2
452
- - scriptctl actions --actor act_001 --has speaker
453
- `,
454
- ],
455
- [
456
- ["actors"],
457
- `List actors with role / aliases / state counts.
458
-
459
- Usage
460
- - scriptctl actors [options]
461
-
462
- Options
463
- - --id <actor_id> Filter to one actor.
464
- - --name <substr> Match name substring (case-sensitive).
465
- - --in <addr> Restrict to actors referenced under this address (ep/scn/action).
466
- - --counts Append appearance counts: scenes=N episodes_count=M episodes=<ranges>
467
- (scene-context presence, compacted to episode ranges).
468
- - --script-path / --json / --help
469
-
470
- Examples
471
- - scriptctl actors --name "陈"
472
- - scriptctl actors --counts
473
- - scriptctl actors --in ep_023
474
- - scriptctl actors --in ep_001/scn_001
475
- `,
476
- ],
477
- [
478
- ["locations"],
479
- `List locations with state counts.
480
-
481
- Usage
482
- - scriptctl locations [options]
483
-
484
- Options mirror \`scriptctl actors\`: --id, --name, --in, --counts, --script-path, etc.
485
- --counts appends scenes / episode-count / episode ranges of scene-context presence.
486
-
487
- Examples
488
- - scriptctl locations --name "办公室"
489
- - scriptctl locations --counts
490
- - scriptctl locations --in ep_007
491
- `,
492
- ],
493
- [
494
- ["props"],
495
- `List props with state counts.
496
-
497
- Usage
498
- - scriptctl props [options]
499
-
500
- Options mirror \`scriptctl actors\`: --id, --name, --in, --counts, --script-path, etc.
501
- --counts appends scenes / episode-count / episode ranges of scene-context presence.
502
-
503
- Examples
504
- - scriptctl props --name "公文包"
505
- - scriptctl props --counts
506
- - scriptctl props --in ep_001/scn_001
507
- `,
508
- ],
509
- [
510
- ["assets"],
511
- `Unified search across actor / location / prop. Use when you don't care which kind.
512
-
513
- Usage
514
- - scriptctl assets [options]
515
-
516
- Options
517
- - --kind <actor|location|prop> Narrow to one kind.
518
- - --id <id> Filter by id.
519
- - --name <substr> Match name substring.
520
- - --in <addr> Restrict to assets referenced under this address.
521
- - --counts Append scene / episode appearance counts per asset.
522
- - --script-path / --json / --help
523
-
524
- Examples
525
- - scriptctl assets --name "陈"
526
- - scriptctl assets --kind actor --name "陈"
527
- `,
528
- ],
529
- [
530
- ["states"],
531
- `List every state on one asset: state_id ↔ name ↔ description ↔ episode arc.
532
-
533
- This is the read half of the state address space — run it to learn a state's
534
- id before editing (rename / delete / describe / state-change), instead of
535
- reading the raw script.json. Duplicate ids/names are flagged inline
536
- ([DUP_ID] / [DUP_NAME]).
537
-
538
- The address accepts a bare id (act_001 / loc_001 / prp_001) or the tagged form
539
- (actor:act_001) — the kind is inferred from the id prefix in the bare case.
540
-
541
- Each state line ends with its episode arc — where the state is bound across the
542
- script (scene context + action state_changes), compacted to episode ranges:
543
- actor:act_001/st_002 石膏轮椅装 desc="…" episodes=ep_018..ep_021 (4 eps, 4 scenes)
544
- This is the character's visual arc: which look is active in which episodes.
545
- A state bound nowhere shows episodes=none.
546
-
547
- Usage
548
- - scriptctl states <asset-addr>
549
-
550
- Examples
551
- - scriptctl states act_001
552
- - scriptctl states actor:act_001
553
- - scriptctl states location:loc_003
554
-
555
- Then edit by the printed address:
556
- - scriptctl rename actor:act_001/st_010 "平静(新)"
557
- - scriptctl delete actor:act_001/st_010 --strategy remove
558
- `,
559
- ],
560
- [
561
- ["issues"],
562
- `List current validation issues. Runs validateScript on demand.
563
-
564
- Usage
565
- - scriptctl issues [options]
566
-
567
- Options
568
- - --severity <severity> Filter by severity (error / warning / info / blocking).
569
- - --code <code> Filter by issue code (e.g. STATE_NOT_FOUND).
570
- - --script-path / --json / --help
571
-
572
- Output line
573
- - <severity> <code>: <summary> [<location>]
574
-
575
- Examples
576
- - scriptctl issues --severity error
577
- - scriptctl issues --code STATE_NOT_FOUND
578
- `,
579
- ],
580
- [
581
- ["refs"],
582
- `Reverse lookup: every place an asset / state / speaker is referenced.
583
-
584
- Usage
585
- - scriptctl refs <addr> [options]
586
-
587
- Address forms
588
- - actor:<id> / location:<id> / prop:<id> asset refs
589
- - actor:<id>/<state_id> (and location/prop) state refs
590
- - spk_<id> speaker refs
591
-
592
- Options
593
- - --level <scene|action> Restrict to scene-level or action-level refs only.
594
- - --script-path / --json / --help
595
-
596
- Output line
597
- - <location> [<role>] (e.g. ep_001/scn_001#3.actor_id [action_actor])
598
-
599
- Examples
600
- - scriptctl refs actor:act_001
601
- - scriptctl refs actor:act_001 --level scene
602
- - scriptctl refs actor:act_001/st_calm
603
- - scriptctl refs spk_001
604
- `,
605
- ],
606
- [
607
- ["validate"],
608
- `Validate the current final script. Read-only side; writes a validation report to workspace.
609
-
610
- Usage
611
- - scriptctl validate [options]
612
-
613
- Options
614
- - --script-path / --json / --help
615
-
616
- Exit codes
617
- - 0 passed
618
- - 78 validation needs repair (see scriptctl issues)
619
- `,
620
- ],
621
- [
622
- ["audit-assets"],
623
- `Run a model-backed whole-script asset consistency audit. Read-only for script.json;
624
- writes an asset-audit.json sidecar with merge/delete/review suggestions.
625
-
626
- Checks
627
- - duplicate actors across formatting, aliases, names, transcription and identity clues
628
- - duplicate stable visual states and suspicious unused/singleton states
629
- - duplicate location and prop assets (never merges scene occurrences)
630
-
631
- Usage
632
- - scriptctl audit-assets [options]
633
-
634
- Options
635
- - --script-path <file> Script v3 input. Default: ./workspace/script.json
636
- - --llm-config <path> Optional LLM routing config.
637
- - --output <path> Audit sidecar. Default: next to script.json.
638
- - --json / --help
639
-
640
- Behavior
641
- - Never edits or merges the script automatically.
642
- - Exit 0 when no findings; exit 78 when findings need review.
643
- `,
644
- ],
645
- // =========================================================================
646
- // Edit verbs — content
647
- // =========================================================================
648
- [
649
- ["replace"],
650
- `Literal substring replace inside action.content.
651
-
652
- Usage
653
- - scriptctl replace <at> --from <text> [--to <text>] [--all] [options]
654
-
655
- Required
656
- - <at> v4 Action ID, or v3 ep_NNN/scn_NNN#idx.
657
- - --from Non-empty substring to replace.
658
-
659
- Options
660
- - --to Replacement text. Default: "" (delete the substring).
661
- - --all Replace every occurrence in the action. Without it, multiple matches reject.
662
- - --script-path / --json / --help
663
-
664
- Example
665
- - scriptctl replace ep_001/scn_001#3 --from ",台下掌声雷动" --to ""
666
- `,
667
- ],
668
- [
669
- ["type"],
670
- `Set action.type on a specific action. V4 writes use an Action ID; converting
671
- a narrative v4 action into dialogue/inner_thought is refused because no speaker
672
- was supplied.
673
-
674
- Usage
675
- - scriptctl type <at> <dialogue|action|inner_thought>
676
-
677
- Example
678
- - scriptctl type ep_001/scn_001#3 dialogue
679
- `,
680
- ],
681
- [
682
- ["actor"],
683
- `Set a speaking action's actor speaker.
684
-
685
- Usage
686
- - scriptctl actor <at> <actor_id>
687
-
688
- Example
689
- - scriptctl actor ep_001/scn_001#3 act_002
690
- `,
691
- ],
692
- [
693
- ["emotion"],
694
- `Set or clear action.emotion on a Script v3 action.
695
-
696
- Usage
697
- - scriptctl emotion <at> <emotion>
698
- - scriptctl emotion <at> --clear
699
-
700
- Selection
701
- - scriptctl emotion --in <selector> [filters] <emotion> [--apply]
702
- - scriptctl emotion --in <selector> [filters] --clear [--apply]
703
-
704
- Examples
705
- - scriptctl emotion ep_001/scn_001#3 愤怒
706
- - scriptctl emotion ep_001/scn_001#3 --clear
707
- - scriptctl emotion --in ep_001 --type dialogue 紧张 --apply
708
- `,
709
- ],
710
- [
711
- ["parenthetical"],
712
- `Set, preserve as empty, or remove a Script v4 speaking Action's parenthetical.
713
-
714
- Usage
715
- - scriptctl parenthetical <action-id> --set <text>
716
- - scriptctl parenthetical <action-id> --set ""
717
- - scriptctl parenthetical <action-id> --remove
718
-
719
- Selection
720
- - scriptctl parenthetical --in <id-or-id-range> [filters] --set <text>
721
- - scriptctl parenthetical --in <id-or-id-range> [filters] --remove
722
-
723
- Script v4 writes require stable Action IDs. Ordinal @ anchors are query-only.
724
- `,
725
- ],
726
- // =========================================================================
727
- // Edit verbs — structure (multipolar by first-arg address format)
728
- // =========================================================================
729
- [
730
- ["insert"],
731
- `Insert an action into a scene or a new empty scene into an episode.
732
-
733
- Script v4
734
- - Parent addresses are bare episode/scene IDs.
735
- - New IDs are generated as typed NanoIDs, or supplied with --action-id / --scene-id.
736
- - Placement uses sibling IDs with --before or --after; numeric --at is rejected.
737
- - Speaking actions accept --parenthetical, --actor and optional --speaker-state.
738
- - A scene location accepts one or more --state values; location may be omitted.
739
-
740
- Script v3
741
- - Parent addresses retain ep_NNN or ep_NNN/scn_NNN.
742
- - Numeric --at and v3 sibling addresses retain their existing semantics.
743
- - Speaking actions use --emotion.
744
-
745
- Examples
746
- - scriptctl insert scnK6wT3c --action-id acR8cV4n --type dialogue --content "欢迎。" --actor actA3kP9x --parenthetical "低声"
747
- - scriptctl insert epQ7mN2v --scene-id scnD4eF6g --location locF9dH2s --state default
748
- `,
749
- ],
750
- [
751
- ["delete"],
752
- `Delete an action, scene, asset, state, or speaker. Multipolar by address format.
753
-
754
- Usage
755
- - scriptctl delete <addr> [--strategy replace|remove] [--replacement <id>] [--force]
756
-
757
- Behavior by address kind
758
- - v4 uses bare typed IDs and asset_id/state_id; v3 uses its existing compound addresses.
759
- - action Remove the action.
760
- - scene Empty scene: removed. Non-empty: refused unless --force.
761
- - asset Refuses by default if refs exist. Pass --strategy:
762
- replace --replacement <addr>: rewrite all refs to the replacement, then delete.
763
- remove: scrub valid removable refs and delete.
764
- - state replace rewrites references; remove is refused if a v4
765
- scene state set would become empty.
766
-
767
- Examples
768
- - scriptctl delete ep_001/scn_001#3
769
- - scriptctl delete ep_001/scn_005 --force
770
- - scriptctl delete actor:act_001 --strategy replace --replacement actor:act_002
771
- - scriptctl delete actor:act_001/st_010 --strategy remove
772
- - scriptctl delete spk_001 --strategy remove
773
- `,
774
- ],
775
- [
776
- ["move"],
777
- `Move an action across scenes, or a scene across episodes.
778
-
779
- Usage
780
- - scriptctl move <addr> <to> [--at <idx>] [--before <id>|--after <id>]
781
-
782
- V4 uses a source ID, target parent ID, and optional sibling Action/Scene ID.
783
- V3 retains numeric and compound-address placement.
784
- `,
785
- ],
786
- [
787
- ["split"],
788
- `Split a scene at an action boundary into two sibling scenes.
789
-
790
- Usage
791
- - v4: scriptctl split <scene-id> --at <first-tail-action-id> [--new-scene-id <id>]
792
- - v3: scriptctl split <ep/scn> --at <idx> [--new-scene-id <id>]
793
-
794
- The v4 anchor is the first Action moved into the new tail scene.
795
- `,
796
- ],
797
- [
798
- ["merge"],
799
- `Merge one asset / scene into another. Source disappears; refs are rewritten to the target.
800
-
801
- Usage
802
- - scriptctl merge <src> --into <dst>
803
-
804
- Both addresses must be the same kind. V4 uses bare typed IDs; scene merge requires
805
- adjacent scenes in one episode and refuses conflicting locations.
806
-
807
- Examples
808
- - scriptctl merge actor:act_001 --into actor:act_002
809
- - scriptctl merge ep_001/scn_005 --into ep_001/scn_006
810
- `,
811
- ],
812
- // =========================================================================
813
- // Edit verbs — state / transition / context on actions+scenes
814
- // =========================================================================
815
- [
816
- ["transition"],
817
- `Set or clear an action.transition_prompt (process + contrast for visual generation).
818
-
819
- Usage
820
- - scriptctl transition <at> <kind:id> --process <text> --contrast <text>
821
- - scriptctl transition <at> <kind:id> --clear
822
-
823
- Examples
824
- - scriptctl transition ep_001/scn_001#3 actor:act_001 --process "深呼吸三秒" --contrast "由静转动"
825
- - scriptctl transition ep_001/scn_001#3 actor:act_001 --clear
826
- `,
827
- ],
828
- [
829
- ["scene-ref"],
830
- `Manage a scene's cast / props / location reference.
831
-
832
- Script v4
833
- - scriptctl scene-ref <scene-id> <asset-id> --state <state-id> [--state <state-id> ...]
834
- - scriptctl scene-ref <scene-id> <asset-id> --remove
835
-
836
- Each asset appears once per scene and carries a complete, non-empty state_ids set.
837
- Setting replaces that asset's whole set; values are stored in lexical ID order.
838
-
839
- Script v3
840
-
841
- Usage
842
- - scriptctl scene-ref <ep/scn> <kind:id> --state <state_id> # upsert ref + set state
843
- - scriptctl scene-ref <ep/scn> actor:<id> --state <state_id> --append # append another ref for the same actor
844
- - scriptctl scene-ref <ep/scn> actor:<id> --state <state_id> --occurrence <n> # update the nth matching ref (1-based)
845
- - scriptctl scene-ref <ep/scn> <kind:id> --state none # repair intermediate: upsert ref, no state
846
- - scriptctl scene-ref <ep/scn> <kind:id> --clear [--occurrence <n>] # keep ref, clear state
847
- - scriptctl scene-ref <ep/scn> <kind:id> --remove [--occurrence <n>] # remove ref
848
-
849
- kind is actor / location / prop. Actor refs may repeat; use --append to add another and --occurrence when a target repeats. Location is single-valued per scene (set replaces).
850
- Exactly one of --state / --clear / --remove must be passed.
851
- New body insertion is blocked while any scene asset ref has no materialized state.
852
-
853
- Examples
854
- - scriptctl scene-ref ep_001/scn_001 actor:act_001 --state st_calm
855
- - scriptctl scene-ref ep_001/scn_001 actor:act_001 --state st_injured --append
856
- - scriptctl scene-ref ep_001/scn_001 actor:act_001 --remove --occurrence 2
857
- - scriptctl scene-ref ep_001/scn_001 location:loc_003 --state default
858
- - scriptctl scene-ref ep_001/scn_001 actor:act_001 --remove
859
- `,
860
- ],
861
- // =========================================================================
862
- // Edit verbs — asset metadata
863
- // =========================================================================
864
- [
865
- ["rename"],
866
- `Rename an asset (actor / location / prop) or a state. Dispatches by address kind.
867
-
868
- Usage
869
- - v4: scriptctl rename <asset-id> <new_name>
870
- - v4: scriptctl rename <asset-id/state-id> <new_name>
871
- - v3: scriptctl rename <kind:id[/state_id]> <new_name>
872
-
873
- Examples
874
- - scriptctl rename actA3kP9x "陈墨"
875
- - scriptctl rename actA3kP9x/stB4xR8p "平静(新)"
876
- `,
877
- ],
878
- [
879
- ["describe"],
880
- `Set the description on an asset or a state (address with /state_id).
881
-
882
- Usage
883
- - scriptctl describe <kind:id> <text> # asset description
884
- - scriptctl describe <kind:id/state_id> <text> # state description
885
-
886
- Examples
887
- - scriptctl describe actor:act_001 "男主,30 岁,雷厉风行"
888
- - scriptctl describe actor:act_001/st_calm "默认形态:平静"
889
- `,
890
- ],
891
- [
892
- ["alias"],
893
- `Add or remove aliases on an asset.
894
-
895
- Usage
896
- - scriptctl alias <kind:id> [--add <alias>] [--remove <alias>]
897
-
898
- Either --add or --remove (or both, repeatable) must be provided.
899
-
900
- Examples
901
- - scriptctl alias actor:act_001 --add "陈总"
902
- - scriptctl alias actor:act_001 --add "陈总" --add "老板"
903
- - scriptctl alias actor:act_001 --remove "老板"
904
- `,
905
- ],
906
- [
907
- ["role"],
908
- `Set an actor's role_type.
909
-
910
- Usage
911
- - scriptctl role <actor:id> <主角|配角>
912
-
913
- Only valid on actor:* addresses.
914
-
915
- Example
916
- - scriptctl role actor:act_001 主角
917
- `,
918
- ],
919
- [
920
- ["importance"],
921
- `Set an asset's importance tier. featured = 主角/配角 (downstream gets a render
922
- asset + state tracking); background = 龙套/背景 (skipped downstream).
923
-
924
- Usage
925
- - scriptctl importance <kind:id> <featured|background>
926
-
927
- Valid on actor / location / prop addresses.
928
-
929
- Examples
930
- - scriptctl importance actor:act_002 background
931
- - scriptctl importance location:loc_001 featured
932
- `,
933
- ],
934
- [
935
- ["worldview"],
936
- `Set the script-level worldview (story setting / time period).
937
-
938
- Usage
939
- - scriptctl worldview <value>
940
-
941
- Value must match the supported enum (see SCRIPT_SCHEMA worldview values).
942
-
943
- Example
944
- - scriptctl worldview 现代
945
- `,
946
- ],
947
- [
948
- ["synopsis"],
949
- `Set the whole-script synopsis or one episode's synopsis.
950
-
951
- Usage
952
- - scriptctl synopsis <text> # set script.synopsis
953
- - scriptctl synopsis <episode-id> <text> # set episode.synopsis
954
- - scriptctl synopsis generate --apply # generate missing synopsis fields
955
-
956
- Patch ops
957
- - meta.synopsis.set
958
- - episode.synopsis.set
959
-
960
- Examples
961
- - scriptctl synopsis "陈墨归国复仇,与苏晴重逢,围绕林氏集团的阴谋逐步展开。"
962
- - scriptctl synopsis ep_001 "陈墨第一时间来到总裁办公室,与苏晴重逢。"
963
- `,
964
- ],
965
- [
966
- ["synopsis", "generate"],
967
- `Generate missing episode and whole-script synopsis fields from script.json.
968
-
969
- Usage
970
- - scriptctl synopsis generate --script-path output/script.json
971
- - scriptctl synopsis generate --script-path output/script.json --apply
972
- - scriptctl synopsis generate --script-path output/script.json --overwrite --apply
973
-
974
- Behavior
975
- - Default is dry-run: runs extraction and validation but does not write.
976
- - Without --overwrite, existing episode synopsis fields are reused and only missing
977
- fields are filled.
978
- - Whole-script fields are generated when any of synopsis/theme/logline/style/main_characters
979
- is missing; --overwrite regenerates them.
980
- - Uses a text-output contract and parser, not tool_use.
981
-
982
- Options
983
- - --llm-config <path> task/model routing YAML; built-in route uses the grok gateway
984
- - --concurrency <n> parallel chunk extraction, default 30
985
- - --checkpoint <dir> checkpoint directory, default workspace direct loom dir
986
- - --overwrite regenerate existing synopsis fields
987
- - --apply write script.json
988
- `,
989
- ],
990
- [
991
- ["extend"],
992
- `Attach a free-form extend{} namespace (arbitrary key→value) to any node.
993
- A dual-mode verb: with a key it writes, without a key it reads.
994
-
995
- The extend{} container is isolated from the known schema fields and survives
996
- validation untouched — use it for production metadata the schema has no slot for
997
- (camera notes, reference URLs, localization flags, runtime, ad-hoc tags).
998
-
999
- Addresses
1000
- - global script top level
1001
- - v4 bare episode / scene / Action / asset ID
1002
- - v4 asset-id/state-id
1003
- - v3 existing episode / scene / action / asset / state address
1004
-
1005
- Usage
1006
- - scriptctl extend <addr> <key> <value> # write a string
1007
- - scriptctl extend <addr> <key> <value> --json-value # parse value as JSON (number/bool/object/array)
1008
- - scriptctl extend <addr> <key> --clear # delete one key
1009
- - scriptctl extend <addr> --clear # wipe the whole container
1010
- - scriptctl extend <addr> # read: list the node's extend keys
1011
-
1012
- Notes
1013
- - The value-parsing flag is --json-value (NOT --json: that is the global
1014
- output-mode flag and is consumed before this command sees it).
1015
- - key is a FLAT name; dots (a.b.c) are literal, NOT a path. For nested structure
1016
- pass an object via --json-value.
1017
- - Deleting a missing key / clearing an absent container is a no-op (no error).
1018
- - An emptied container is removed entirely (no "extend": {} left behind).
1019
-
1020
- Examples
1021
- - scriptctl extend global art_style cyberpunk
1022
- - scriptctl extend scnK6wT3c mood '{"tone":"tense","lit":"neon"}' --json-value
1023
- - scriptctl extend acR8cV4n camera "low angle, slow push-in"
1024
- - scriptctl extend actA3kP9x reference_url https://example.com/ref.png
1025
- `,
1026
- ],
1027
- // =========================================================================
1028
- // Edit verbs — state management
1029
- // =========================================================================
1030
- [
1031
- ["state-add"],
1032
- `Add a state to an asset's states[].
1033
-
1034
- Usage
1035
- - scriptctl state-add <asset-address> <state_name> [--description <text>] [--state-id <id>]
1036
-
1037
- Required
1038
- - <kind:id> Asset target.
1039
- - <state_name> Human-readable state name (must be unique within the asset).
1040
-
1041
- Options
1042
- - --description Optional description.
1043
- - --state-id Optional explicit id. V4 otherwise generates st + six Base58 characters.
1044
-
1045
- Examples
1046
- - scriptctl state-add actor:act_001 "震惊"
1047
- - scriptctl state-add actor:act_001 "震惊" --description "瞠目结舌" --state-id st_shock
1048
- `,
1049
- ],
1050
- [
1051
- ["state-rename"],
1052
- `Rename a state on an asset.
1053
-
1054
- Usage
1055
- - scriptctl state-rename <state-address> <new_name>
1056
-
1057
- Example
1058
- - scriptctl state-rename actor:act_001/st_calm "平静(新)"
1059
- `,
1060
- ],
1061
- [
1062
- ["state-delete"],
1063
- `Delete a state from an asset's states[]. Refs are handled via --strategy.
1064
-
1065
- Usage
1066
- - scriptctl state-delete <kind:id/state_id> --strategy <replace|remove> [--replacement <state_id>]
1067
-
1068
- Strategy
1069
- - replace --replacement <state_id> Rewrite all refs to the replacement state, then delete.
1070
- - remove Remove the state from references. V4 refuses the
1071
- operation if any scene state set would become empty.
1072
-
1073
- Examples
1074
- - scriptctl state-delete actor:act_001/st_calm --strategy remove
1075
- - scriptctl state-delete actor:act_001/st_calm --strategy replace --replacement actor:act_001/st_default
1076
- `,
1077
- ],
1078
- // =========================================================================
1079
- // Edit verbs — dialogue / speaker
1080
- // =========================================================================
1081
- [
1082
- ["dialogue"],
1083
- `Set a dialogue or inner-thought line's inline speaker.
1084
-
1085
- Usage
1086
- - scriptctl dialogue <at> --actor <actor_id> # an actor speaks
1087
- - scriptctl dialogue <at> --kind <system|broadcast|offscreen|group> [--label <text>]
1088
-
1089
- Pass exactly one of --actor or --kind. In v4 the Action must already be speaking;
1090
- an actor and optional state must belong to the current scene reference.
1091
-
1092
- Examples
1093
- - scriptctl dialogue ep_001/scn_001#3 --actor act_001
1094
- - scriptctl dialogue ep_001/scn_001#3 --kind broadcast --label 广播
1095
- `,
1096
- ],
1097
- // =========================================================================
1098
- // Patch (batch transactions)
1099
- // =========================================================================
1100
- [
1101
- ["patch"],
1102
- `Apply a batch JSON patch to the current script. Use ONLY for >=3 ops in one transaction;
1103
- single-op edits should use the corresponding atomic verb (replace / type / delete / rename /
1104
- state-add / etc.).
1105
-
1106
- Usage
1107
- - scriptctl patch <file> [options]
1108
-
1109
- Required
1110
- - <file> JSON patch file. Top-level may be:
1111
- an array of ops, or
1112
- { "ops": [...] }, or
1113
- { "operations": [...] }, or
1114
- a single op object.
1115
-
1116
- Op names use dot-style only (state.add / action.delete / asset.rename / etc.).
1117
- The 0.5.0 snake-style ops (set_worldview, rename_actor, merge_scenes, ...) were removed.
1118
- Use \`scriptctl patch --schema\` to see every supported op + its required fields.
1119
-
1120
- Options
1121
- - --schema [<op>] Dump op schema (JSON) instead of applying. With <op>, dump just that op.
1122
- - --dry-run Script v3: apply to memory and validate without writing.
1123
- - --apply Script v4: apply a previously reviewed plan.
1124
- - --plan <digest> Script v4: exact digest returned by the dry-run.
1125
- - --script-path / --json / --help
1126
-
1127
- Examples
1128
- - scriptctl patch changes.json # V4 dry-run plan
1129
- - scriptctl patch changes.json --apply --plan sha256:... # V4 apply
1130
- - scriptctl patch changes.json --dry-run # V3 dry-run
1131
- - scriptctl patch --schema
1132
- - scriptctl patch --schema asset.rename
1133
- `,
1134
- ],
1135
- ];
1136
- function keyOf(command) {
1137
- return command.join("");
1138
- }
1139
- const HELP_MAP = new Map(HELP_ENTRIES.map(([cmd, text]) => [keyOf(cmd), text]));
1140
- export function getHelp(command) {
1141
- return HELP_MAP.get(keyOf(command));
1142
- }
1143
- export const HELP = HELP_MAP;
1144
- //# sourceMappingURL=help-text.js.map