@lingjingai/scriptctl 0.35.0 → 0.36.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -5
- package/changes/0.36.0.md +24 -0
- package/dist/bin.js +0 -0
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +52 -128
- package/dist/cli.js.map +1 -1
- package/dist/common.d.ts +0 -16
- package/dist/common.js +2 -342
- package/dist/common.js.map +1 -1
- package/dist/domain/ingest/apply-plan.d.ts +23 -0
- package/dist/domain/ingest/apply-plan.js +210 -0
- package/dist/domain/ingest/apply-plan.js.map +1 -0
- package/dist/domain/ingest/assembler.d.ts +57 -0
- package/dist/domain/ingest/assembler.js +181 -0
- package/dist/domain/ingest/assembler.js.map +1 -0
- package/dist/domain/ingest/chunker.d.ts +9 -0
- package/dist/domain/ingest/chunker.js +38 -0
- package/dist/domain/ingest/chunker.js.map +1 -0
- package/dist/domain/ingest/evidence.d.ts +5 -0
- package/dist/domain/ingest/evidence.js +66 -0
- package/dist/domain/ingest/evidence.js.map +1 -0
- package/dist/domain/ingest/govern.d.ts +3 -0
- package/dist/domain/ingest/govern.js +127 -0
- package/dist/domain/ingest/govern.js.map +1 -0
- package/dist/domain/ingest/jsonl-parser.d.ts +6 -0
- package/dist/domain/ingest/jsonl-parser.js +187 -0
- package/dist/domain/ingest/jsonl-parser.js.map +1 -0
- package/dist/domain/ingest/markdown-parser.d.ts +6 -0
- package/dist/domain/ingest/markdown-parser.js +186 -0
- package/dist/domain/ingest/markdown-parser.js.map +1 -0
- package/dist/domain/ingest/records.d.ts +71 -0
- package/dist/domain/ingest/records.js +9 -0
- package/dist/domain/ingest/records.js.map +1 -0
- package/dist/domain/ingest/renumber.d.ts +14 -0
- package/dist/domain/ingest/renumber.js +130 -0
- package/dist/domain/ingest/renumber.js.map +1 -0
- package/dist/domain/ingest/script-v3.d.ts +94 -0
- package/dist/domain/ingest/script-v3.js +7 -0
- package/dist/domain/ingest/script-v3.js.map +1 -0
- package/dist/domain/ingest/state-reconcile.d.ts +11 -0
- package/dist/domain/ingest/state-reconcile.js +90 -0
- package/dist/domain/ingest/state-reconcile.js.map +1 -0
- package/dist/domain/ingest/validation.d.ts +11 -0
- package/dist/domain/ingest/validation.js +168 -0
- package/dist/domain/ingest/validation.js.map +1 -0
- package/dist/domain/ingest/video-aggregate.d.ts +23 -0
- package/dist/domain/ingest/video-aggregate.js +89 -0
- package/dist/domain/ingest/video-aggregate.js.map +1 -0
- package/dist/domain/ingest/video-apply.d.ts +37 -0
- package/dist/domain/ingest/video-apply.js +236 -0
- package/dist/domain/ingest/video-apply.js.map +1 -0
- package/dist/domain/ingest/video-md-parser.d.ts +2 -0
- package/dist/domain/ingest/video-md-parser.js +233 -0
- package/dist/domain/ingest/video-md-parser.js.map +1 -0
- package/dist/domain/ingest/video-records.d.ts +56 -0
- package/dist/domain/ingest/video-records.js +9 -0
- package/dist/domain/ingest/video-records.js.map +1 -0
- package/dist/domain/loom/index.d.ts +2 -1
- package/dist/domain/loom/index.js +12 -10
- package/dist/domain/loom/index.js.map +1 -1
- package/dist/domain/loom/types.d.ts +3 -2
- package/dist/domain/script/lookups.d.ts +3 -2
- package/dist/domain/script/lookups.js +25 -8
- package/dist/domain/script/lookups.js.map +1 -1
- package/dist/domain/script/patch/apply.js +2 -2
- package/dist/domain/script/patch/apply.js.map +1 -1
- package/dist/domain/script/patch/helpers.d.ts +3 -7
- package/dist/domain/script/patch/helpers.js +23 -96
- package/dist/domain/script/patch/helpers.js.map +1 -1
- package/dist/domain/script/patch/ops-action.d.ts +0 -2
- package/dist/domain/script/patch/ops-action.js +34 -100
- package/dist/domain/script/patch/ops-action.js.map +1 -1
- package/dist/domain/script/patch/ops-asset.d.ts +1 -0
- package/dist/domain/script/patch/ops-asset.js +102 -155
- package/dist/domain/script/patch/ops-asset.js.map +1 -1
- package/dist/domain/script/patch/ops-dialogue.d.ts +1 -4
- package/dist/domain/script/patch/ops-dialogue.js +43 -220
- package/dist/domain/script/patch/ops-dialogue.js.map +1 -1
- package/dist/domain/script/patch/ops-extend.js +8 -2
- package/dist/domain/script/patch/ops-extend.js.map +1 -1
- package/dist/domain/script/patch/ops-meta.js.map +1 -1
- package/dist/domain/script/patch/ops-scene.js +26 -39
- package/dist/domain/script/patch/ops-scene.js.map +1 -1
- package/dist/domain/script/patch/ops-state.d.ts +3 -3
- package/dist/domain/script/patch/ops-state.js +33 -49
- package/dist/domain/script/patch/ops-state.js.map +1 -1
- package/dist/domain/script/patch/registry.js +9 -13
- package/dist/domain/script/patch/registry.js.map +1 -1
- package/dist/domain/script/refs.js +23 -111
- package/dist/domain/script/refs.js.map +1 -1
- package/dist/domain/script/scene-refs.d.ts +3 -0
- package/dist/domain/script/scene-refs.js +35 -0
- package/dist/domain/script/scene-refs.js.map +1 -0
- package/dist/domain/script/schema.js +17 -21
- package/dist/domain/script/schema.js.map +1 -1
- package/dist/domain/script/text-util.d.ts +7 -0
- package/dist/domain/script/text-util.js +91 -0
- package/dist/domain/script/text-util.js.map +1 -0
- package/dist/help-text.js +117 -410
- package/dist/help-text.js.map +1 -1
- package/dist/infra/converters.js +1 -1
- package/dist/infra/converters.js.map +1 -1
- package/dist/infra/episode-title.d.ts +4 -0
- package/dist/infra/episode-title.js +129 -0
- package/dist/infra/episode-title.js.map +1 -0
- package/dist/infra/ingest/review-renderer.d.ts +1 -0
- package/dist/infra/ingest/review-renderer.js +431 -0
- package/dist/infra/ingest/review-renderer.js.map +1 -0
- package/dist/infra/ingest/source-resolver.d.ts +21 -0
- package/dist/infra/ingest/source-resolver.js +51 -0
- package/dist/infra/ingest/source-resolver.js.map +1 -0
- package/dist/infra/ingest/text-reader.d.ts +3 -0
- package/dist/infra/ingest/text-reader.js +27 -0
- package/dist/infra/ingest/text-reader.js.map +1 -0
- package/dist/infra/ingest/video-discovery.d.ts +8 -0
- package/dist/infra/ingest/video-discovery.js +60 -0
- package/dist/infra/ingest/video-discovery.js.map +1 -0
- package/dist/infra/ingest/workspace-store.d.ts +18 -0
- package/dist/infra/ingest/workspace-store.js +70 -0
- package/dist/infra/ingest/workspace-store.js.map +1 -0
- package/dist/infra/llm/anthropic-model.d.ts +11 -0
- package/dist/infra/llm/anthropic-model.js +109 -0
- package/dist/infra/llm/anthropic-model.js.map +1 -0
- package/dist/infra/llm/gemini-upload.d.ts +9 -0
- package/dist/infra/llm/gemini-upload.js +94 -0
- package/dist/infra/llm/gemini-upload.js.map +1 -0
- package/dist/infra/llm/gemini-video-model.d.ts +47 -0
- package/dist/infra/llm/gemini-video-model.js +163 -0
- package/dist/infra/llm/gemini-video-model.js.map +1 -0
- package/dist/infra/llm/openai-compatible-model.d.ts +14 -0
- package/dist/infra/llm/openai-compatible-model.js +157 -0
- package/dist/infra/llm/openai-compatible-model.js.map +1 -0
- package/dist/infra/llm/retry.d.ts +5 -0
- package/dist/infra/llm/retry.js +20 -0
- package/dist/infra/llm/retry.js.map +1 -0
- package/dist/llm/composition.d.ts +5 -0
- package/dist/llm/composition.js +5 -0
- package/dist/llm/composition.js.map +1 -0
- package/dist/llm/config.d.ts +26 -0
- package/dist/llm/config.js +201 -0
- package/dist/llm/config.js.map +1 -0
- package/dist/llm/registry.d.ts +44 -0
- package/dist/llm/registry.js +48 -0
- package/dist/llm/registry.js.map +1 -0
- package/dist/llm/router.d.ts +23 -0
- package/dist/llm/router.js +0 -0
- package/dist/llm/router.js.map +1 -0
- package/dist/llm/tasks/ingest/asset-curate.d.ts +13 -0
- package/dist/llm/tasks/ingest/asset-curate.js +45 -0
- package/dist/llm/tasks/ingest/asset-curate.js.map +1 -0
- package/dist/llm/tasks/ingest/asset-extract.d.ts +12 -0
- package/dist/llm/tasks/ingest/asset-extract.js +51 -0
- package/dist/llm/tasks/ingest/asset-extract.js.map +1 -0
- package/dist/llm/tasks/ingest/asset-govern.d.ts +22 -0
- package/dist/llm/tasks/ingest/asset-govern.js +143 -0
- package/dist/llm/tasks/ingest/asset-govern.js.map +1 -0
- package/dist/llm/tasks/ingest/mention-resolve.d.ts +9 -0
- package/dist/llm/tasks/ingest/mention-resolve.js +39 -0
- package/dist/llm/tasks/ingest/mention-resolve.js.map +1 -0
- package/dist/llm/tasks/ingest/plot-speaker.d.ts +11 -0
- package/dist/llm/tasks/ingest/plot-speaker.js +72 -0
- package/dist/llm/tasks/ingest/plot-speaker.js.map +1 -0
- package/dist/llm/tasks/ingest/roster-merge.d.ts +46 -0
- package/dist/llm/tasks/ingest/roster-merge.js +235 -0
- package/dist/llm/tasks/ingest/roster-merge.js.map +1 -0
- package/dist/llm/tasks/ingest/state-merge.d.ts +10 -0
- package/dist/llm/tasks/ingest/state-merge.js +84 -0
- package/dist/llm/tasks/ingest/state-merge.js.map +1 -0
- package/dist/llm/tasks/ingest/state-reconcile.d.ts +8 -0
- package/dist/llm/tasks/ingest/state-reconcile.js +44 -0
- package/dist/llm/tasks/ingest/state-reconcile.js.map +1 -0
- package/dist/llm/tasks/ingest/text-normalize.d.ts +10 -0
- package/dist/llm/tasks/ingest/text-normalize.js +89 -0
- package/dist/llm/tasks/ingest/text-normalize.js.map +1 -0
- package/dist/llm/tasks/ingest/video-correct.d.ts +30 -0
- package/dist/llm/tasks/ingest/video-correct.js +144 -0
- package/dist/llm/tasks/ingest/video-correct.js.map +1 -0
- package/dist/llm/tasks/ingest/video-transcribe.d.ts +4 -0
- package/dist/llm/tasks/ingest/video-transcribe.js +105 -0
- package/dist/llm/tasks/ingest/video-transcribe.js.map +1 -0
- package/dist/llm/tasks/schemas.d.ts +5 -0
- package/dist/llm/tasks/schemas.js +107 -0
- package/dist/llm/tasks/schemas.js.map +1 -0
- package/dist/llm/types.d.ts +97 -0
- package/dist/llm/types.js +13 -0
- package/dist/llm/types.js.map +1 -0
- package/dist/usecases/doctor.d.ts +1 -1
- package/dist/usecases/doctor.js +62 -9
- package/dist/usecases/doctor.js.map +1 -1
- package/dist/usecases/ingest/command.d.ts +5 -0
- package/dist/usecases/ingest/command.js +64 -0
- package/dist/usecases/ingest/command.js.map +1 -0
- package/dist/usecases/ingest/fanout.d.ts +10 -0
- package/dist/usecases/ingest/fanout.js +23 -0
- package/dist/usecases/ingest/fanout.js.map +1 -0
- package/dist/usecases/ingest/pass4-mention-resolve.d.ts +11 -0
- package/dist/usecases/ingest/pass4-mention-resolve.js +52 -0
- package/dist/usecases/ingest/pass4-mention-resolve.js.map +1 -0
- package/dist/usecases/ingest/pass5-extract.d.ts +7 -0
- package/dist/usecases/ingest/pass5-extract.js +50 -0
- package/dist/usecases/ingest/pass5-extract.js.map +1 -0
- package/dist/usecases/ingest/pass5-govern.d.ts +13 -0
- package/dist/usecases/ingest/pass5-govern.js +155 -0
- package/dist/usecases/ingest/pass5-govern.js.map +1 -0
- package/dist/usecases/ingest/pipeline.d.ts +28 -0
- package/dist/usecases/ingest/pipeline.js +144 -0
- package/dist/usecases/ingest/pipeline.js.map +1 -0
- package/dist/usecases/ingest/publish-command.d.ts +4 -0
- package/dist/usecases/ingest/publish-command.js +77 -0
- package/dist/usecases/ingest/publish-command.js.map +1 -0
- package/dist/usecases/ingest/status.d.ts +39 -0
- package/dist/usecases/ingest/status.js +155 -0
- package/dist/usecases/ingest/status.js.map +1 -0
- package/dist/usecases/ingest/video-pass3.d.ts +26 -0
- package/dist/usecases/ingest/video-pass3.js +0 -0
- package/dist/usecases/ingest/video-pass3.js.map +1 -0
- package/dist/usecases/ingest/video-pipeline.d.ts +32 -0
- package/dist/usecases/ingest/video-pipeline.js +202 -0
- package/dist/usecases/ingest/video-pipeline.js.map +1 -0
- package/dist/usecases/ingest/view-command.d.ts +4 -0
- package/dist/usecases/ingest/view-command.js +51 -0
- package/dist/usecases/ingest/view-command.js.map +1 -0
- package/dist/usecases/script/actions.js +2 -2
- package/dist/usecases/script/actions.js.map +1 -1
- package/dist/usecases/script/actor.js.map +1 -1
- package/dist/usecases/script/actors.js.map +1 -1
- package/dist/usecases/script/add-actor.js.map +1 -1
- package/dist/usecases/script/add-episode.js.map +1 -1
- package/dist/usecases/script/add-location.js.map +1 -1
- package/dist/usecases/script/add-prop.js.map +1 -1
- package/dist/usecases/script/alias.js.map +1 -1
- package/dist/usecases/script/assets.js.map +1 -1
- package/dist/usecases/script/context.js.map +1 -1
- package/dist/usecases/script/create.js +3 -6
- package/dist/usecases/script/create.js.map +1 -1
- package/dist/usecases/script/delete.js.map +1 -1
- package/dist/usecases/script/describe.js.map +1 -1
- package/dist/usecases/script/dialogue.js +6 -13
- package/dist/usecases/script/dialogue.js.map +1 -1
- package/dist/usecases/script/do.js +1 -1
- package/dist/usecases/script/do.js.map +1 -1
- package/dist/usecases/script/episodes.js.map +1 -1
- package/dist/usecases/script/{add-speaker.d.ts → importance.d.ts} +1 -1
- package/dist/usecases/script/importance.js +17 -0
- package/dist/usecases/script/importance.js.map +1 -0
- package/dist/usecases/script/insert.js.map +1 -1
- package/dist/usecases/script/issues.js.map +1 -1
- package/dist/usecases/script/lib.d.ts +8 -6
- package/dist/usecases/script/lib.js +81 -97
- package/dist/usecases/script/lib.js.map +1 -1
- package/dist/usecases/script/locations.js.map +1 -1
- package/dist/usecases/script/merge.js.map +1 -1
- package/dist/usecases/script/move.js.map +1 -1
- package/dist/usecases/script/props.js.map +1 -1
- package/dist/usecases/script/refs.js.map +1 -1
- package/dist/usecases/script/rename.js.map +1 -1
- package/dist/usecases/script/replace.js.map +1 -1
- package/dist/usecases/script/role.js.map +1 -1
- package/dist/usecases/script/scenes.js +8 -15
- package/dist/usecases/script/scenes.js.map +1 -1
- package/dist/usecases/script/script-patch.js +1 -1
- package/dist/usecases/script/script-patch.js.map +1 -1
- package/dist/usecases/script/script-validate.js +1 -1
- package/dist/usecases/script/script-validate.js.map +1 -1
- package/dist/usecases/script/session.d.ts +4 -4
- package/dist/usecases/script/session.js +57 -78
- package/dist/usecases/script/session.js.map +1 -1
- package/dist/usecases/script/split.js.map +1 -1
- package/dist/usecases/script/state-add.js.map +1 -1
- package/dist/usecases/script/state-delete.js.map +1 -1
- package/dist/usecases/script/state-rename.js.map +1 -1
- package/dist/usecases/script/summary.js.map +1 -1
- package/dist/usecases/script/synopsis-generate.d.ts +4 -5
- package/dist/usecases/script/synopsis-generate.js +30 -46
- package/dist/usecases/script/synopsis-generate.js.map +1 -1
- package/dist/usecases/script/transition.js.map +1 -1
- package/dist/usecases/script/type.js.map +1 -1
- package/dist/usecases/script/worldview.js.map +1 -1
- package/package.json +21 -17
- package/skills/scriptctl/SKILL.md +140 -120
- package/skills/scriptctl/references/atomic-write-workflow.md +12 -9
- package/skills/scriptctl/references/ingest-workflow.md +85 -0
- package/skills/scriptctl/references/state-reference-repair.md +26 -39
- package/dist/domain/direct/runner.d.ts +0 -25
- package/dist/domain/direct/runner.js +0 -88
- package/dist/domain/direct/runner.js.map +0 -1
- package/dist/domain/direct/stage.d.ts +0 -108
- package/dist/domain/direct/stage.js +0 -134
- package/dist/domain/direct/stage.js.map +0 -1
- package/dist/domain/direct/stages/asset-curation.d.ts +0 -2
- package/dist/domain/direct/stages/asset-curation.js +0 -10
- package/dist/domain/direct/stages/asset-curation.js.map +0 -1
- package/dist/domain/direct/stages/batch-extract.d.ts +0 -2
- package/dist/domain/direct/stages/batch-extract.js +0 -12
- package/dist/domain/direct/stages/batch-extract.js.map +0 -1
- package/dist/domain/direct/stages/batch-plan.d.ts +0 -2
- package/dist/domain/direct/stages/batch-plan.js +0 -9
- package/dist/domain/direct/stages/batch-plan.js.map +0 -1
- package/dist/domain/direct/stages/episode-merge.d.ts +0 -2
- package/dist/domain/direct/stages/episode-merge.js +0 -11
- package/dist/domain/direct/stages/episode-merge.js.map +0 -1
- package/dist/domain/direct/stages/episode-plan.d.ts +0 -2
- package/dist/domain/direct/stages/episode-plan.js +0 -9
- package/dist/domain/direct/stages/episode-plan.js.map +0 -1
- package/dist/domain/direct/stages/episode-synopsis.d.ts +0 -2
- package/dist/domain/direct/stages/episode-synopsis.js +0 -12
- package/dist/domain/direct/stages/episode-synopsis.js.map +0 -1
- package/dist/domain/direct/stages/episode-titles.d.ts +0 -2
- package/dist/domain/direct/stages/episode-titles.js +0 -12
- package/dist/domain/direct/stages/episode-titles.js.map +0 -1
- package/dist/domain/direct/stages/index.d.ts +0 -19
- package/dist/domain/direct/stages/index.js +0 -41
- package/dist/domain/direct/stages/index.js.map +0 -1
- package/dist/domain/direct/stages/metadata.d.ts +0 -2
- package/dist/domain/direct/stages/metadata.js +0 -11
- package/dist/domain/direct/stages/metadata.js.map +0 -1
- package/dist/domain/direct/stages/script-merge.d.ts +0 -2
- package/dist/domain/direct/stages/script-merge.js +0 -15
- package/dist/domain/direct/stages/script-merge.js.map +0 -1
- package/dist/domain/direct/stages/script-synopsis.d.ts +0 -2
- package/dist/domain/direct/stages/script-synopsis.js +0 -12
- package/dist/domain/direct/stages/script-synopsis.js.map +0 -1
- package/dist/domain/direct/stages/source-prepare.d.ts +0 -2
- package/dist/domain/direct/stages/source-prepare.js +0 -9
- package/dist/domain/direct/stages/source-prepare.js.map +0 -1
- package/dist/domain/direct/stages/state-binding.d.ts +0 -2
- package/dist/domain/direct/stages/state-binding.js +0 -9
- package/dist/domain/direct/stages/state-binding.js.map +0 -1
- package/dist/domain/direct/stages/state-curation.d.ts +0 -2
- package/dist/domain/direct/stages/state-curation.js +0 -10
- package/dist/domain/direct/stages/state-curation.js.map +0 -1
- package/dist/domain/direct/stages/validate.d.ts +0 -2
- package/dist/domain/direct/stages/validate.js +0 -10
- package/dist/domain/direct/stages/validate.js.map +0 -1
- package/dist/domain/direct-core.d.ts +0 -313
- package/dist/domain/direct-core.js +0 -8514
- package/dist/domain/direct-core.js.map +0 -1
- package/dist/domain/script/validate.d.ts +0 -22
- package/dist/domain/script/validate.js +0 -997
- package/dist/domain/script/validate.js.map +0 -1
- package/dist/infra/providers.d.ts +0 -97
- package/dist/infra/providers.js +0 -1396
- package/dist/infra/providers.js.map +0 -1
- package/dist/usecases/direct.d.ts +0 -27
- package/dist/usecases/direct.js +0 -4172
- package/dist/usecases/direct.js.map +0 -1
- package/dist/usecases/parse.d.ts +0 -15
- package/dist/usecases/parse.js +0 -429
- package/dist/usecases/parse.js.map +0 -1
- package/dist/usecases/script/add-speaker.js +0 -22
- package/dist/usecases/script/add-speaker.js.map +0 -1
- package/dist/usecases/script/export.d.ts +0 -3
- package/dist/usecases/script/export.js +0 -111
- package/dist/usecases/script/export.js.map +0 -1
- package/dist/usecases/script/overlap.d.ts +0 -3
- package/dist/usecases/script/overlap.js +0 -21
- package/dist/usecases/script/overlap.js.map +0 -1
- package/dist/usecases/script/speakers.d.ts +0 -3
- package/dist/usecases/script/speakers.js +0 -28
- package/dist/usecases/script/speakers.js.map +0 -1
- package/dist/usecases/script/state-change.d.ts +0 -3
- package/dist/usecases/script/state-change.js +0 -24
- package/dist/usecases/script/state-change.js.map +0 -1
- package/skills/scriptctl/references/direct-workflow.md +0 -72
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importance.js","sourceRoot":"","sources":["../../../src/usecases/script/importance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAe,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,MAAM,EAAa,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAAU;IAChD,MAAM,IAAI,GAAG,MAAM,CAAS,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,QAAQ,CAAC,uCAAuC,EAAE,0BAA0B,EAAE;YACtF,QAAQ,EAAE,UAAU;YACpB,QAAQ,EAAE,CAAC,iCAAiC,CAAC;YAC7C,QAAQ,EAAE,IAAI;YACd,SAAS,EAAE,CAAC,wDAAwD,CAAC;YACrE,SAAS,EAAE,cAAc;SAC1B,CAAC,CAAC;IACL,CAAC;IACD,OAAO,mBAAmB,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACnG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insert.js","sourceRoot":"","sources":["../../../src/usecases/script/insert.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,QAAQ,EAKR,UAAU,GASX,MAAM,iBAAiB,CAAC;AAYzB,OAAO,EACL,eAAe,GAKhB,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"insert.js","sourceRoot":"","sources":["../../../src/usecases/script/insert.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,QAAQ,EAKR,UAAU,GASX,MAAM,iBAAiB,CAAC;AAYzB,OAAO,EACL,eAAe,GAKhB,MAAM,gCAAgC,CAAC;AAWxC,OAAO,EACL,MAAM,GAKP,MAAM,+BAA+B,CAAC;AAMvC,OAAO,EAC+I,mBAAmB,GACxK,MAAM,UAAU,CAAC;AAElB,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAU;IAC5C,MAAM,IAAI,GAAG,MAAM,CAAS,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,QAAQ,CAAC,sCAAsC,EAAE,yBAAyB,EAAE;YACpF,QAAQ,EAAE,UAAU;YACpB,QAAQ,EAAE,CAAC,iEAAiE,CAAC;YAC7E,QAAQ,EAAE,CAAC,SAAS,CAAC;YACrB,SAAS,EAAE,CAAC,0EAA0E,CAAC;YACvF,SAAS,EAAE,iBAAiB;SAC7B,CAAC,CAAC;IACL,CAAC;IACD,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,sEAAsE;IACtE,aAAa;IACb,uEAAuE;IACvE,yEAAyE;IACzE,qEAAqE;IACrE,MAA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EAAE,IAAI,CAAC,UAAU,CAAC;YAC1B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;YAClB,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;YACpB,wEAAwE;YACxE,yEAAyE;YACzE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC;YAC1B,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC;YACxC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC;YACtB,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;SACrB,CAAC,CAAC;IACL,CAAC;IACD,MAAM,IAAI,QAAQ,CAAC,qDAAqD,EAAE,wCAAwC,EAAE;QAClH,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,CAAC,yDAAyD,CAAC;QACrE,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC;QACpB,SAAS,EAAE,CAAC,kCAAkC,CAAC;QAC/C,SAAS,EAAE,qBAAqB;KACjC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issues.js","sourceRoot":"","sources":["../../../src/usecases/script/issues.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,OAAO,GAWR,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"issues.js","sourceRoot":"","sources":["../../../src/usecases/script/issues.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,OAAO,GAWR,MAAM,iBAAiB,CAAC;AA6BzB,OAAO,EACL,MAAM,EAIN,KAAK,GACN,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEL,iBAAiB,EAAE,eAAe,GAEnC,MAAM,cAAc,CAAC;AACtB,OAAO,EAC6P,WAAW,GAC9Q,MAAM,UAAU,CAAC;AAElB,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAU;IAC5C,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC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AAO,CAAC,CAAC;AACxF,CAAC;AAED,+EAA+E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CliError, type Report } from "../../common.js";
|
|
2
2
|
import { type InSelector } from "../../domain/script/selector.js";
|
|
3
|
-
import { sortDeep } from "../../domain/
|
|
3
|
+
import { sortDeep } from "../../domain/script/text-util.js";
|
|
4
4
|
import { type Dict } from "../../domain/script/shared.js";
|
|
5
5
|
import { ScriptEditSession } from "./session.js";
|
|
6
6
|
export interface DoToken {
|
|
@@ -37,8 +37,10 @@ export declare function contextTemplate(target: string, f: {
|
|
|
37
37
|
clear?: boolean;
|
|
38
38
|
remove?: boolean;
|
|
39
39
|
}): Dict;
|
|
40
|
-
export declare function dialogueTemplate(
|
|
41
|
-
|
|
40
|
+
export declare function dialogueTemplate(f: {
|
|
41
|
+
actor?: unknown;
|
|
42
|
+
kind?: unknown;
|
|
43
|
+
label?: unknown;
|
|
42
44
|
}): Dict;
|
|
43
45
|
export declare function lineToOp(verb: string, args: string[], flags: Dict): Dict;
|
|
44
46
|
export declare function actionAddress(epId: string, sceneId: string, idx: number): string;
|
|
@@ -55,9 +57,9 @@ export declare function summarizeScriptOp(_script: Dict, op: Dict): string;
|
|
|
55
57
|
export declare function regexPattern(raw: string): string;
|
|
56
58
|
export declare function applySelectorEdits(opts: Dict, template: Dict, verbLabel: string): Promise<[Report, number]>;
|
|
57
59
|
export { sortDeep };
|
|
58
|
-
export declare function
|
|
59
|
-
export declare function
|
|
60
|
-
export declare function actorIdsInAction(action: Dict
|
|
60
|
+
export declare function actionActorId(action: Dict): string;
|
|
61
|
+
export declare function actionSpeakerLabel(action: Dict, actorNames?: Map<string, string>): string;
|
|
62
|
+
export declare function actorIdsInAction(action: Dict): Set<string>;
|
|
61
63
|
export declare function buildGrepMatcher(raw: string): ((hay: string) => boolean) | null;
|
|
62
64
|
export declare function buildReport(op: string, title: string, lines: string[], artifactLabel: string): Report;
|
|
63
65
|
export declare function synopsisPreview(text: string, limit: number): string;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { CliError, EXIT_NEEDS_AGENT, EXIT_OK, EXIT_USAGE, } from "../../common.js";
|
|
2
2
|
import { applyPatchOperations } from "../../domain/script/patch/apply.js";
|
|
3
3
|
import { renumberSceneIds } from "../../domain/script/lookups.js";
|
|
4
|
+
import { sceneRefs } from "../../domain/script/scene-refs.js";
|
|
4
5
|
import { isDangerousRegex, MAX_GREP_PATTERN_LEN, parseInSelector, selectorSingleActionPoint, WHOLE_SCRIPT, } from "../../domain/script/selector.js";
|
|
5
6
|
import { parseAnyAddress, } from "../../domain/script/address.js";
|
|
6
|
-
import { summarizeIssues
|
|
7
|
-
import { sortDeep } from "../../domain/
|
|
7
|
+
import { summarizeIssues } from "../../domain/script/text-util.js";
|
|
8
|
+
import { sortDeep } from "../../domain/script/text-util.js";
|
|
8
9
|
import { asList, idNum, isDict, strOf, } from "../../domain/script/shared.js";
|
|
9
10
|
import { loadScriptForEdit, validateSession, saveScriptSession, syncValidationResult, scriptSourceText, } from "./session.js";
|
|
10
11
|
export function tokenizeLine(line) {
|
|
@@ -73,16 +74,14 @@ function isDoFlag(t) {
|
|
|
73
74
|
// Per-verb flag arity. Everything else takes the next token as its value.
|
|
74
75
|
export const DO_BOOL_FLAGS = {
|
|
75
76
|
replace: new Set(["all", "regex"]),
|
|
76
|
-
"state-change": new Set(["clear"]),
|
|
77
77
|
transition: new Set(["clear"]),
|
|
78
78
|
emotion: new Set(["clear"]),
|
|
79
|
-
|
|
79
|
+
"scene-ref": new Set(["clear", "remove"]),
|
|
80
80
|
delete: new Set(["force"]),
|
|
81
81
|
extend: new Set(["clear", "json-value"]),
|
|
82
82
|
};
|
|
83
83
|
export const DO_REPEAT_FLAGS = {
|
|
84
84
|
alias: new Set(["add", "remove"]),
|
|
85
|
-
overlap: new Set(["line"]),
|
|
86
85
|
"add-actor": new Set(["alias"]),
|
|
87
86
|
};
|
|
88
87
|
function pushFlag(flags, repeats, name, val) {
|
|
@@ -175,9 +174,11 @@ export function stateChangeTemplate(target, f) {
|
|
|
175
174
|
nextSteps: ["Pick exactly one flag."], errorCode: "STATE_CHANGE_FLAG_MISSING",
|
|
176
175
|
});
|
|
177
176
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
:
|
|
177
|
+
// v3 has no per-action state_changes; state lives on scene.ref.* only.
|
|
178
|
+
throw new CliError("VERB BLOCKED: state-change removed", "state-change was removed in v3; set a scene ref's state instead.", {
|
|
179
|
+
exitCode: EXIT_USAGE, required: ["scene-ref state edit"], received: ["state-change"],
|
|
180
|
+
nextSteps: ["Use `scene-ref <ep/scn> <kind:id> --state <state_id>` (op scene.ref.set)."], errorCode: "STATE_CHANGE_REMOVED",
|
|
181
|
+
});
|
|
181
182
|
}
|
|
182
183
|
export function transitionTemplate(target, f) {
|
|
183
184
|
const setBoth = f.process !== undefined || f.contrast !== undefined;
|
|
@@ -242,13 +243,24 @@ export function contextTemplate(target, f) {
|
|
|
242
243
|
});
|
|
243
244
|
}
|
|
244
245
|
if (removeSet)
|
|
245
|
-
return { op: "
|
|
246
|
+
return { op: "scene.ref.remove", target };
|
|
246
247
|
if (clearSet)
|
|
247
|
-
return { op: "
|
|
248
|
-
return { op: "
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
|
|
248
|
+
return { op: "scene.ref.clear", target };
|
|
249
|
+
return { op: "scene.ref.set", target, state: f.state === "none" ? "" : f.state };
|
|
250
|
+
}
|
|
251
|
+
// v3 dialogue speaker: a single inline speaker — an actor, OR a non-actor kind
|
|
252
|
+
// (system|broadcast|offscreen|group) with an optional label.
|
|
253
|
+
export function dialogueTemplate(f) {
|
|
254
|
+
const actorId = strOf(f.actor).trim();
|
|
255
|
+
const speakerKind = strOf(f.kind).trim();
|
|
256
|
+
if (actorId)
|
|
257
|
+
return { op: "dialogue.speaker.set", actor_id: actorId };
|
|
258
|
+
if (speakerKind)
|
|
259
|
+
return { op: "dialogue.speaker.set", kind: speakerKind, label: strOf(f.label).trim() || undefined };
|
|
260
|
+
throw new CliError("VERB BLOCKED: dialogue speaker missing", "dialogue: pass --actor <id> or --kind <system|broadcast|offscreen|group>.", {
|
|
261
|
+
exitCode: EXIT_USAGE, required: ["--actor <actor_id> or --kind <non-actor kind>"], received: ["<missing>"],
|
|
262
|
+
nextSteps: ["Set --actor for an actor line, or --kind for a non-actor line."], errorCode: "DIALOGUE_SPEAKER_MISSING",
|
|
263
|
+
});
|
|
252
264
|
}
|
|
253
265
|
// Translate one parsed verb line into a patch op dict (the SAME ops `patch`
|
|
254
266
|
// consumes). `do` = the human/agent-friendly notation for those ops: no JSON,
|
|
@@ -266,18 +278,14 @@ export function lineToOp(verb, args, flags) {
|
|
|
266
278
|
return { op: "action.type.set", at: a0, type: a1 };
|
|
267
279
|
case "actor":
|
|
268
280
|
return { op: "action.actor.set", at: a0, actor_id: a1 };
|
|
269
|
-
case "state-change":
|
|
270
|
-
return { ...stateChangeTemplate(a1, { to: flags["to"], from: flags["from"], effective: flags["effective"], clear: Boolean(flags["clear"]) }), at: a0 };
|
|
271
281
|
case "transition":
|
|
272
282
|
return { ...transitionTemplate(a1, { process: flags["process"], contrast: flags["contrast"], clear: Boolean(flags["clear"]) }), at: a0 };
|
|
273
283
|
case "emotion":
|
|
274
284
|
return { ...emotionTemplate({ emotion: args[1], clear: Boolean(flags["clear"]) }), at: a0 };
|
|
275
|
-
case "
|
|
285
|
+
case "scene-ref":
|
|
276
286
|
return { ...contextTemplate(a1, { state: flags["state"], clear: Boolean(flags["clear"]), remove: Boolean(flags["remove"]) }), at: a0 };
|
|
277
287
|
case "dialogue":
|
|
278
|
-
return { ...dialogueTemplate(
|
|
279
|
-
case "overlap":
|
|
280
|
-
return { op: "dialogue.overlap", at: a0, lines: flags["line"] ?? [] };
|
|
288
|
+
return { ...dialogueTemplate({ actor: flags["actor"], kind: flags["kind"], label: flags["label"] }), at: a0 };
|
|
281
289
|
case "rename":
|
|
282
290
|
return { op: "asset.rename", target: a0, name: a1 };
|
|
283
291
|
case "role":
|
|
@@ -350,8 +358,8 @@ export function lineToOp(verb, args, flags) {
|
|
|
350
358
|
return { op: "prop.add", name: a0, description: flags["description"] };
|
|
351
359
|
case "add-episode":
|
|
352
360
|
return { op: "episode.add", title: flags["title"], episode_id: flags["id"] };
|
|
353
|
-
case "
|
|
354
|
-
return { op: "
|
|
361
|
+
case "importance":
|
|
362
|
+
return { op: "importance.set", target: a0, importance: a1 };
|
|
355
363
|
case "split":
|
|
356
364
|
return { op: "scene.split", at: a0, at_index: flags["at"], new_scene_id: flags["new-scene-id"] };
|
|
357
365
|
case "delete": {
|
|
@@ -360,8 +368,6 @@ export function lineToOp(verb, args, flags) {
|
|
|
360
368
|
return { op: "action.delete", at: a0 };
|
|
361
369
|
if (addr.kind === "scene")
|
|
362
370
|
return { op: "scene.delete", at: a0, force: Boolean(flags["force"]) };
|
|
363
|
-
if (addr.kind === "speaker")
|
|
364
|
-
return { op: "speaker.delete", target: a0, strategy: flags["strategy"], replacement: flags["replacement"] };
|
|
365
371
|
if (addr.kind === "asset")
|
|
366
372
|
return { op: "asset.delete", target: a0, strategy: flags["strategy"], replacement: flags["replacement"] };
|
|
367
373
|
throw doErr(`delete cannot operate on a ${addr.kind} address (${a0}); episodes/states have no delete op`);
|
|
@@ -423,23 +429,19 @@ export function sceneTimeSpan(scene) {
|
|
|
423
429
|
return { t_start, t_end };
|
|
424
430
|
}
|
|
425
431
|
export function actionDisplayFields(epId, sceneId, idx, action) {
|
|
426
|
-
const
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
if (lines.length > 0)
|
|
432
|
-
content = lines.map((l) => strOf(l["content"])).join(" / ");
|
|
433
|
-
}
|
|
432
|
+
const actorId = actionActorId(action);
|
|
433
|
+
const s = isDict(action["speaker"]) ? action["speaker"] : null;
|
|
434
|
+
// For a non-actor speaker ({kind,label}) surface it under `speaker`; an actor
|
|
435
|
+
// line surfaces under `actor` (its id). Narrative lines have neither.
|
|
436
|
+
const speaker = s && !actorId ? (strOf(s["label"]).trim() || strOf(s["kind"]).trim()) : "";
|
|
434
437
|
return {
|
|
435
438
|
addr: actionAddress(epId, sceneId, idx),
|
|
436
439
|
timestamp: actionTimestamp(action),
|
|
437
440
|
type: strOf(action["type"]).trim() || "action",
|
|
438
|
-
|
|
439
|
-
speaker: speakerId,
|
|
441
|
+
speaker,
|
|
440
442
|
actor: actorId,
|
|
441
443
|
emotion: strOf(action["emotion"]).trim(),
|
|
442
|
-
content,
|
|
444
|
+
content: strOf(action["content"]),
|
|
443
445
|
};
|
|
444
446
|
}
|
|
445
447
|
export function formatInspectAction(epId, sceneId, idx, action) {
|
|
@@ -515,8 +517,10 @@ export function summarizeScriptOp(_script, op) {
|
|
|
515
517
|
return `已更新分集梗概 ${op["episode_id"] ?? op["target"] ?? op["at"]}`;
|
|
516
518
|
if (kind === "state.add")
|
|
517
519
|
return `已为 ${op["target"]} 新增状态 ${op["state_id"]}: ${op["name"] || op["state_name"]}`;
|
|
518
|
-
if (kind === "
|
|
519
|
-
return
|
|
520
|
+
if (kind === "importance.set")
|
|
521
|
+
return `已将 ${op["target"]} 重要度设为 ${op["importance"]}`;
|
|
522
|
+
if (kind === "scene.ref.set")
|
|
523
|
+
return `已在 ${op["at"]} 设置引用 ${op["target"]}${op["state"] ? `(状态 ${op["state"]})` : ""}`;
|
|
520
524
|
if (kind === "extend.set")
|
|
521
525
|
return `已在 ${op["at"]} 设置 extend.${op["key"]}`;
|
|
522
526
|
if (kind === "extend.clear")
|
|
@@ -633,46 +637,34 @@ export { sortDeep };
|
|
|
633
637
|
// / --speaker / --severity / --code / --has-{actor,location,prop}).
|
|
634
638
|
// Resolve the speaker_id → source actor mapping once per call. Used by
|
|
635
639
|
// commandActions's --actor filter when the action speaks via a speaker.
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
const
|
|
652
|
-
if (
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
const id = strOf(line["speaker_id"]).trim();
|
|
661
|
-
if (id)
|
|
662
|
-
ids.add(id);
|
|
663
|
-
}
|
|
664
|
-
return ids;
|
|
665
|
-
}
|
|
666
|
-
export function actorIdsInAction(action, speakerToActor) {
|
|
640
|
+
// v3: a dialogue line carries a single inline speaker — an actor ({actor_id})
|
|
641
|
+
// or a non-actor source ({kind, label?}). These read that shape.
|
|
642
|
+
// The actor id behind an action's speaker, or "" for a non-actor / narrative line.
|
|
643
|
+
export function actionActorId(action) {
|
|
644
|
+
const s = action["speaker"];
|
|
645
|
+
if (isDict(s) && strOf(s["actor_id"]).trim())
|
|
646
|
+
return strOf(s["actor_id"]).trim();
|
|
647
|
+
return "";
|
|
648
|
+
}
|
|
649
|
+
// A human label for the speaker: the actor's name (resolved via `names`), or a
|
|
650
|
+
// non-actor kind's label / kind, or "" when the line has no speaker.
|
|
651
|
+
export function actionSpeakerLabel(action, actorNames) {
|
|
652
|
+
const s = action["speaker"];
|
|
653
|
+
if (!isDict(s))
|
|
654
|
+
return "";
|
|
655
|
+
const actorId = strOf(s["actor_id"]).trim();
|
|
656
|
+
if (actorId)
|
|
657
|
+
return actorNames?.get(actorId) || actorId;
|
|
658
|
+
const kind = strOf(s["kind"]).trim();
|
|
659
|
+
if (kind)
|
|
660
|
+
return strOf(s["label"]).trim() || kind;
|
|
661
|
+
return "";
|
|
662
|
+
}
|
|
663
|
+
export function actorIdsInAction(action) {
|
|
667
664
|
const ids = new Set();
|
|
668
|
-
const
|
|
669
|
-
if (
|
|
670
|
-
ids.add(
|
|
671
|
-
for (const spkId of speakerIdsInAction(action)) {
|
|
672
|
-
const actor = speakerToActor.get(spkId);
|
|
673
|
-
if (actor)
|
|
674
|
-
ids.add(actor);
|
|
675
|
-
}
|
|
665
|
+
const id = actionActorId(action);
|
|
666
|
+
if (id)
|
|
667
|
+
ids.add(id);
|
|
676
668
|
return ids;
|
|
677
669
|
}
|
|
678
670
|
// Build a grep matcher. /pattern/flags → RegExp, otherwise literal substring.
|
|
@@ -743,7 +735,7 @@ export function nameMaps(script) {
|
|
|
743
735
|
return out;
|
|
744
736
|
}
|
|
745
737
|
export function formatScene(epId, scene, names) {
|
|
746
|
-
const ctx =
|
|
738
|
+
const ctx = sceneRefs(scene);
|
|
747
739
|
const env = isDict(scene["environment"]) ? scene["environment"] : {};
|
|
748
740
|
const space = strOf(env["space"]) || "-";
|
|
749
741
|
const time = strOf(env["time"]) || "-";
|
|
@@ -764,7 +756,7 @@ export function formatScene(epId, scene, names) {
|
|
|
764
756
|
const timePart = t_start || t_end ? ` t=${t_start || "?"}..${t_end || "?"}` : "";
|
|
765
757
|
return `${epId}/${scene["scene_id"]} [${space} ${time}] location=${locations.join(",") || "-"} actors=${actors.join(",") || "-"} props=${props.join(",") || "-"} actions=${actionCount}${timePart}`;
|
|
766
758
|
}
|
|
767
|
-
export const HAS_FILTERS = new Set(["
|
|
759
|
+
export const HAS_FILTERS = new Set(["transition", "speaker"]);
|
|
768
760
|
// Resolve a selection (--in range/region selector + --type/--actor/--speaker/
|
|
769
761
|
// --grep/--has predicates, AND-combined) to the matching actions, in document
|
|
770
762
|
// order. The single matcher behind both `actions` queries and selector-driven
|
|
@@ -774,7 +766,6 @@ export function resolveActionTargets(script, opts) {
|
|
|
774
766
|
const selector = parseInSelector(strOf(opts["in"]));
|
|
775
767
|
const typeFilter = strOf(opts["type"]).trim();
|
|
776
768
|
const actorFilter = strOf(opts["actor"]).trim();
|
|
777
|
-
const speakerFilter = strOf(opts["speaker"]).trim();
|
|
778
769
|
const hasFilter = strOf(opts["has"]).trim();
|
|
779
770
|
// Whitelist --has: silently accepting unknown values means a typo like
|
|
780
771
|
// "state_changes" (underscore) passed the filter-missing guard but bypassed
|
|
@@ -789,7 +780,6 @@ export function resolveActionTargets(script, opts) {
|
|
|
789
780
|
});
|
|
790
781
|
}
|
|
791
782
|
const grepMatcher = buildGrepMatcher(strOf(opts["grep"]));
|
|
792
|
-
const speakerToActor = (actorFilter || speakerFilter) ? speakerSourceActorMap(script) : new Map();
|
|
793
783
|
const out = [];
|
|
794
784
|
for (const ep of asList(script["episodes"])) {
|
|
795
785
|
const epId = strOf(ep["episode_id"]);
|
|
@@ -804,23 +794,14 @@ export function resolveActionTargets(script, opts) {
|
|
|
804
794
|
const a = actions[i];
|
|
805
795
|
if (typeFilter && strOf(a["type"]).trim() !== typeFilter)
|
|
806
796
|
continue;
|
|
807
|
-
if (
|
|
808
|
-
continue;
|
|
809
|
-
if (actorFilter && !actorIdsInAction(a, speakerToActor).has(actorFilter))
|
|
810
|
-
continue;
|
|
811
|
-
if (hasFilter === "state-changes" && asList(a["state_changes"]).length === 0)
|
|
797
|
+
if (actorFilter && !actorIdsInAction(a).has(actorFilter))
|
|
812
798
|
continue;
|
|
813
799
|
if (hasFilter === "transition" && !isDict(a["transition_prompt"]))
|
|
814
800
|
continue;
|
|
815
|
-
if (hasFilter === "
|
|
801
|
+
if (hasFilter === "speaker" && !isDict(a["speaker"]))
|
|
802
|
+
continue;
|
|
803
|
+
if (grepMatcher && !grepMatcher(strOf(a["content"])))
|
|
816
804
|
continue;
|
|
817
|
-
if (grepMatcher) {
|
|
818
|
-
let hay = strOf(a["content"]);
|
|
819
|
-
for (const line of asList(a["lines"]))
|
|
820
|
-
hay += "\n" + strOf(line["content"]);
|
|
821
|
-
if (!grepMatcher(hay))
|
|
822
|
-
continue;
|
|
823
|
-
}
|
|
824
805
|
out.push({ epId, sceneId, idx: i, action: a });
|
|
825
806
|
}
|
|
826
807
|
}
|
|
@@ -831,7 +812,7 @@ export function resolveActionTargets(script, opts) {
|
|
|
831
812
|
export function selectionHasAnyFilter(opts) {
|
|
832
813
|
return Boolean(!parseInSelector(strOf(opts["in"])).isEmpty ||
|
|
833
814
|
strOf(opts["grep"]) || strOf(opts["type"]).trim() || strOf(opts["actor"]).trim() ||
|
|
834
|
-
strOf(opts["
|
|
815
|
+
strOf(opts["has"]).trim());
|
|
835
816
|
}
|
|
836
817
|
// Collapse a set of episode ids into sorted, comma-joined ranges:
|
|
837
818
|
// {ep_001, ep_002, ep_003, ep_007} → "ep_001..ep_003,ep_007". Keeps the state
|
|
@@ -870,7 +851,7 @@ export function assetAppearanceCounts(script, kind) {
|
|
|
870
851
|
for (const ep of asList(script["episodes"])) {
|
|
871
852
|
const epId = strOf(ep["episode_id"]);
|
|
872
853
|
for (const scene of asList(ep["scenes"])) {
|
|
873
|
-
const ctx =
|
|
854
|
+
const ctx = sceneRefs(scene);
|
|
874
855
|
const seen = new Set();
|
|
875
856
|
for (const ref of asList(ctx[pluralKey])) {
|
|
876
857
|
const id = strOf(ref[idKey]);
|
|
@@ -918,13 +899,13 @@ export function listAssetsByKind(script, kind, opts) {
|
|
|
918
899
|
// scene. Legacy narrowing is implemented for actor only.
|
|
919
900
|
if (kind === "actor") {
|
|
920
901
|
const a = asList(scene["actions"])[single.idx];
|
|
921
|
-
const aid = a ?
|
|
902
|
+
const aid = a ? actionActorId(a) : "";
|
|
922
903
|
if (aid)
|
|
923
904
|
scopeIds.add(aid);
|
|
924
905
|
}
|
|
925
906
|
continue;
|
|
926
907
|
}
|
|
927
|
-
const ctx =
|
|
908
|
+
const ctx = sceneRefs(scene);
|
|
928
909
|
for (const ref of asList(ctx[pluralKey])) {
|
|
929
910
|
scopeIds.add(strOf(ref[idKey]));
|
|
930
911
|
}
|
|
@@ -945,11 +926,14 @@ export function listAssetsByKind(script, kind, opts) {
|
|
|
945
926
|
continue;
|
|
946
927
|
const aliases = asList(asset["aliases"]).map((s) => strOf(s));
|
|
947
928
|
const role = strOf(asset["role_type"]);
|
|
929
|
+
const importance = strOf(asset["importance"]);
|
|
948
930
|
const descPresent = strOf(asset["description"]).trim() ? "yes" : "missing";
|
|
949
931
|
const states = asList(asset["states"]).length;
|
|
950
932
|
const extra = [];
|
|
951
933
|
if (aliases.length > 0)
|
|
952
934
|
extra.push(`aliases=(${aliases.join(",")})`);
|
|
935
|
+
if (importance)
|
|
936
|
+
extra.push(`importance=${importance}`);
|
|
953
937
|
if (role)
|
|
954
938
|
extra.push(`role=${role}`);
|
|
955
939
|
extra.push(`states=${states}`, `description=${descPresent}`);
|