@lingjingai/scriptctl 0.5.0 → 0.6.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.
package/dist/help-text.js CHANGED
@@ -1,32 +1,74 @@
1
1
  const HELP_ENTRIES = [
2
2
  [
3
3
  [],
4
- `scriptctl controls script-stage deterministic tools.
4
+ `scriptctl 剧本阶段统一 CLI(0.6.0 扁平 namespace)
5
5
 
6
6
  Usage
7
- - scriptctl direct <command> [options]
8
- - scriptctl script <command> [options]
9
- - scriptctl episode <command> [options]
7
+ - scriptctl <verb> <address> [flags] # 编辑(多态 verb 按 address 格式分发)
8
+ - scriptctl <plural-noun> [flags] # 查询
9
+ - scriptctl direct <command> [flags] # 直转 workflow
10
+ - scriptctl write <command> [flags] # 逐集写作 workflow
10
11
 
11
- Commands
12
- - doctor Check CLI runtime, dependencies, env, and storage.
12
+ Workflow groups
13
13
  - direct init Build the initial direct-conversion script.
14
14
  - direct validate Validate the current initial script.
15
15
  - direct inspect Inspect episodes, assets, or issues.
16
16
  - direct export Store the final script through Gateway after validation.
17
- - script inspect Inspect the current final script.
18
- - script validate Validate the current final script.
19
- - script patch Apply a batch patch to the current final script.
20
- - script state Edit reusable asset states.
21
- - script context Edit scene initial state.
22
- - script action Edit action state changes and transition prompts.
23
- - script speaker Manage speakers.
24
- - script dialogue Edit multi-speaker dialogue.
25
- - episode init Scaffold workspace/episodes/ + a meta.json template + gateway env preflight.
26
- - episode draft Draft + lint + assemble-validate + auto-commit a single episode.
27
- - episode batch Draft a range of episodes in one go.
28
- - episode workspace List per-episode draft state in the \`episode\` from-scratch workspace.
29
- - episode publish Assemble all drafted episodes and upload to gateway (--dry-run available).
17
+ - write init Scaffold workspace/episodes/ + meta.json template.
18
+ - write draft <n> Draft + lint + assemble-validate + auto-commit a single episode.
19
+ - write batch Draft a range of episodes in one go.
20
+ - write workspace List per-episode draft state in the from-scratch workspace.
21
+ - write merge Local assembly: committed episodes → script.json + receipt.
22
+ - write push Upload the merge artifact to gateway.
23
+ - write spec Print the spec-md grammar.
24
+
25
+ Query (plural-noun)
26
+ - summary title + counts of episodes / scenes / actions / assets / speakers
27
+ - episodes per-episode line: scenes, actions, chars
28
+ - scenes per-scene line with asset names; filters: --in / --has-actor / --has-location / --has-prop
29
+ - actions per-action line; filters: --in / --grep / --type / --actor / --speaker / --has / --context
30
+ - actors / locations / props / assets / speakers asset queries (kind-scoped or unified)
31
+ - issues current validation issues
32
+ - refs <addr> reverse lookup: state / asset / speaker → reference sites
33
+ - validate Validate the current final script.
34
+
35
+ Edit content
36
+ - replace <at> --from X [--to X] [--all] literal substring replace in action.content
37
+ - type <at> <dialogue|action|inner_thought> action.type.set
38
+ - actor <at> <actor_id|none> action.actor.set
39
+
40
+ Edit structure (multipolar; address format dispatches)
41
+ - insert <addr> ... action.insert (ep/scn) or scene.insert (ep)
42
+ - delete <addr> [--strategy replace|remove] [--force] action / scene / asset / speaker
43
+ - move <addr> <to> [--at <idx>] action / scene
44
+ - split <ep/scn> --at <idx> split scene at action index
45
+ - merge <src> --into <dst> asset.merge or scene.merge
46
+
47
+ Edit asset metadata
48
+ - rename <addr> <name>
49
+ - describe <addr> <text> asset or state (addr with /state_id)
50
+ - alias <addr> [--add X --remove Y]
51
+ - role <actor:id> <主角|配角>
52
+ - worldview <value>
53
+
54
+ State / transition / context
55
+ - state-add <addr> <name> [--description X] [--state-id X]
56
+ - state-rename <addr> <name>
57
+ - state-delete <addr> --strategy <replace|remove> [--replacement X]
58
+ - state-change <at> <kind:id> --to <state> | --clear [--from X] [--effective X]
59
+ - transition <at> <kind:id> --process X --contrast Y | --clear
60
+ - context <ep/scn> <kind:id> --state X | --clear | --remove
61
+
62
+ Dialogue / speaker
63
+ - dialogue <at> --speakers id1,id2 [--delivery X]
64
+ - overlap <at> --line "spk:text" [--line ...]
65
+ - add-speaker --kind X --name Y [--source-id X] [--voice-desc X] [--speaker-id X]
66
+
67
+ Patch (batch transaction)
68
+ - patch <file> [--schema] [--dry-run] apply multi-op JSON; positional file
69
+
70
+ Doctor
71
+ - doctor Check CLI runtime, dependencies, env, and storage.
30
72
 
31
73
  Options
32
74
  - --json Print machine-readable JSON instead of agent text.
@@ -226,206 +268,7 @@ Exit codes
226
268
  `,
227
269
  ],
228
270
  [
229
- ["script"],
230
- `scriptctl script edits the current final script through Gateway.
231
-
232
- Usage
233
- - scriptctl script <command> [options]
234
-
235
- Commands
236
- - inspect Inspect the current final script.
237
- - validate Validate the current final script.
238
- - patch Apply a JSON patch file.
239
- - state Add, rename, describe, reference-check, or delete states.
240
- - context Set or clear scene initial state.
241
- - action Add/remove state changes and transition prompts.
242
- - speaker Add non-human or actor-linked speakers.
243
- - dialogue Set simultaneous or overlapping dialogue.
244
-
245
- Options
246
- - --project-group-no Project group no. Default: SANDBOX_PROJECT_GROUP_NO
247
- - --script-path Explicit local intermediate script JSON path. Omit to use DB-backed script-output.
248
- - --workspace-path Workspace directory for validation reports. Default: workspace
249
- - --request-id Write commands only: optional idempotency key.
250
- - --json Print machine-readable JSON.
251
- - --help Show help for a command.
252
- `,
253
- ],
254
- [
255
- ["script", "inspect"],
256
- `Inspect the current final script. Read-only.
257
-
258
- Usage
259
- - scriptctl script inspect [options]
260
-
261
- Targets
262
- - summary title + counts of episodes / scenes / actions / actors / locations / props / speakers
263
- - episode per-episode line: scenes, actions, chars (dialogue / action split), title
264
- - action per-action line: address + type + speaker + content. Requires --id or --grep.
265
- - asset actors / locations / props with state counts
266
- - speaker speakers with source kind and id
267
- - issue current validation issues
268
-
269
- Options
270
- - --project-group-no Project group no. Default: SANDBOX_PROJECT_GROUP_NO
271
- - --script-path Explicit local intermediate script JSON path. Omit to use DB-backed script-output.
272
- - --workspace-path Workspace directory. Default: workspace
273
- - --target One of: summary, episode, action, asset, speaker, issue. Default: summary
274
- - --id Item id filter. For target=episode: episode_id. For target=action:
275
- ep_001 (whole episode) / ep_001/scn_001 (whole scene) / ep_001/scn_001#3 (single action).
276
- For asset/speaker/issue: actor_id / speaker_id / issue code.
277
- - --grep (target=action only) Literal substring filter on action content / dialogue lines.
278
- - --min-chars (target=episode only) Only list episodes with total chars >= N.
279
- - --max-chars (target=episode only) Only list episodes with total chars <= N.
280
- - --json Print machine-readable JSON. Avoid unless you actually need to parse;
281
- the default agent-text output is shorter and more readable.
282
- - --help Show this help.
283
-
284
- Examples
285
- - "Which episodes exceed 1000 chars?"
286
- scriptctl script inspect --target episode --min-chars 1000
287
- - "Find the action that says 台下掌声雷动:"
288
- scriptctl script inspect --target action --grep "台下掌声雷动"
289
- - "Dump every action in episode 1:"
290
- scriptctl script inspect --target action --id ep_001
291
- `,
292
- ],
293
- [
294
- ["script", "validate"],
295
- `Validate the current final script.
296
-
297
- Usage
298
- - scriptctl script validate [options]
299
-
300
- Options
301
- - --project-group-no Project group no. Default: SANDBOX_PROJECT_GROUP_NO
302
- - --script-path Explicit local intermediate script JSON path. Omit to use DB-backed script-output.
303
- - --workspace-path Workspace directory. Default: workspace
304
- - --json Print machine-readable JSON.
305
- - --help Show this help.
306
- `,
307
- ],
308
- [
309
- ["script", "patch"],
310
- `Apply a batch patch to the current final script.
311
-
312
- Usage
313
- - scriptctl script patch --patch <patch.json> [options]
314
-
315
- Required
316
- - --patch JSON patch file with ops[] or operations[].
317
-
318
- Options
319
- - --project-group-no Project group no. Default: SANDBOX_PROJECT_GROUP_NO
320
- - --request-id Optional idempotency key for this write.
321
- - --script-path Explicit local intermediate script JSON path. Omit to use DB-backed script-output.
322
- - --workspace-path Workspace directory. Default: workspace
323
- - --json Print machine-readable JSON.
324
- - --help Show this help.
325
- `,
326
- ],
327
- [
328
- ["script", "state"],
329
- `Edit reusable asset states.
330
-
331
- Usage
332
- - scriptctl script state add <actor:act_001|location:loc_001|prop:prp_001> --name <name> [--description <text>] [--state-id <id>]
333
- - scriptctl script state rename <actor:act_001/st_001> --name <name>
334
- - scriptctl script state describe <actor:act_001/st_001> --description <text>
335
- - scriptctl script state refs <actor:act_001/st_001>
336
- - scriptctl script state delete-plan <actor:act_001/st_001>
337
- - scriptctl script state delete-apply <actor:act_001/st_001> --strategy <replace|remove> [--replacement <state_id>]
338
-
339
- Options
340
- - --project-group-no Project group no. Default: SANDBOX_PROJECT_GROUP_NO
341
- - --request-id Write commands only: optional idempotency key.
342
- - --script-path Explicit local intermediate script JSON path. Omit to use DB-backed script-output.
343
- - --workspace-path Workspace directory. Default: workspace
344
- - --json Print machine-readable JSON.
345
- - --help Show this help.
346
- `,
347
- ],
348
- [
349
- ["script", "context"],
350
- `Edit scene initial state.
351
-
352
- Usage
353
- - scriptctl script context set <ep_001/scn_001> <actor:act_001|location:loc_001|prop:prp_001> --state <state_id>
354
- - scriptctl script context clear <ep_001/scn_001> <actor:act_001|location:loc_001|prop:prp_001>
355
-
356
- Options
357
- - --project-group-no Project group no. Default: SANDBOX_PROJECT_GROUP_NO
358
- - --request-id Optional idempotency key for this write.
359
- - --script-path Explicit local intermediate script JSON path. Omit to use DB-backed script-output.
360
- - --workspace-path Workspace directory. Default: workspace
361
- - --json Print machine-readable JSON.
362
- - --help Show this help.
363
- `,
364
- ],
365
- [
366
- ["script", "action"],
367
- `Edit action state changes, transition prompts, and action content text.
368
-
369
- Usage
370
- - scriptctl script action state-change <ep_001/scn_001#4> <actor:act_001|location:loc_001|prop:prp_001> --to <state_id> [--from <state_id>] [--effective <after|before>]
371
- - scriptctl script action state-remove <ep_001/scn_001#4> <actor:act_001|location:loc_001|prop:prp_001>
372
- - scriptctl script action transition-set <ep_001/scn_001#4> <actor:act_001|location:loc_001|prop:prp_001> --process <text> --contrast <text>
373
- - scriptctl script action transition-clear <ep_001/scn_001#4> <actor:act_001|location:loc_001|prop:prp_001>
374
- - scriptctl script action content-replace <ep_001/scn_001#4> --from <text> [--to <text>] [--all]
375
-
376
- Options
377
- - --project-group-no Project group no. Default: SANDBOX_PROJECT_GROUP_NO
378
- - --request-id Optional idempotency key for this write.
379
- - --script-path Explicit local intermediate script JSON path. Omit to use DB-backed script-output.
380
- - --workspace-path Workspace directory. Default: workspace
381
- - --json Print machine-readable JSON.
382
- - --help Show this help.
383
-
384
- content-replace
385
- - Literal substring replace inside action.content. Refuses ambiguous matches
386
- (substring appears more than once) unless --all is passed. Refuses overlap
387
- dialogue actions — use \`script dialogue overlap\` to rewrite their lines.
388
- - --from is required and must be non-empty. --to defaults to "" (delete).
389
- - Example: delete a trailing clause that no longer fits the scene:
390
- scriptctl script action content-replace ep_001/scn_001#3 --from ",台下掌声雷动" --to ""
391
- `,
392
- ],
393
- [
394
- ["script", "speaker"],
395
- `Manage speakers.
396
-
397
- Usage
398
- - scriptctl script speaker add --kind <actor|location|prop|system|broadcast|group|other> --name <display_name> [--source-id <id>] [--voice-desc <text>]
399
-
400
- Options
401
- - --project-group-no Project group no. Default: SANDBOX_PROJECT_GROUP_NO
402
- - --request-id Optional idempotency key for this write.
403
- - --script-path Explicit local intermediate script JSON path. Omit to use DB-backed script-output.
404
- - --workspace-path Workspace directory. Default: workspace
405
- - --speaker-id Optional explicit speaker_id.
406
- - --json Print machine-readable JSON.
407
- - --help Show this help.
408
- `,
409
- ],
410
- [
411
- ["script", "dialogue"],
412
- `Edit multi-speaker dialogue.
413
-
414
- Usage
415
- - scriptctl script dialogue speakers <ep_001/scn_001#5> --speaker <speaker_id> [--speaker <speaker_id>...] --delivery <single|simultaneous|group>
416
- - scriptctl script dialogue overlap <ep_001/scn_001#6> --line <speaker_id:content> [--line <speaker_id:content>...]
417
-
418
- Options
419
- - --project-group-no Project group no. Default: SANDBOX_PROJECT_GROUP_NO
420
- - --request-id Optional idempotency key for this write.
421
- - --script-path Explicit local intermediate script JSON path. Omit to use DB-backed script-output.
422
- - --workspace-path Workspace directory. Default: workspace
423
- - --json Print machine-readable JSON.
424
- - --help Show this help.
425
- `,
426
- ],
427
- [
428
- ["episode"],
271
+ ["write"],
429
272
  `scriptctl episode drives per-episode incremental script production for the creative
430
273
  mainline (灵感线 / 小说线 / 原创线). The full per-project loop:
431
274
 
@@ -480,7 +323,7 @@ merge (after any source edit) then push.
480
323
  `,
481
324
  ],
482
325
  [
483
- ["episode", "init"],
326
+ ["write", "init"],
484
327
  `Scaffold the episode workspace. Creates <workspace>/episodes/ and writes a
485
328
  meta.json template with TODO placeholders for title / worldview / style.
486
329
 
@@ -499,7 +342,7 @@ Exit code: 0 always (skipped or written).
499
342
  `,
500
343
  ],
501
344
  [
502
- ["episode", "draft"],
345
+ ["write", "draft"],
503
346
  `Draft + lint + assemble-validate + auto-commit episode <n> in one command.
504
347
 
505
348
  The full pipeline for one episode:
@@ -576,7 +419,7 @@ Exit codes
576
419
  `,
577
420
  ],
578
421
  [
579
- ["episode", "batch"],
422
+ ["write", "batch"],
580
423
  `Batch-draft an inclusive range of episodes.
581
424
 
582
425
  Usage
@@ -601,7 +444,7 @@ Output
601
444
  `,
602
445
  ],
603
446
  [
604
- ["episode", "merge"],
447
+ ["write", "merge"],
605
448
  `Assemble all committed episodes (those with .done-<NN> markers) + episodes/meta.json
606
449
  into a single script.json, run schema validation, and persist locally for review.
607
450
  NO network — gateway upload is the separate "episode push" command.
@@ -648,7 +491,7 @@ Exit codes
648
491
  `,
649
492
  ],
650
493
  [
651
- ["episode", "push"],
494
+ ["write", "push"],
652
495
  `Upload the most recent \`episode merge\` artifact to the script-output gateway.
653
496
  Pure uploader — does not assemble or validate (merge already did). Refuses to
654
497
  upload if the artifact / inputs drifted since merge.
@@ -690,7 +533,7 @@ Exit codes
690
533
  `,
691
534
  ],
692
535
  [
693
- ["episode", "spec"],
536
+ ["write", "spec"],
694
537
  `Print the spec-md grammar scriptctl's parser accepts. \`episode draft\` (Gemini)
695
538
  auto-injects this into the writing prompt; this command exposes the same string
696
539
  for agents writing spec md by hand (for \`episode draft --from-md\` / \`--resume\`).
@@ -713,7 +556,7 @@ Exit codes
713
556
  `,
714
557
  ],
715
558
  [
716
- ["episode", "workspace"],
559
+ ["write", "workspace"],
717
560
  `Report per-episode draft state inside the \`episode\` from-scratch workspace.
718
561
 
719
562
  This is a workspace-area introspection command. It only knows about files under
@@ -734,6 +577,661 @@ States
734
577
  - blocked-collision collision report exists; agent must resolve
735
578
  - blocked-lint lint critical report exists; agent must resolve
736
579
  - committed .done-<NN> marker exists
580
+ `,
581
+ ],
582
+ // =========================================================================
583
+ // 0.6.0 flat namespace — plural-noun queries
584
+ // =========================================================================
585
+ [
586
+ ["summary"],
587
+ `Show title and counts (episodes / scenes / actions / actors / locations / props / speakers).
588
+
589
+ Usage
590
+ - scriptctl summary [options]
591
+
592
+ Options
593
+ - --project-group-no Project group no. Default: SANDBOX_PROJECT_GROUP_NO
594
+ - --script-path Local intermediate script JSON. Omit to use DB-backed script.
595
+ - --workspace-path Workspace directory. Default: workspace
596
+ - --json Print machine-readable JSON. Avoid unless parsing.
597
+ - --help Show this help.
598
+
599
+ Read-only. Always safe to run.
600
+ `,
601
+ ],
602
+ [
603
+ ["episodes"],
604
+ `List episodes with per-episode counts and char totals.
605
+
606
+ Usage
607
+ - scriptctl episodes [options]
608
+
609
+ Options
610
+ - --id <ep_id> Filter to one episode.
611
+ - --min-chars <n> Only episodes with total chars >= N.
612
+ - --max-chars <n> Only episodes with total chars <= N.
613
+ - --project-group-no / --script-path / --workspace-path / --json / --help
614
+
615
+ Output line
616
+ - ep_NNN: scenes=N, actions=N, chars=N (dialogue=N, action=N), title=...
617
+
618
+ Examples
619
+ - scriptctl episodes
620
+ - scriptctl episodes --min-chars 1000
621
+ - scriptctl episodes --id ep_007
622
+ `,
623
+ ],
624
+ [
625
+ ["scenes"],
626
+ `List scenes with their environment, asset refs, and action counts.
627
+
628
+ Usage
629
+ - scriptctl scenes [options]
630
+
631
+ Options
632
+ - --in <addr> Scope to ep_NNN (episode) or ep_NNN/scn_NNN (single scene).
633
+ - --has-actor <id> Only scenes whose context references this actor.
634
+ - --has-location <id> Only scenes whose context references this location.
635
+ - --has-prop <id> Only scenes whose context references this prop.
636
+ - --project-group-no / --script-path / --workspace-path / --json / --help
637
+
638
+ Output line
639
+ - ep_NNN/scn_NNN [space time] location=loc_NNN(name) actors=... props=... actions=N
640
+
641
+ Examples
642
+ - scriptctl scenes --in ep_007
643
+ - scriptctl scenes --has-actor act_001
644
+ - scriptctl scenes --in ep_001/scn_001
645
+ `,
646
+ ],
647
+ [
648
+ ["actions"],
649
+ `Search actions across the script (the workhorse for "find where to edit").
650
+
651
+ Usage
652
+ - scriptctl actions [options]
653
+
654
+ Options
655
+ - --in <addr> Scope to ep_NNN / ep_NNN/scn_NNN / ep_NNN/scn_NNN#idx.
656
+ - --grep <text> Literal substring (default) or /regex/flags. Matches action.content + lines[].content.
657
+ - --type <type> dialogue | inner_thought | action.
658
+ - --actor <id> Actions where this actor speaks (resolves speaker→actor) or is action.actor_id.
659
+ - --speaker <id> Actions where this speaker appears.
660
+ - --has <kind> state-changes | transition | lines (filter by structural feature).
661
+ - --context <n> Include N actions before/after each hit (for context windows).
662
+ - --project-group-no / --script-path / --workspace-path / --json / --help
663
+
664
+ Requires at least one of: --in, --grep, --type, --actor, --speaker, --has. Bare \`scriptctl actions\`
665
+ errors out — dumping every action across all episodes is too large.
666
+
667
+ Output line
668
+ - ep_NNN/scn_NNN#idx [type] [speaker|actor] content
669
+
670
+ Examples
671
+ - scriptctl actions --grep "台下掌声雷动"
672
+ - scriptctl actions --in ep_001 --type dialogue
673
+ - scriptctl actions --grep "金碧辉煌" --context 2
674
+ - scriptctl actions --actor act_001 --has state-changes
675
+ `,
676
+ ],
677
+ [
678
+ ["actors"],
679
+ `List actors with role / aliases / state counts.
680
+
681
+ Usage
682
+ - scriptctl actors [options]
683
+
684
+ Options
685
+ - --id <actor_id> Filter to one actor.
686
+ - --name <substr> Match name substring (case-sensitive).
687
+ - --in <addr> Restrict to actors referenced under this address (ep/scn/action).
688
+ - --project-group-no / --script-path / --workspace-path / --json / --help
689
+
690
+ Examples
691
+ - scriptctl actors --name "陈"
692
+ - scriptctl actors --in ep_023
693
+ - scriptctl actors --in ep_001/scn_001
694
+ `,
695
+ ],
696
+ [
697
+ ["locations"],
698
+ `List locations with state counts.
699
+
700
+ Usage
701
+ - scriptctl locations [options]
702
+
703
+ Options mirror \`scriptctl actors\`: --id, --name, --in, --project-group-no, etc.
704
+
705
+ Examples
706
+ - scriptctl locations --name "办公室"
707
+ - scriptctl locations --in ep_007
708
+ `,
709
+ ],
710
+ [
711
+ ["props"],
712
+ `List props with state counts.
713
+
714
+ Usage
715
+ - scriptctl props [options]
716
+
717
+ Options mirror \`scriptctl actors\`: --id, --name, --in, --project-group-no, etc.
718
+
719
+ Examples
720
+ - scriptctl props --name "公文包"
721
+ - scriptctl props --in ep_001/scn_001
722
+ `,
723
+ ],
724
+ [
725
+ ["assets"],
726
+ `Unified search across actor / location / prop. Use when you don't care which kind.
727
+
728
+ Usage
729
+ - scriptctl assets [options]
730
+
731
+ Options
732
+ - --kind <actor|location|prop> Narrow to one kind.
733
+ - --id <id> Filter by id.
734
+ - --name <substr> Match name substring.
735
+ - --in <addr> Restrict to assets referenced under this address.
736
+ - --project-group-no / --script-path / --workspace-path / --json / --help
737
+
738
+ Examples
739
+ - scriptctl assets --name "陈"
740
+ - scriptctl assets --kind actor --name "陈"
741
+ `,
742
+ ],
743
+ [
744
+ ["speakers"],
745
+ `List speakers with source kind / source id.
746
+
747
+ Usage
748
+ - scriptctl speakers [options]
749
+
750
+ Options
751
+ - --id <speaker_id> Filter to one speaker.
752
+ - --name <substr> Match display_name substring.
753
+ - --kind <kind> Filter by source_kind (actor / location / prop / system / broadcast / group / other).
754
+ - --project-group-no / --script-path / --workspace-path / --json / --help
755
+
756
+ Examples
757
+ - scriptctl speakers --kind system
758
+ - scriptctl speakers --name "陈"
759
+ `,
760
+ ],
761
+ [
762
+ ["issues"],
763
+ `List current validation issues. Runs validateScript on demand.
764
+
765
+ Usage
766
+ - scriptctl issues [options]
767
+
768
+ Options
769
+ - --severity <severity> Filter by severity (error / warning / info / blocking).
770
+ - --code <code> Filter by issue code (e.g. STATE_NOT_FOUND).
771
+ - --project-group-no / --script-path / --workspace-path / --json / --help
772
+
773
+ Output line
774
+ - <severity> <code>: <summary> [<location>]
775
+
776
+ Examples
777
+ - scriptctl issues --severity error
778
+ - scriptctl issues --code STATE_NOT_FOUND
779
+ `,
780
+ ],
781
+ [
782
+ ["refs"],
783
+ `Reverse lookup: every place an asset / state / speaker is referenced.
784
+
785
+ Usage
786
+ - scriptctl refs <addr> [options]
787
+
788
+ Address forms
789
+ - actor:<id> / location:<id> / prop:<id> asset refs
790
+ - actor:<id>/<state_id> (and location/prop) state refs
791
+ - spk_<id> speaker refs
792
+
793
+ Options
794
+ - --level <scene|action> Restrict to scene-level or action-level refs only.
795
+ - --project-group-no / --script-path / --workspace-path / --json / --help
796
+
797
+ Output line
798
+ - <location> [<role>] (e.g. ep_001/scn_001#3.actor_id [action_actor])
799
+
800
+ Examples
801
+ - scriptctl refs actor:act_001
802
+ - scriptctl refs actor:act_001 --level scene
803
+ - scriptctl refs actor:act_001/st_calm
804
+ - scriptctl refs spk_001
805
+ `,
806
+ ],
807
+ [
808
+ ["validate"],
809
+ `Validate the current final script. Read-only side; writes a validation report to workspace.
810
+
811
+ Usage
812
+ - scriptctl validate [options]
813
+
814
+ Options
815
+ - --project-group-no / --script-path / --workspace-path / --json / --help
816
+
817
+ Exit codes
818
+ - 0 passed
819
+ - 78 validation needs repair (see scriptctl issues)
820
+ `,
821
+ ],
822
+ // =========================================================================
823
+ // Edit verbs — content
824
+ // =========================================================================
825
+ [
826
+ ["replace"],
827
+ `Literal substring replace inside action.content.
828
+
829
+ Usage
830
+ - scriptctl replace <at> --from <text> [--to <text>] [--all] [options]
831
+
832
+ Required
833
+ - <at> Action address: ep_NNN/scn_NNN#idx
834
+ - --from Non-empty substring to replace.
835
+
836
+ Options
837
+ - --to Replacement text. Default: "" (delete the substring).
838
+ - --all Replace every occurrence in the action. Without it, multiple matches reject.
839
+ - --project-group-no / --script-path / --workspace-path / --request-id / --json / --help
840
+
841
+ Refuses overlap dialogue actions — use \`scriptctl overlap\` to rewrite their lines.
842
+
843
+ Example
844
+ - scriptctl replace ep_001/scn_001#3 --from ",台下掌声雷动" --to ""
845
+ `,
846
+ ],
847
+ [
848
+ ["type"],
849
+ `Set the action.type on a specific action.
850
+
851
+ Usage
852
+ - scriptctl type <at> <dialogue|action|inner_thought>
853
+
854
+ Example
855
+ - scriptctl type ep_001/scn_001#3 dialogue
856
+ `,
857
+ ],
858
+ [
859
+ ["actor"],
860
+ `Set or clear action.actor_id (the action's narrative subject).
861
+
862
+ Usage
863
+ - scriptctl actor <at> <actor_id|none>
864
+
865
+ Example
866
+ - scriptctl actor ep_001/scn_001#3 act_002
867
+ - scriptctl actor ep_001/scn_001#3 none
868
+ `,
869
+ ],
870
+ // =========================================================================
871
+ // Edit verbs — structure (multipolar by first-arg address format)
872
+ // =========================================================================
873
+ [
874
+ ["insert"],
875
+ `Insert an action (into a scene) or a brand-new empty scene (into an episode).
876
+
877
+ Usage
878
+ - scriptctl insert <ep/scn> --type <type> --content <text> [position-flags] [options] # action insert
879
+ - scriptctl insert <ep> --location <loc_id> [position-flags] [options] # scene insert
880
+
881
+ Action insert (first arg is ep/scn)
882
+ - --type dialogue / action / inner_thought.
883
+ - --content Action content text.
884
+ - --actor <id> Optional action.actor_id.
885
+ - --speaker <id> Optional action.speaker_id.
886
+
887
+ Scene insert (first arg is ep)
888
+ - --location <id> Required: the scene's primary location.
889
+ - --time <time> Default: day.
890
+ - --space <space> Default: interior.
891
+ - --scene-id <id> Optional explicit scene id (auto-assigned otherwise).
892
+
893
+ Position (both forms)
894
+ - --at <idx> Numeric index in the parent collection.
895
+ - --before <addr> Insert before this sibling.
896
+ - --after <addr> Insert after this sibling.
897
+ - Default Append at end.
898
+
899
+ Examples
900
+ - scriptctl insert ep_001/scn_001 --type action --content "..." --after ep_001/scn_001#3
901
+ - scriptctl insert ep_001 --after ep_001/scn_005 --location loc_001
902
+ `,
903
+ ],
904
+ [
905
+ ["delete"],
906
+ `Delete an action, scene, asset, or speaker. Multipolar by address format.
907
+
908
+ Usage
909
+ - scriptctl delete <addr> [--strategy replace|remove] [--replacement <addr>] [--force]
910
+
911
+ Behavior by address kind
912
+ - action (ep/scn#idx) Remove the action; later indices shift.
913
+ - scene (ep/scn) Empty scene: removed. Non-empty: refused unless --force.
914
+ - asset (kind:id) Refuses by default if refs exist. Pass --strategy:
915
+ replace --replacement <addr>: rewrite all refs to the replacement, then delete.
916
+ remove: scrub refs and delete (refs become dangling).
917
+ - speaker (spk_id) Same --strategy logic as asset.
918
+
919
+ Examples
920
+ - scriptctl delete ep_001/scn_001#3
921
+ - scriptctl delete ep_001/scn_005 --force
922
+ - scriptctl delete actor:act_001 --strategy replace --replacement actor:act_002
923
+ - scriptctl delete spk_001 --strategy remove
924
+ `,
925
+ ],
926
+ [
927
+ ["move"],
928
+ `Move an action across actions / scenes, or move a scene across episodes.
929
+
930
+ Usage
931
+ - scriptctl move <addr> <to> [--at <idx>]
932
+
933
+ Behavior by source address kind
934
+ - action (ep/scn#idx) <to> is target action address; insertion is "before that index".
935
+ - scene (ep/scn) <to> is target episode id (or ep/scn for insert-before-anchor);
936
+ --at <idx> overrides position; default: append at end.
937
+
938
+ Examples
939
+ - scriptctl move ep_001/scn_001#5 ep_001/scn_002#0 # cross-scene
940
+ - scriptctl move ep_001/scn_005 ep_002 # cross-episode
941
+ - scriptctl move ep_001/scn_005 ep_002 --at 0 # to ep_002 start
942
+ `,
943
+ ],
944
+ [
945
+ ["split"],
946
+ `Split a scene at an action boundary into two sibling scenes.
947
+
948
+ Usage
949
+ - scriptctl split <ep/scn> --at <idx> [--new-scene-id <id>]
950
+
951
+ Required
952
+ - <ep/scn> Scene to split.
953
+ - --at Action index (1 <= idx < action count).
954
+
955
+ Options
956
+ - --new-scene-id Optional explicit id for the new tail scene.
957
+
958
+ Example
959
+ - scriptctl split ep_001/scn_005 --at 7
960
+ `,
961
+ ],
962
+ [
963
+ ["merge"],
964
+ `Merge one asset / scene into another. Source disappears; refs are rewritten to the target.
965
+
966
+ Usage
967
+ - scriptctl merge <src> --into <dst>
968
+
969
+ Both addresses must be the same kind (asset/asset same kind, or scene/scene same episode).
970
+
971
+ Examples
972
+ - scriptctl merge actor:act_001 --into actor:act_002
973
+ - scriptctl merge ep_001/scn_005 --into ep_001/scn_006
974
+ `,
975
+ ],
976
+ // =========================================================================
977
+ // Edit verbs — state / transition / context on actions+scenes
978
+ // =========================================================================
979
+ [
980
+ ["state-change"],
981
+ `Add or clear a state_change on a specific action.
982
+
983
+ Usage
984
+ - scriptctl state-change <at> <kind:id> --to <state_id> [--from <state_id>] [--effective <after|before>]
985
+ - scriptctl state-change <at> <kind:id> --clear
986
+
987
+ Required
988
+ - <at> Action address.
989
+ - <kind:id> Asset target (actor/location/prop).
990
+
991
+ Options
992
+ - --to Target state_id. Required unless --clear.
993
+ - --from Optional explicit from-state. Otherwise inferred from prior scene context.
994
+ - --effective after (default) or before.
995
+ - --clear Remove the existing state_change for this target on this action.
996
+
997
+ Examples
998
+ - scriptctl state-change ep_001/scn_001#3 actor:act_001 --to st_shock
999
+ - scriptctl state-change ep_001/scn_001#3 actor:act_001 --clear
1000
+ `,
1001
+ ],
1002
+ [
1003
+ ["transition"],
1004
+ `Set or clear an action.transition_prompt (process + contrast for visual generation).
1005
+
1006
+ Usage
1007
+ - scriptctl transition <at> <kind:id> --process <text> --contrast <text>
1008
+ - scriptctl transition <at> <kind:id> --clear
1009
+
1010
+ Examples
1011
+ - scriptctl transition ep_001/scn_001#3 actor:act_001 --process "深呼吸三秒" --contrast "由静转动"
1012
+ - scriptctl transition ep_001/scn_001#3 actor:act_001 --clear
1013
+ `,
1014
+ ],
1015
+ [
1016
+ ["context"],
1017
+ `Manage a scene's context.{actors|locations|props} ref.
1018
+
1019
+ Usage
1020
+ - scriptctl context <ep/scn> <kind:id> --state <state_id> # upsert ref + set state
1021
+ - scriptctl context <ep/scn> <kind:id> --state none # upsert ref, no state
1022
+ - scriptctl context <ep/scn> <kind:id> --clear # keep ref, clear state
1023
+ - scriptctl context <ep/scn> <kind:id> --remove # remove ref entirely
1024
+
1025
+ Exactly one of --state / --clear / --remove must be passed.
1026
+
1027
+ Examples
1028
+ - scriptctl context ep_001/scn_001 actor:act_001 --state st_calm
1029
+ - scriptctl context ep_001/scn_001 actor:act_001 --remove
1030
+ `,
1031
+ ],
1032
+ // =========================================================================
1033
+ // Edit verbs — asset metadata
1034
+ // =========================================================================
1035
+ [
1036
+ ["rename"],
1037
+ `Rename an asset (actor / location / prop).
1038
+
1039
+ Usage
1040
+ - scriptctl rename <kind:id> <new_name>
1041
+
1042
+ Example
1043
+ - scriptctl rename actor:act_001 "陈墨"
1044
+ `,
1045
+ ],
1046
+ [
1047
+ ["describe"],
1048
+ `Set the description on an asset or a state (address with /state_id).
1049
+
1050
+ Usage
1051
+ - scriptctl describe <kind:id> <text> # asset description
1052
+ - scriptctl describe <kind:id/state_id> <text> # state description
1053
+
1054
+ Examples
1055
+ - scriptctl describe actor:act_001 "男主,30 岁,雷厉风行"
1056
+ - scriptctl describe actor:act_001/st_calm "默认形态:平静"
1057
+ `,
1058
+ ],
1059
+ [
1060
+ ["alias"],
1061
+ `Add or remove aliases on an asset.
1062
+
1063
+ Usage
1064
+ - scriptctl alias <kind:id> [--add <alias>] [--remove <alias>]
1065
+
1066
+ Either --add or --remove (or both, repeatable) must be provided.
1067
+
1068
+ Examples
1069
+ - scriptctl alias actor:act_001 --add "陈总"
1070
+ - scriptctl alias actor:act_001 --add "陈总" --add "老板"
1071
+ - scriptctl alias actor:act_001 --remove "老板"
1072
+ `,
1073
+ ],
1074
+ [
1075
+ ["role"],
1076
+ `Set an actor's role_type.
1077
+
1078
+ Usage
1079
+ - scriptctl role <actor:id> <主角|配角>
1080
+
1081
+ Only valid on actor:* addresses.
1082
+
1083
+ Example
1084
+ - scriptctl role actor:act_001 主角
1085
+ `,
1086
+ ],
1087
+ [
1088
+ ["worldview"],
1089
+ `Set the script-level worldview (story setting / time period).
1090
+
1091
+ Usage
1092
+ - scriptctl worldview <value>
1093
+
1094
+ Value must match the supported enum (see SCRIPT_SCHEMA worldview values).
1095
+
1096
+ Example
1097
+ - scriptctl worldview 现代
1098
+ `,
1099
+ ],
1100
+ // =========================================================================
1101
+ // Edit verbs — state management
1102
+ // =========================================================================
1103
+ [
1104
+ ["state-add"],
1105
+ `Add a state to an asset's states[].
1106
+
1107
+ Usage
1108
+ - scriptctl state-add <kind:id> <state_name> [--description <text>] [--state-id <id>]
1109
+
1110
+ Required
1111
+ - <kind:id> Asset target.
1112
+ - <state_name> Human-readable state name (must be unique within the asset).
1113
+
1114
+ Options
1115
+ - --description Optional description.
1116
+ - --state-id Optional explicit id (auto-assigned otherwise).
1117
+
1118
+ Examples
1119
+ - scriptctl state-add actor:act_001 "震惊"
1120
+ - scriptctl state-add actor:act_001 "震惊" --description "瞠目结舌" --state-id st_shock
1121
+ `,
1122
+ ],
1123
+ [
1124
+ ["state-rename"],
1125
+ `Rename a state on an asset.
1126
+
1127
+ Usage
1128
+ - scriptctl state-rename <kind:id/state_id> <new_name>
1129
+
1130
+ Example
1131
+ - scriptctl state-rename actor:act_001/st_calm "平静(新)"
1132
+ `,
1133
+ ],
1134
+ [
1135
+ ["state-delete"],
1136
+ `Delete a state from an asset's states[]. Refs are handled via --strategy.
1137
+
1138
+ Usage
1139
+ - scriptctl state-delete <kind:id/state_id> --strategy <replace|remove> [--replacement <state_id>]
1140
+
1141
+ Strategy
1142
+ - replace --replacement <state_id> Rewrite all refs to the replacement state, then delete.
1143
+ - remove Clear refs and delete (scene-initial state becomes null;
1144
+ state_changes referencing this state are dropped).
1145
+
1146
+ Examples
1147
+ - scriptctl state-delete actor:act_001/st_calm --strategy remove
1148
+ - scriptctl state-delete actor:act_001/st_calm --strategy replace --replacement actor:act_001/st_default
1149
+ `,
1150
+ ],
1151
+ // =========================================================================
1152
+ // Edit verbs — dialogue / speaker
1153
+ // =========================================================================
1154
+ [
1155
+ ["dialogue"],
1156
+ `Convert an action to a dialogue and attach speaker(s).
1157
+
1158
+ Usage
1159
+ - scriptctl dialogue <at> --speakers <id1[,id2,...]> [--delivery <single|simultaneous|group>]
1160
+
1161
+ Speakers can be a comma-separated list. Delivery defaults to single (1 speaker) or simultaneous (>1).
1162
+
1163
+ Examples
1164
+ - scriptctl dialogue ep_001/scn_001#3 --speakers spk_chenmu
1165
+ - scriptctl dialogue ep_001/scn_001#3 --speakers spk_a,spk_b --delivery simultaneous
1166
+ `,
1167
+ ],
1168
+ [
1169
+ ["overlap"],
1170
+ `Set overlapping dialogue (multiple speakers each with their own line) on an action.
1171
+
1172
+ Usage
1173
+ - scriptctl overlap <at> --line "<speaker_id>:<content>" [--line ...]
1174
+
1175
+ Each --line associates one speaker with one line of dialogue. Repeatable.
1176
+
1177
+ Example
1178
+ - scriptctl overlap ep_001/scn_001#3 --line "spk_chenmu:你好" --line "spk_other:hi"
1179
+ `,
1180
+ ],
1181
+ [
1182
+ ["add-speaker"],
1183
+ `Register a new speaker entity.
1184
+
1185
+ Usage
1186
+ - scriptctl add-speaker --kind <kind> --name <display_name> [options]
1187
+
1188
+ Required
1189
+ - --kind actor | location | prop | system | broadcast | group | other.
1190
+ - --name Display name.
1191
+
1192
+ Options
1193
+ - --source-id <id> For kind=actor/location/prop, points at the asset.
1194
+ - --voice-desc <text> Free-form voice description.
1195
+ - --speaker-id <id> Optional explicit id (auto-assigned otherwise).
1196
+
1197
+ Examples
1198
+ - scriptctl add-speaker --kind actor --name "陈默" --source-id act_001
1199
+ - scriptctl add-speaker --kind system --name "广播员"
1200
+ `,
1201
+ ],
1202
+ // =========================================================================
1203
+ // Patch (batch transactions)
1204
+ // =========================================================================
1205
+ [
1206
+ ["patch"],
1207
+ `Apply a batch JSON patch to the current script. Use ONLY for >=3 ops in one transaction;
1208
+ single-op edits should use the corresponding atomic verb (replace / type / delete / rename /
1209
+ state-add / etc.).
1210
+
1211
+ Usage
1212
+ - scriptctl patch <file> [options]
1213
+
1214
+ Required
1215
+ - <file> JSON patch file. Top-level may be:
1216
+ an array of ops, or
1217
+ { "ops": [...] }, or
1218
+ { "operations": [...] }, or
1219
+ a single op object.
1220
+
1221
+ Op names use dot-style only (state.add / action.delete / asset.rename / etc.).
1222
+ The 0.5.0 snake-style ops (set_worldview, rename_actor, merge_scenes, ...) were removed.
1223
+ Use \`scriptctl patch --schema\` to see every supported op + its required fields.
1224
+
1225
+ Options
1226
+ - --schema [<op>] Dump op schema (JSON) instead of applying. With <op>, dump just that op.
1227
+ - --dry-run Apply to an in-memory copy, run validate, do NOT write to gateway.
1228
+ - --project-group-no / --script-path / --workspace-path / --request-id / --json / --help
1229
+
1230
+ Examples
1231
+ - scriptctl patch changes.json
1232
+ - scriptctl patch changes.json --dry-run
1233
+ - scriptctl patch --schema
1234
+ - scriptctl patch --schema asset.rename
737
1235
  `,
738
1236
  ],
739
1237
  ];