@lingjingai/scriptctl 0.63.13 → 0.63.15
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 +7 -1
- package/changes/0.63.14.md +7 -0
- package/changes/0.63.15.md +15 -0
- package/dist/bin.js +1 -20812
- package/dist/chunk-3LPIMYYI.js +823 -0
- package/dist/cli.d.ts +214 -5
- package/dist/cli.js +1 -187
- package/dist/review-agent.js +56 -3593
- package/package.json +12 -5
- package/dist/bin.d.ts +0 -2
- package/dist/bin.js.map +0 -7
- package/dist/cli/register-authoring.d.ts +0 -4
- package/dist/cli/register-authoring.js +0 -35
- package/dist/cli/register-authoring.js.map +0 -1
- package/dist/cli/register-review.d.ts +0 -3
- package/dist/cli/register-review.js +0 -20
- package/dist/cli/register-review.js.map +0 -1
- package/dist/cli/register-script.d.ts +0 -3
- package/dist/cli/register-script.js +0 -297
- package/dist/cli/register-script.js.map +0 -1
- package/dist/cli/register-tools.d.ts +0 -3
- package/dist/cli/register-tools.js +0 -23
- package/dist/cli/register-tools.js.map +0 -1
- package/dist/cli/register-workflows.d.ts +0 -4
- package/dist/cli/register-workflows.js +0 -108
- package/dist/cli/register-workflows.js.map +0 -1
- package/dist/cli/registry.d.ts +0 -14
- package/dist/cli/registry.js +0 -65
- package/dist/cli/registry.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/common.d.ts +0 -93
- package/dist/common.js +0 -240
- package/dist/common.js.map +0 -1
- package/dist/domain/authoring/apply.d.ts +0 -1
- package/dist/domain/authoring/apply.js +0 -2
- package/dist/domain/authoring/apply.js.map +0 -1
- package/dist/domain/authoring/export.d.ts +0 -1
- package/dist/domain/authoring/export.js +0 -2
- package/dist/domain/authoring/export.js.map +0 -1
- package/dist/domain/authoring/parser.d.ts +0 -2
- package/dist/domain/authoring/parser.js +0 -3
- package/dist/domain/authoring/parser.js.map +0 -1
- package/dist/domain/authoring/serializer.d.ts +0 -1
- package/dist/domain/authoring/serializer.js +0 -2
- package/dist/domain/authoring/serializer.js.map +0 -1
- package/dist/domain/authoring/shared/bracket.d.ts +0 -4
- package/dist/domain/authoring/shared/bracket.js +0 -95
- package/dist/domain/authoring/shared/bracket.js.map +0 -1
- package/dist/domain/authoring/shared/types.d.ts +0 -12
- package/dist/domain/authoring/shared/types.js +0 -2
- package/dist/domain/authoring/shared/types.js.map +0 -1
- package/dist/domain/authoring/types.d.ts +0 -2
- package/dist/domain/authoring/types.js +0 -3
- package/dist/domain/authoring/types.js.map +0 -1
- package/dist/domain/authoring/v3/apply.d.ts +0 -33
- package/dist/domain/authoring/v3/apply.js +0 -784
- package/dist/domain/authoring/v3/apply.js.map +0 -1
- package/dist/domain/authoring/v3/export.d.ts +0 -7
- package/dist/domain/authoring/v3/export.js +0 -85
- package/dist/domain/authoring/v3/export.js.map +0 -1
- package/dist/domain/authoring/v3/parser.d.ts +0 -3
- package/dist/domain/authoring/v3/parser.js +0 -823
- package/dist/domain/authoring/v3/parser.js.map +0 -1
- package/dist/domain/authoring/v3/serializer.d.ts +0 -2
- package/dist/domain/authoring/v3/serializer.js +0 -244
- package/dist/domain/authoring/v3/serializer.js.map +0 -1
- package/dist/domain/authoring/v3/types.d.ts +0 -76
- package/dist/domain/authoring/v3/types.js +0 -2
- package/dist/domain/authoring/v3/types.js.map +0 -1
- package/dist/domain/authoring/v4/apply.d.ts +0 -40
- package/dist/domain/authoring/v4/apply.js +0 -451
- package/dist/domain/authoring/v4/apply.js.map +0 -1
- package/dist/domain/authoring/v4/parser.d.ts +0 -2
- package/dist/domain/authoring/v4/parser.js +0 -729
- package/dist/domain/authoring/v4/parser.js.map +0 -1
- package/dist/domain/authoring/v4/serializer.d.ts +0 -6
- package/dist/domain/authoring/v4/serializer.js +0 -280
- package/dist/domain/authoring/v4/serializer.js.map +0 -1
- package/dist/domain/authoring/v4/types.d.ts +0 -50
- package/dist/domain/authoring/v4/types.js +0 -2
- package/dist/domain/authoring/v4/types.js.map +0 -1
- package/dist/domain/creative-draft/compose.d.ts +0 -18
- package/dist/domain/creative-draft/compose.js +0 -448
- package/dist/domain/creative-draft/compose.js.map +0 -1
- package/dist/domain/ingest/apply-plan.d.ts +0 -23
- package/dist/domain/ingest/apply-plan.js +0 -210
- package/dist/domain/ingest/apply-plan.js.map +0 -1
- package/dist/domain/ingest/assembler.d.ts +0 -65
- package/dist/domain/ingest/assembler.js +0 -263
- package/dist/domain/ingest/assembler.js.map +0 -1
- package/dist/domain/ingest/asset-audit.d.ts +0 -50
- package/dist/domain/ingest/asset-audit.js +0 -196
- package/dist/domain/ingest/asset-audit.js.map +0 -1
- package/dist/domain/ingest/chunker.d.ts +0 -9
- package/dist/domain/ingest/chunker.js +0 -49
- package/dist/domain/ingest/chunker.js.map +0 -1
- package/dist/domain/ingest/environment.d.ts +0 -3
- package/dist/domain/ingest/environment.js +0 -32
- package/dist/domain/ingest/environment.js.map +0 -1
- package/dist/domain/ingest/evidence.d.ts +0 -5
- package/dist/domain/ingest/evidence.js +0 -66
- package/dist/domain/ingest/evidence.js.map +0 -1
- package/dist/domain/ingest/govern.d.ts +0 -3
- package/dist/domain/ingest/govern.js +0 -157
- package/dist/domain/ingest/govern.js.map +0 -1
- package/dist/domain/ingest/jsonl-parser.d.ts +0 -6
- package/dist/domain/ingest/jsonl-parser.js +0 -204
- package/dist/domain/ingest/jsonl-parser.js.map +0 -1
- package/dist/domain/ingest/markdown-parser.d.ts +0 -6
- package/dist/domain/ingest/markdown-parser.js +0 -187
- package/dist/domain/ingest/markdown-parser.js.map +0 -1
- package/dist/domain/ingest/production-validation.d.ts +0 -8
- package/dist/domain/ingest/production-validation.js +0 -37
- package/dist/domain/ingest/production-validation.js.map +0 -1
- package/dist/domain/ingest/records.d.ts +0 -72
- package/dist/domain/ingest/records.js +0 -10
- package/dist/domain/ingest/records.js.map +0 -1
- package/dist/domain/ingest/renumber.d.ts +0 -14
- package/dist/domain/ingest/renumber.js +0 -130
- package/dist/domain/ingest/renumber.js.map +0 -1
- package/dist/domain/ingest/serial-context.d.ts +0 -93
- package/dist/domain/ingest/serial-context.js +0 -355
- package/dist/domain/ingest/serial-context.js.map +0 -1
- package/dist/domain/ingest/state-identity.d.ts +0 -2
- package/dist/domain/ingest/state-identity.js +0 -3
- package/dist/domain/ingest/state-identity.js.map +0 -1
- package/dist/domain/ingest/state-reconcile.d.ts +0 -12
- package/dist/domain/ingest/state-reconcile.js +0 -92
- package/dist/domain/ingest/state-reconcile.js.map +0 -1
- package/dist/domain/ingest/validation.d.ts +0 -1
- package/dist/domain/ingest/validation.js +0 -2
- package/dist/domain/ingest/validation.js.map +0 -1
- package/dist/domain/ingest/video-apply.d.ts +0 -4
- package/dist/domain/ingest/video-apply.js +0 -128
- package/dist/domain/ingest/video-apply.js.map +0 -1
- package/dist/domain/ingest/video-context.d.ts +0 -64
- package/dist/domain/ingest/video-context.js +0 -480
- package/dist/domain/ingest/video-context.js.map +0 -1
- package/dist/domain/ingest/video-records.d.ts +0 -57
- package/dist/domain/ingest/video-records.js +0 -9
- package/dist/domain/ingest/video-records.js.map +0 -1
- package/dist/domain/ingest/video-serial-md.d.ts +0 -81
- package/dist/domain/ingest/video-serial-md.js +0 -297
- package/dist/domain/ingest/video-serial-md.js.map +0 -1
- package/dist/domain/ingest/video-source-evolution.d.ts +0 -25
- package/dist/domain/ingest/video-source-evolution.js +0 -40
- package/dist/domain/ingest/video-source-evolution.js.map +0 -1
- package/dist/domain/ingest/video-state-evidence.d.ts +0 -66
- package/dist/domain/ingest/video-state-evidence.js +0 -385
- package/dist/domain/ingest/video-state-evidence.js.map +0 -1
- package/dist/domain/ingest/video-timestamp.d.ts +0 -8
- package/dist/domain/ingest/video-timestamp.js +0 -26
- package/dist/domain/ingest/video-timestamp.js.map +0 -1
- package/dist/domain/loom/checkpointer.d.ts +0 -3
- package/dist/domain/loom/checkpointer.js +0 -30
- package/dist/domain/loom/checkpointer.js.map +0 -1
- package/dist/domain/loom/index.d.ts +0 -45
- package/dist/domain/loom/index.js +0 -277
- package/dist/domain/loom/index.js.map +0 -1
- package/dist/domain/loom/types.d.ts +0 -101
- package/dist/domain/loom/types.js +0 -2
- package/dist/domain/loom/types.js.map +0 -1
- package/dist/domain/script/address.d.ts +0 -1
- package/dist/domain/script/address.js +0 -2
- package/dist/domain/script/address.js.map +0 -1
- package/dist/domain/script/dispatch.d.ts +0 -18
- package/dist/domain/script/dispatch.js +0 -55
- package/dist/domain/script/dispatch.js.map +0 -1
- package/dist/domain/script/lookups.d.ts +0 -1
- package/dist/domain/script/lookups.js +0 -2
- package/dist/domain/script/lookups.js.map +0 -1
- package/dist/domain/script/migrations/registry.d.ts +0 -4
- package/dist/domain/script/migrations/registry.js +0 -76
- package/dist/domain/script/migrations/registry.js.map +0 -1
- package/dist/domain/script/migrations/types.d.ts +0 -17
- package/dist/domain/script/migrations/types.js +0 -2
- package/dist/domain/script/migrations/types.js.map +0 -1
- package/dist/domain/script/migrations/v3-to-v4.d.ts +0 -3
- package/dist/domain/script/migrations/v3-to-v4.js +0 -57
- package/dist/domain/script/migrations/v3-to-v4.js.map +0 -1
- package/dist/domain/script/names.d.ts +0 -1
- package/dist/domain/script/names.js +0 -2
- package/dist/domain/script/names.js.map +0 -1
- package/dist/domain/script/parse.d.ts +0 -1
- package/dist/domain/script/parse.js +0 -2
- package/dist/domain/script/parse.js.map +0 -1
- package/dist/domain/script/patch/apply.d.ts +0 -1
- package/dist/domain/script/patch/apply.js +0 -2
- package/dist/domain/script/patch/apply.js.map +0 -1
- package/dist/domain/script/patch/helpers.d.ts +0 -1
- package/dist/domain/script/patch/helpers.js +0 -2
- package/dist/domain/script/patch/helpers.js.map +0 -1
- package/dist/domain/script/patch/inline-speaker.d.ts +0 -1
- package/dist/domain/script/patch/inline-speaker.js +0 -2
- package/dist/domain/script/patch/inline-speaker.js.map +0 -1
- package/dist/domain/script/patch/ops-action.d.ts +0 -1
- package/dist/domain/script/patch/ops-action.js +0 -2
- package/dist/domain/script/patch/ops-action.js.map +0 -1
- package/dist/domain/script/patch/ops-asset.d.ts +0 -1
- package/dist/domain/script/patch/ops-asset.js +0 -2
- package/dist/domain/script/patch/ops-asset.js.map +0 -1
- package/dist/domain/script/patch/ops-dialogue.d.ts +0 -1
- package/dist/domain/script/patch/ops-dialogue.js +0 -2
- package/dist/domain/script/patch/ops-dialogue.js.map +0 -1
- package/dist/domain/script/patch/ops-extend.d.ts +0 -1
- package/dist/domain/script/patch/ops-extend.js +0 -2
- package/dist/domain/script/patch/ops-extend.js.map +0 -1
- package/dist/domain/script/patch/ops-meta.d.ts +0 -1
- package/dist/domain/script/patch/ops-meta.js +0 -2
- package/dist/domain/script/patch/ops-meta.js.map +0 -1
- package/dist/domain/script/patch/ops-scene.d.ts +0 -1
- package/dist/domain/script/patch/ops-scene.js +0 -2
- package/dist/domain/script/patch/ops-scene.js.map +0 -1
- package/dist/domain/script/patch/ops-state.d.ts +0 -1
- package/dist/domain/script/patch/ops-state.js +0 -2
- package/dist/domain/script/patch/ops-state.js.map +0 -1
- package/dist/domain/script/patch/registry.d.ts +0 -1
- package/dist/domain/script/patch/registry.js +0 -2
- package/dist/domain/script/patch/registry.js.map +0 -1
- package/dist/domain/script/patch/types.d.ts +0 -1
- package/dist/domain/script/patch/types.js +0 -2
- package/dist/domain/script/patch/types.js.map +0 -1
- package/dist/domain/script/refs.d.ts +0 -1
- package/dist/domain/script/refs.js +0 -2
- package/dist/domain/script/refs.js.map +0 -1
- package/dist/domain/script/scene-refs.d.ts +0 -1
- package/dist/domain/script/scene-refs.js +0 -2
- package/dist/domain/script/scene-refs.js.map +0 -1
- package/dist/domain/script/schema.d.ts +0 -1
- package/dist/domain/script/schema.js +0 -2
- package/dist/domain/script/schema.js.map +0 -1
- package/dist/domain/script/selector.d.ts +0 -1
- package/dist/domain/script/selector.js +0 -2
- package/dist/domain/script/selector.js.map +0 -1
- package/dist/domain/script/shared/regex.d.ts +0 -2
- package/dist/domain/script/shared/regex.js +0 -7
- package/dist/domain/script/shared/regex.js.map +0 -1
- package/dist/domain/script/shared/types.d.ts +0 -1
- package/dist/domain/script/shared/types.js +0 -5
- package/dist/domain/script/shared/types.js.map +0 -1
- package/dist/domain/script/shared/validation.d.ts +0 -1
- package/dist/domain/script/shared/validation.js +0 -3
- package/dist/domain/script/shared/validation.js.map +0 -1
- package/dist/domain/script/shared.d.ts +0 -15
- package/dist/domain/script/shared.js +0 -35
- package/dist/domain/script/shared.js.map +0 -1
- package/dist/domain/script/text-util.d.ts +0 -7
- package/dist/domain/script/text-util.js +0 -95
- package/dist/domain/script/text-util.js.map +0 -1
- package/dist/domain/script/timestamp.d.ts +0 -1
- package/dist/domain/script/timestamp.js +0 -3
- package/dist/domain/script/timestamp.js.map +0 -1
- package/dist/domain/script/types.d.ts +0 -1
- package/dist/domain/script/types.js +0 -2
- package/dist/domain/script/types.js.map +0 -1
- package/dist/domain/script/v3/address.d.ts +0 -32
- package/dist/domain/script/v3/address.js +0 -136
- package/dist/domain/script/v3/address.js.map +0 -1
- package/dist/domain/script/v3/lookups.d.ts +0 -33
- package/dist/domain/script/v3/lookups.js +0 -316
- package/dist/domain/script/v3/lookups.js.map +0 -1
- package/dist/domain/script/v3/ordinal.d.ts +0 -8
- package/dist/domain/script/v3/ordinal.js +0 -91
- package/dist/domain/script/v3/ordinal.js.map +0 -1
- package/dist/domain/script/v3/parse.d.ts +0 -3
- package/dist/domain/script/v3/parse.js +0 -164
- package/dist/domain/script/v3/parse.js.map +0 -1
- package/dist/domain/script/v3/patch/apply.d.ts +0 -2
- package/dist/domain/script/v3/patch/apply.js +0 -31
- package/dist/domain/script/v3/patch/apply.js.map +0 -1
- package/dist/domain/script/v3/patch/helpers.d.ts +0 -15
- package/dist/domain/script/v3/patch/helpers.js +0 -155
- package/dist/domain/script/v3/patch/helpers.js.map +0 -1
- package/dist/domain/script/v3/patch/inline-speaker.d.ts +0 -2
- package/dist/domain/script/v3/patch/inline-speaker.js +0 -50
- package/dist/domain/script/v3/patch/inline-speaker.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-action.d.ts +0 -12
- package/dist/domain/script/v3/patch/ops-action.js +0 -355
- package/dist/domain/script/v3/patch/ops-action.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-asset.d.ts +0 -14
- package/dist/domain/script/v3/patch/ops-asset.js +0 -347
- package/dist/domain/script/v3/patch/ops-asset.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-dialogue.d.ts +0 -2
- package/dist/domain/script/v3/patch/ops-dialogue.js +0 -21
- package/dist/domain/script/v3/patch/ops-dialogue.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-extend.d.ts +0 -8
- package/dist/domain/script/v3/patch/ops-extend.js +0 -122
- package/dist/domain/script/v3/patch/ops-extend.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-meta.d.ts +0 -5
- package/dist/domain/script/v3/patch/ops-meta.js +0 -82
- package/dist/domain/script/v3/patch/ops-meta.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-scene.d.ts +0 -6
- package/dist/domain/script/v3/patch/ops-scene.js +0 -351
- package/dist/domain/script/v3/patch/ops-scene.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-state.d.ts +0 -8
- package/dist/domain/script/v3/patch/ops-state.js +0 -155
- package/dist/domain/script/v3/patch/ops-state.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-timestamp.d.ts +0 -6
- package/dist/domain/script/v3/patch/ops-timestamp.js +0 -47
- package/dist/domain/script/v3/patch/ops-timestamp.js.map +0 -1
- package/dist/domain/script/v3/patch/registry.d.ts +0 -2
- package/dist/domain/script/v3/patch/registry.js +0 -56
- package/dist/domain/script/v3/patch/registry.js.map +0 -1
- package/dist/domain/script/v3/patch/types.d.ts +0 -10
- package/dist/domain/script/v3/patch/types.js +0 -2
- package/dist/domain/script/v3/patch/types.js.map +0 -1
- package/dist/domain/script/v3/refs.d.ts +0 -4
- package/dist/domain/script/v3/refs.js +0 -64
- package/dist/domain/script/v3/refs.js.map +0 -1
- package/dist/domain/script/v3/scene-refs.d.ts +0 -3
- package/dist/domain/script/v3/scene-refs.js +0 -35
- package/dist/domain/script/v3/scene-refs.js.map +0 -1
- package/dist/domain/script/v3/schema.d.ts +0 -6
- package/dist/domain/script/v3/schema.js +0 -58
- package/dist/domain/script/v3/schema.js.map +0 -1
- package/dist/domain/script/v3/selector.d.ts +0 -44
- package/dist/domain/script/v3/selector.js +0 -178
- package/dist/domain/script/v3/selector.js.map +0 -1
- package/dist/domain/script/v3/types.d.ts +0 -106
- package/dist/domain/script/v3/types.js +0 -2
- package/dist/domain/script/v3/types.js.map +0 -1
- package/dist/domain/script/v3/validation.d.ts +0 -2
- package/dist/domain/script/v3/validation.js +0 -2
- package/dist/domain/script/v3/validation.js.map +0 -1
- package/dist/domain/script/v4/address.d.ts +0 -61
- package/dist/domain/script/v4/address.js +0 -99
- package/dist/domain/script/v4/address.js.map +0 -1
- package/dist/domain/script/v4/factory.d.ts +0 -2
- package/dist/domain/script/v4/factory.js +0 -13
- package/dist/domain/script/v4/factory.js.map +0 -1
- package/dist/domain/script/v4/from-v3.d.ts +0 -29
- package/dist/domain/script/v4/from-v3.js +0 -307
- package/dist/domain/script/v4/from-v3.js.map +0 -1
- package/dist/domain/script/v4/ids.d.ts +0 -5
- package/dist/domain/script/v4/ids.js +0 -41
- package/dist/domain/script/v4/ids.js.map +0 -1
- package/dist/domain/script/v4/ordinal.d.ts +0 -3
- package/dist/domain/script/v4/ordinal.js +0 -66
- package/dist/domain/script/v4/ordinal.js.map +0 -1
- package/dist/domain/script/v4/parse.d.ts +0 -5
- package/dist/domain/script/v4/parse.js +0 -196
- package/dist/domain/script/v4/parse.js.map +0 -1
- package/dist/domain/script/v4/patch/apply.d.ts +0 -3
- package/dist/domain/script/v4/patch/apply.js +0 -24
- package/dist/domain/script/v4/patch/apply.js.map +0 -1
- package/dist/domain/script/v4/patch/helpers.d.ts +0 -32
- package/dist/domain/script/v4/patch/helpers.js +0 -138
- package/dist/domain/script/v4/patch/helpers.js.map +0 -1
- package/dist/domain/script/v4/patch/ops-action.d.ts +0 -13
- package/dist/domain/script/v4/patch/ops-action.js +0 -351
- package/dist/domain/script/v4/patch/ops-action.js.map +0 -1
- package/dist/domain/script/v4/patch/ops-asset.d.ts +0 -17
- package/dist/domain/script/v4/patch/ops-asset.js +0 -556
- package/dist/domain/script/v4/patch/ops-asset.js.map +0 -1
- package/dist/domain/script/v4/patch/ops-extend.d.ts +0 -11
- package/dist/domain/script/v4/patch/ops-extend.js +0 -103
- package/dist/domain/script/v4/patch/ops-extend.js.map +0 -1
- package/dist/domain/script/v4/patch/ops-meta.d.ts +0 -5
- package/dist/domain/script/v4/patch/ops-meta.js +0 -49
- package/dist/domain/script/v4/patch/ops-meta.js.map +0 -1
- package/dist/domain/script/v4/patch/ops-scene-ref.d.ts +0 -3
- package/dist/domain/script/v4/patch/ops-scene-ref.js +0 -74
- package/dist/domain/script/v4/patch/ops-scene-ref.js.map +0 -1
- package/dist/domain/script/v4/patch/ops-structure.d.ts +0 -6
- package/dist/domain/script/v4/patch/ops-structure.js +0 -236
- package/dist/domain/script/v4/patch/ops-structure.js.map +0 -1
- package/dist/domain/script/v4/patch/ops-timestamp.d.ts +0 -6
- package/dist/domain/script/v4/patch/ops-timestamp.js +0 -40
- package/dist/domain/script/v4/patch/ops-timestamp.js.map +0 -1
- package/dist/domain/script/v4/patch/registry.d.ts +0 -2
- package/dist/domain/script/v4/patch/registry.js +0 -53
- package/dist/domain/script/v4/patch/registry.js.map +0 -1
- package/dist/domain/script/v4/patch/schema.d.ts +0 -7
- package/dist/domain/script/v4/patch/schema.js +0 -77
- package/dist/domain/script/v4/patch/schema.js.map +0 -1
- package/dist/domain/script/v4/patch/types.d.ts +0 -10
- package/dist/domain/script/v4/patch/types.js +0 -2
- package/dist/domain/script/v4/patch/types.js.map +0 -1
- package/dist/domain/script/v4/selector.d.ts +0 -11
- package/dist/domain/script/v4/selector.js +0 -124
- package/dist/domain/script/v4/selector.js.map +0 -1
- package/dist/domain/script/v4/types.d.ts +0 -120
- package/dist/domain/script/v4/types.js +0 -2
- package/dist/domain/script/v4/types.js.map +0 -1
- package/dist/domain/script/v4/validation.d.ts +0 -2
- package/dist/domain/script/v4/validation.js +0 -2
- package/dist/domain/script/v4/validation.js.map +0 -1
- package/dist/failures.d.ts +0 -58
- package/dist/failures.js +0 -96
- package/dist/failures.js.map +0 -1
- package/dist/infra/converters.d.ts +0 -9
- package/dist/infra/converters.js +0 -689
- package/dist/infra/converters.js.map +0 -1
- package/dist/infra/env.d.ts +0 -2
- package/dist/infra/env.js +0 -81
- package/dist/infra/env.js.map +0 -1
- package/dist/infra/episode-title.d.ts +0 -4
- package/dist/infra/episode-title.js +0 -129
- package/dist/infra/episode-title.js.map +0 -1
- package/dist/infra/ingest/review-renderer.d.ts +0 -1
- package/dist/infra/ingest/review-renderer.js +0 -440
- package/dist/infra/ingest/review-renderer.js.map +0 -1
- package/dist/infra/ingest/source-resolver.d.ts +0 -21
- package/dist/infra/ingest/source-resolver.js +0 -51
- package/dist/infra/ingest/source-resolver.js.map +0 -1
- package/dist/infra/ingest/text-reader.d.ts +0 -3
- package/dist/infra/ingest/text-reader.js +0 -27
- package/dist/infra/ingest/text-reader.js.map +0 -1
- package/dist/infra/ingest/video-discovery.d.ts +0 -8
- package/dist/infra/ingest/video-discovery.js +0 -69
- package/dist/infra/ingest/video-discovery.js.map +0 -1
- package/dist/infra/ingest/video-source-snapshot.d.ts +0 -4
- package/dist/infra/ingest/video-source-snapshot.js +0 -47
- package/dist/infra/ingest/video-source-snapshot.js.map +0 -1
- package/dist/infra/ingest/video-state-evidence.d.ts +0 -14
- package/dist/infra/ingest/video-state-evidence.js +0 -140
- package/dist/infra/ingest/video-state-evidence.js.map +0 -1
- package/dist/infra/ingest/video-transcode.d.ts +0 -7
- package/dist/infra/ingest/video-transcode.js +0 -98
- package/dist/infra/ingest/video-transcode.js.map +0 -1
- package/dist/infra/ingest/workspace-lock.d.ts +0 -1
- package/dist/infra/ingest/workspace-lock.js +0 -32
- package/dist/infra/ingest/workspace-lock.js.map +0 -1
- package/dist/infra/ingest/workspace-store.d.ts +0 -18
- package/dist/infra/ingest/workspace-store.js +0 -70
- package/dist/infra/ingest/workspace-store.js.map +0 -1
- package/dist/infra/llm/anthropic-model.d.ts +0 -11
- package/dist/infra/llm/anthropic-model.js +0 -130
- package/dist/infra/llm/anthropic-model.js.map +0 -1
- package/dist/infra/llm/doubao-model.d.ts +0 -60
- package/dist/infra/llm/doubao-model.js +0 -249
- package/dist/infra/llm/doubao-model.js.map +0 -1
- package/dist/infra/llm/failure-mapping.d.ts +0 -6
- package/dist/infra/llm/failure-mapping.js +0 -146
- package/dist/infra/llm/failure-mapping.js.map +0 -1
- package/dist/infra/llm/gemini-upload.d.ts +0 -13
- package/dist/infra/llm/gemini-upload.js +0 -138
- package/dist/infra/llm/gemini-upload.js.map +0 -1
- package/dist/infra/llm/gemini-video-model.d.ts +0 -50
- package/dist/infra/llm/gemini-video-model.js +0 -371
- package/dist/infra/llm/gemini-video-model.js.map +0 -1
- package/dist/infra/llm/openai-compatible-model.d.ts +0 -14
- package/dist/infra/llm/openai-compatible-model.js +0 -207
- package/dist/infra/llm/openai-compatible-model.js.map +0 -1
- package/dist/infra/llm/retry.d.ts +0 -8
- package/dist/infra/llm/retry.js +0 -41
- package/dist/infra/llm/retry.js.map +0 -1
- package/dist/infra/local-script-output-store.d.ts +0 -43
- package/dist/infra/local-script-output-store.js +0 -168
- package/dist/infra/local-script-output-store.js.map +0 -1
- package/dist/infra/script-output-api.d.ts +0 -50
- package/dist/infra/script-output-api.js +0 -251
- package/dist/infra/script-output-api.js.map +0 -1
- package/dist/infra/script-output-store.d.ts +0 -152
- package/dist/infra/script-output-store.js +0 -114
- package/dist/infra/script-output-store.js.map +0 -1
- package/dist/infra/script-working-copy.d.ts +0 -23
- package/dist/infra/script-working-copy.js +0 -157
- package/dist/infra/script-working-copy.js.map +0 -1
- package/dist/infra/storage.d.ts +0 -35
- package/dist/infra/storage.js +0 -91
- package/dist/infra/storage.js.map +0 -1
- package/dist/llm/composition.d.ts +0 -5
- package/dist/llm/composition.js +0 -5
- package/dist/llm/composition.js.map +0 -1
- package/dist/llm/config.d.ts +0 -28
- package/dist/llm/config.js +0 -231
- package/dist/llm/config.js.map +0 -1
- package/dist/llm/registry.d.ts +0 -43
- package/dist/llm/registry.js +0 -69
- package/dist/llm/registry.js.map +0 -1
- package/dist/llm/router.d.ts +0 -46
- package/dist/llm/router.js +0 -512
- package/dist/llm/router.js.map +0 -1
- package/dist/llm/tasks/ingest/arc-summary.d.ts +0 -8
- package/dist/llm/tasks/ingest/arc-summary.js +0 -26
- package/dist/llm/tasks/ingest/arc-summary.js.map +0 -1
- package/dist/llm/tasks/ingest/asset-audit.d.ts +0 -6
- package/dist/llm/tasks/ingest/asset-audit.js +0 -158
- package/dist/llm/tasks/ingest/asset-audit.js.map +0 -1
- package/dist/llm/tasks/ingest/asset-curate.d.ts +0 -13
- package/dist/llm/tasks/ingest/asset-curate.js +0 -45
- package/dist/llm/tasks/ingest/asset-curate.js.map +0 -1
- package/dist/llm/tasks/ingest/asset-extract.d.ts +0 -12
- package/dist/llm/tasks/ingest/asset-extract.js +0 -51
- package/dist/llm/tasks/ingest/asset-extract.js.map +0 -1
- package/dist/llm/tasks/ingest/asset-govern.d.ts +0 -22
- package/dist/llm/tasks/ingest/asset-govern.js +0 -143
- package/dist/llm/tasks/ingest/asset-govern.js.map +0 -1
- package/dist/llm/tasks/ingest/body-start.d.ts +0 -10
- package/dist/llm/tasks/ingest/body-start.js +0 -41
- package/dist/llm/tasks/ingest/body-start.js.map +0 -1
- package/dist/llm/tasks/ingest/episode-assets.d.ts +0 -29
- package/dist/llm/tasks/ingest/episode-assets.js +0 -282
- package/dist/llm/tasks/ingest/episode-assets.js.map +0 -1
- package/dist/llm/tasks/ingest/mention-resolve.d.ts +0 -9
- package/dist/llm/tasks/ingest/mention-resolve.js +0 -39
- package/dist/llm/tasks/ingest/mention-resolve.js.map +0 -1
- package/dist/llm/tasks/ingest/name-fix.d.ts +0 -9
- package/dist/llm/tasks/ingest/name-fix.js +0 -56
- package/dist/llm/tasks/ingest/name-fix.js.map +0 -1
- package/dist/llm/tasks/ingest/state-reconcile.d.ts +0 -8
- package/dist/llm/tasks/ingest/state-reconcile.js +0 -44
- package/dist/llm/tasks/ingest/state-reconcile.js.map +0 -1
- package/dist/llm/tasks/ingest/text-normalize.d.ts +0 -10
- package/dist/llm/tasks/ingest/text-normalize.js +0 -122
- package/dist/llm/tasks/ingest/text-normalize.js.map +0 -1
- package/dist/llm/tasks/ingest/video-serial.d.ts +0 -14
- package/dist/llm/tasks/ingest/video-serial.js +0 -391
- package/dist/llm/tasks/ingest/video-serial.js.map +0 -1
- package/dist/llm/tasks/schemas.d.ts +0 -9
- package/dist/llm/tasks/schemas.js +0 -466
- package/dist/llm/tasks/schemas.js.map +0 -1
- package/dist/llm/types.d.ts +0 -178
- package/dist/llm/types.js +0 -44
- package/dist/llm/types.js.map +0 -1
- package/dist/output.d.ts +0 -3
- package/dist/output.js +0 -94
- package/dist/output.js.map +0 -1
- package/dist/package-root.d.ts +0 -2
- package/dist/package-root.js +0 -38
- package/dist/package-root.js.map +0 -1
- package/dist/review-agent.js.map +0 -7
- package/dist/usecases/changelog.d.ts +0 -9
- package/dist/usecases/changelog.js +0 -134
- package/dist/usecases/changelog.js.map +0 -1
- package/dist/usecases/doctor.d.ts +0 -2
- package/dist/usecases/doctor.js +0 -231
- package/dist/usecases/doctor.js.map +0 -1
- package/dist/usecases/ingest/body-start.d.ts +0 -8
- package/dist/usecases/ingest/body-start.js +0 -36
- package/dist/usecases/ingest/body-start.js.map +0 -1
- package/dist/usecases/ingest/command.d.ts +0 -5
- package/dist/usecases/ingest/command.js +0 -183
- package/dist/usecases/ingest/command.js.map +0 -1
- package/dist/usecases/ingest/failure.d.ts +0 -26
- package/dist/usecases/ingest/failure.js +0 -151
- package/dist/usecases/ingest/failure.js.map +0 -1
- package/dist/usecases/ingest/fanout.d.ts +0 -10
- package/dist/usecases/ingest/fanout.js +0 -23
- package/dist/usecases/ingest/fanout.js.map +0 -1
- package/dist/usecases/ingest/final-asset-audit.d.ts +0 -39
- package/dist/usecases/ingest/final-asset-audit.js +0 -88
- package/dist/usecases/ingest/final-asset-audit.js.map +0 -1
- package/dist/usecases/ingest/generate-video-state-evidence.d.ts +0 -23
- package/dist/usecases/ingest/generate-video-state-evidence.js +0 -124
- package/dist/usecases/ingest/generate-video-state-evidence.js.map +0 -1
- package/dist/usecases/ingest/pass4-mention-resolve.d.ts +0 -11
- package/dist/usecases/ingest/pass4-mention-resolve.js +0 -52
- package/dist/usecases/ingest/pass4-mention-resolve.js.map +0 -1
- package/dist/usecases/ingest/pass5-extract.d.ts +0 -7
- package/dist/usecases/ingest/pass5-extract.js +0 -51
- package/dist/usecases/ingest/pass5-extract.js.map +0 -1
- package/dist/usecases/ingest/pass5-govern.d.ts +0 -13
- package/dist/usecases/ingest/pass5-govern.js +0 -157
- package/dist/usecases/ingest/pass5-govern.js.map +0 -1
- package/dist/usecases/ingest/pipeline.d.ts +0 -28
- package/dist/usecases/ingest/pipeline.js +0 -335
- package/dist/usecases/ingest/pipeline.js.map +0 -1
- package/dist/usecases/ingest/publish-command.d.ts +0 -1
- package/dist/usecases/ingest/publish-command.js +0 -4
- package/dist/usecases/ingest/publish-command.js.map +0 -1
- package/dist/usecases/ingest/serial-govern.d.ts +0 -40
- package/dist/usecases/ingest/serial-govern.js +0 -488
- package/dist/usecases/ingest/serial-govern.js.map +0 -1
- package/dist/usecases/ingest/skip-video-episode.d.ts +0 -4
- package/dist/usecases/ingest/skip-video-episode.js +0 -120
- package/dist/usecases/ingest/skip-video-episode.js.map +0 -1
- package/dist/usecases/ingest/status.d.ts +0 -61
- package/dist/usecases/ingest/status.js +0 -347
- package/dist/usecases/ingest/status.js.map +0 -1
- package/dist/usecases/ingest/timings.d.ts +0 -51
- package/dist/usecases/ingest/timings.js +0 -68
- package/dist/usecases/ingest/timings.js.map +0 -1
- package/dist/usecases/ingest/usage-report.d.ts +0 -125
- package/dist/usecases/ingest/usage-report.js +0 -248
- package/dist/usecases/ingest/usage-report.js.map +0 -1
- package/dist/usecases/ingest/video-pipeline.d.ts +0 -81
- package/dist/usecases/ingest/video-pipeline.js +0 -547
- package/dist/usecases/ingest/video-pipeline.js.map +0 -1
- package/dist/usecases/ingest/video-skip-state.d.ts +0 -29
- package/dist/usecases/ingest/video-skip-state.js +0 -148
- package/dist/usecases/ingest/video-skip-state.js.map +0 -1
- package/dist/usecases/ingest/view-command.d.ts +0 -4
- package/dist/usecases/ingest/view-command.js +0 -67
- package/dist/usecases/ingest/view-command.js.map +0 -1
- package/dist/usecases/ingest/view-server.d.ts +0 -29
- package/dist/usecases/ingest/view-server.js +0 -364
- package/dist/usecases/ingest/view-server.js.map +0 -1
- package/dist/usecases/script/action-span.d.ts +0 -10
- package/dist/usecases/script/action-span.js +0 -42
- package/dist/usecases/script/action-span.js.map +0 -1
- package/dist/usecases/script/actions.d.ts +0 -3
- package/dist/usecases/script/actions.js +0 -184
- package/dist/usecases/script/actions.js.map +0 -1
- package/dist/usecases/script/actor.d.ts +0 -3
- package/dist/usecases/script/actor.js +0 -26
- package/dist/usecases/script/actor.js.map +0 -1
- package/dist/usecases/script/actors.d.ts +0 -3
- package/dist/usecases/script/actors.js +0 -25
- package/dist/usecases/script/actors.js.map +0 -1
- package/dist/usecases/script/add-actor.d.ts +0 -3
- package/dist/usecases/script/add-actor.js +0 -13
- package/dist/usecases/script/add-actor.js.map +0 -1
- package/dist/usecases/script/add-episode.d.ts +0 -3
- package/dist/usecases/script/add-episode.js +0 -9
- package/dist/usecases/script/add-episode.js.map +0 -1
- package/dist/usecases/script/add-location.d.ts +0 -3
- package/dist/usecases/script/add-location.js +0 -11
- package/dist/usecases/script/add-location.js.map +0 -1
- package/dist/usecases/script/add-prop.d.ts +0 -3
- package/dist/usecases/script/add-prop.js +0 -11
- package/dist/usecases/script/add-prop.js.map +0 -1
- package/dist/usecases/script/alias.d.ts +0 -3
- package/dist/usecases/script/alias.js +0 -39
- package/dist/usecases/script/alias.js.map +0 -1
- package/dist/usecases/script/assets.d.ts +0 -3
- package/dist/usecases/script/assets.js +0 -46
- package/dist/usecases/script/assets.js.map +0 -1
- package/dist/usecases/script/audit-assets.d.ts +0 -4
- package/dist/usecases/script/audit-assets.js +0 -37
- package/dist/usecases/script/audit-assets.js.map +0 -1
- package/dist/usecases/script/command-constraints.d.ts +0 -38
- package/dist/usecases/script/command-constraints.js +0 -143
- package/dist/usecases/script/command-constraints.js.map +0 -1
- package/dist/usecases/script/compose-creative-draft.d.ts +0 -3
- package/dist/usecases/script/compose-creative-draft.js +0 -106
- package/dist/usecases/script/compose-creative-draft.js.map +0 -1
- package/dist/usecases/script/context.d.ts +0 -3
- package/dist/usecases/script/context.js +0 -52
- package/dist/usecases/script/context.js.map +0 -1
- package/dist/usecases/script/create.d.ts +0 -3
- package/dist/usecases/script/create.js +0 -27
- package/dist/usecases/script/create.js.map +0 -1
- package/dist/usecases/script/delete.d.ts +0 -3
- package/dist/usecases/script/delete.js +0 -88
- package/dist/usecases/script/delete.js.map +0 -1
- package/dist/usecases/script/describe.d.ts +0 -3
- package/dist/usecases/script/describe.js +0 -32
- package/dist/usecases/script/describe.js.map +0 -1
- package/dist/usecases/script/dialogue.d.ts +0 -3
- package/dist/usecases/script/dialogue.js +0 -30
- package/dist/usecases/script/dialogue.js.map +0 -1
- package/dist/usecases/script/dispatch.d.ts +0 -3
- package/dist/usecases/script/dispatch.js +0 -10
- package/dist/usecases/script/dispatch.js.map +0 -1
- package/dist/usecases/script/do.d.ts +0 -3
- package/dist/usecases/script/do.js +0 -186
- package/dist/usecases/script/do.js.map +0 -1
- package/dist/usecases/script/emotion.d.ts +0 -3
- package/dist/usecases/script/emotion.js +0 -24
- package/dist/usecases/script/emotion.js.map +0 -1
- package/dist/usecases/script/episodes.d.ts +0 -3
- package/dist/usecases/script/episodes.js +0 -62
- package/dist/usecases/script/episodes.js.map +0 -1
- package/dist/usecases/script/export-authoring.d.ts +0 -4
- package/dist/usecases/script/export-authoring.js +0 -326
- package/dist/usecases/script/export-authoring.js.map +0 -1
- package/dist/usecases/script/extend.d.ts +0 -3
- package/dist/usecases/script/extend.js +0 -94
- package/dist/usecases/script/extend.js.map +0 -1
- package/dist/usecases/script/ids.d.ts +0 -3
- package/dist/usecases/script/ids.js +0 -148
- package/dist/usecases/script/ids.js.map +0 -1
- package/dist/usecases/script/importance.d.ts +0 -3
- package/dist/usecases/script/importance.js +0 -16
- package/dist/usecases/script/importance.js.map +0 -1
- package/dist/usecases/script/insert.d.ts +0 -3
- package/dist/usecases/script/insert.js +0 -127
- package/dist/usecases/script/insert.js.map +0 -1
- package/dist/usecases/script/issues.d.ts +0 -3
- package/dist/usecases/script/issues.js +0 -35
- package/dist/usecases/script/issues.js.map +0 -1
- package/dist/usecases/script/lib.d.ts +0 -152
- package/dist/usecases/script/lib.js +0 -1654
- package/dist/usecases/script/lib.js.map +0 -1
- package/dist/usecases/script/locations.d.ts +0 -3
- package/dist/usecases/script/locations.js +0 -25
- package/dist/usecases/script/locations.js.map +0 -1
- package/dist/usecases/script/merge.d.ts +0 -3
- package/dist/usecases/script/merge.js +0 -43
- package/dist/usecases/script/merge.js.map +0 -1
- package/dist/usecases/script/migrate.d.ts +0 -3
- package/dist/usecases/script/migrate.js +0 -210
- package/dist/usecases/script/migrate.js.map +0 -1
- package/dist/usecases/script/move.d.ts +0 -3
- package/dist/usecases/script/move.js +0 -50
- package/dist/usecases/script/move.js.map +0 -1
- package/dist/usecases/script/parenthetical.d.ts +0 -3
- package/dist/usecases/script/parenthetical.js +0 -52
- package/dist/usecases/script/parenthetical.js.map +0 -1
- package/dist/usecases/script/props.d.ts +0 -3
- package/dist/usecases/script/props.js +0 -25
- package/dist/usecases/script/props.js.map +0 -1
- package/dist/usecases/script/refs.d.ts +0 -3
- package/dist/usecases/script/refs.js +0 -111
- package/dist/usecases/script/refs.js.map +0 -1
- package/dist/usecases/script/rename.d.ts +0 -3
- package/dist/usecases/script/rename.js +0 -35
- package/dist/usecases/script/rename.js.map +0 -1
- package/dist/usecases/script/replace.d.ts +0 -3
- package/dist/usecases/script/replace.js +0 -33
- package/dist/usecases/script/replace.js.map +0 -1
- package/dist/usecases/script/review.d.ts +0 -3
- package/dist/usecases/script/review.js +0 -187
- package/dist/usecases/script/review.js.map +0 -1
- package/dist/usecases/script/role.d.ts +0 -3
- package/dist/usecases/script/role.js +0 -16
- package/dist/usecases/script/role.js.map +0 -1
- package/dist/usecases/script/scenes.d.ts +0 -3
- package/dist/usecases/script/scenes.js +0 -66
- package/dist/usecases/script/scenes.js.map +0 -1
- package/dist/usecases/script/script-patch.d.ts +0 -3
- package/dist/usecases/script/script-patch.js +0 -321
- package/dist/usecases/script/script-patch.js.map +0 -1
- package/dist/usecases/script/script-validate.d.ts +0 -3
- package/dist/usecases/script/script-validate.js +0 -27
- package/dist/usecases/script/script-validate.js.map +0 -1
- package/dist/usecases/script/session.d.ts +0 -62
- package/dist/usecases/script/session.js +0 -567
- package/dist/usecases/script/session.js.map +0 -1
- package/dist/usecases/script/split.d.ts +0 -3
- package/dist/usecases/script/split.js +0 -41
- package/dist/usecases/script/split.js.map +0 -1
- package/dist/usecases/script/state-add.d.ts +0 -3
- package/dist/usecases/script/state-add.js +0 -22
- package/dist/usecases/script/state-add.js.map +0 -1
- package/dist/usecases/script/state-delete.d.ts +0 -3
- package/dist/usecases/script/state-delete.js +0 -22
- package/dist/usecases/script/state-delete.js.map +0 -1
- package/dist/usecases/script/state-rename.d.ts +0 -3
- package/dist/usecases/script/state-rename.js +0 -16
- package/dist/usecases/script/state-rename.js.map +0 -1
- package/dist/usecases/script/states.d.ts +0 -3
- package/dist/usecases/script/states.js +0 -197
- package/dist/usecases/script/states.js.map +0 -1
- package/dist/usecases/script/summary.d.ts +0 -3
- package/dist/usecases/script/summary.js +0 -72
- package/dist/usecases/script/summary.js.map +0 -1
- package/dist/usecases/script/synopsis-generate.d.ts +0 -115
- package/dist/usecases/script/synopsis-generate.js +0 -776
- package/dist/usecases/script/synopsis-generate.js.map +0 -1
- package/dist/usecases/script/synopsis.d.ts +0 -3
- package/dist/usecases/script/synopsis.js +0 -45
- package/dist/usecases/script/synopsis.js.map +0 -1
- package/dist/usecases/script/timestamp-filter.d.ts +0 -4
- package/dist/usecases/script/timestamp-filter.js +0 -55
- package/dist/usecases/script/timestamp-filter.js.map +0 -1
- package/dist/usecases/script/timestamp.d.ts +0 -3
- package/dist/usecases/script/timestamp.js +0 -11
- package/dist/usecases/script/timestamp.js.map +0 -1
- package/dist/usecases/script/transition.d.ts +0 -3
- package/dist/usecases/script/transition.js +0 -23
- package/dist/usecases/script/transition.js.map +0 -1
- package/dist/usecases/script/type.d.ts +0 -3
- package/dist/usecases/script/type.js +0 -23
- package/dist/usecases/script/type.js.map +0 -1
- package/dist/usecases/script/v3/mutations.d.ts +0 -2
- package/dist/usecases/script/v3/mutations.js +0 -5
- package/dist/usecases/script/v3/mutations.js.map +0 -1
- package/dist/usecases/script/v4/mutations.d.ts +0 -2
- package/dist/usecases/script/v4/mutations.js +0 -6
- package/dist/usecases/script/v4/mutations.js.map +0 -1
- package/dist/usecases/script/v4/queries.d.ts +0 -15
- package/dist/usecases/script/v4/queries.js +0 -196
- package/dist/usecases/script/v4/queries.js.map +0 -1
- package/dist/usecases/script/working-copy.d.ts +0 -5
- package/dist/usecases/script/working-copy.js +0 -399
- package/dist/usecases/script/working-copy.js.map +0 -1
- package/dist/usecases/script/worldview.d.ts +0 -3
- package/dist/usecases/script/worldview.js +0 -17
- package/dist/usecases/script/worldview.js.map +0 -1
- package/dist/usecases/script/write-authoring.d.ts +0 -3
- package/dist/usecases/script/write-authoring.js +0 -263
- package/dist/usecases/script/write-authoring.js.map +0 -1
- package/dist/usecases/update.d.ts +0 -13
- package/dist/usecases/update.js +0 -128
- package/dist/usecases/update.js.map +0 -1
|
@@ -1,776 +0,0 @@
|
|
|
1
|
-
import * as path from "node:path";
|
|
2
|
-
import { CliError, DEFAULT_CONCURRENCY, EXIT_OK, EXIT_RUNTIME, EXIT_USAGE, directDir, sha256Text, } from "../../common.js";
|
|
3
|
-
import { fileCheckpointer, llm, loom, } from "../../domain/loom/index.js";
|
|
4
|
-
import { asList, isDict, strOf, } from "../../domain/script/shared.js";
|
|
5
|
-
import { sceneRefs } from "../../domain/script/scene-refs.js";
|
|
6
|
-
import { PRODUCTION_LLM_COMPOSITION } from "../../llm/composition.js";
|
|
7
|
-
import { loadScriptForEdit, saveScriptSession, syncValidationResult, validateSession, } from "./session.js";
|
|
8
|
-
import { summarizeIssues } from "../../domain/script/text-util.js";
|
|
9
|
-
export const DEFAULT_SYNOPSIS_GENERATE_CONFIG = {
|
|
10
|
-
episodeInputMaxChars: 6000,
|
|
11
|
-
episodeChunkTargetChars: 4800,
|
|
12
|
-
arcEpisodeCount: 10,
|
|
13
|
-
finalMaxInputChars: 12000,
|
|
14
|
-
};
|
|
15
|
-
const CHUNK_INSTRUCTION = "从当前剧本片段中提取剧情梗概和关键事件。只基于当前片段,不要推测后续。";
|
|
16
|
-
export const CHUNK_FORMAT = [
|
|
17
|
-
"输出格式:一个纯文本结构化文档。不要包裹代码块,不要在文档前后添加解释。",
|
|
18
|
-
"",
|
|
19
|
-
"## 片段梗概",
|
|
20
|
-
"<如果当前集只有一个片段,写 200-300 字;如果当前集被切成多个片段,写 80-150 字。按发生顺序概括,只写当前片段。>",
|
|
21
|
-
"",
|
|
22
|
-
"## 关键事件",
|
|
23
|
-
"- <事件1>",
|
|
24
|
-
"- <事件2>",
|
|
25
|
-
"",
|
|
26
|
-
"## 人物变化",
|
|
27
|
-
"- <人物名> | <变化>",
|
|
28
|
-
"",
|
|
29
|
-
"## 结尾钩子",
|
|
30
|
-
"<有则写一句;没有则留空>",
|
|
31
|
-
].join("\n");
|
|
32
|
-
const EPISODE_INSTRUCTION = "把同一集的多个片段梗概合并为一集梗概。只使用输入片段,不要新增剧情。";
|
|
33
|
-
export const EPISODE_FORMAT = [
|
|
34
|
-
"输出格式:一个纯文本结构化文档。不要包裹代码块,不要在文档前后添加解释。",
|
|
35
|
-
"",
|
|
36
|
-
"## 分集梗概",
|
|
37
|
-
"<200-300 字,按剧情发生顺序写成连贯段落。>",
|
|
38
|
-
"",
|
|
39
|
-
"## 单句梗概",
|
|
40
|
-
"<30-50 字,概括本集主线。>",
|
|
41
|
-
"",
|
|
42
|
-
"## 关键事件",
|
|
43
|
-
"- <事件1>",
|
|
44
|
-
"- <事件2>",
|
|
45
|
-
].join("\n");
|
|
46
|
-
const ARC_INSTRUCTION = "把一组连续分集梗概压缩为阶段梗概。只使用输入分集,不要新增剧情。";
|
|
47
|
-
export const ARC_FORMAT = [
|
|
48
|
-
"输出格式:一个纯文本结构化文档。不要包裹代码块,不要在文档前后添加解释。",
|
|
49
|
-
"",
|
|
50
|
-
"## 阶段梗概",
|
|
51
|
-
"<400-600 字,概括这一阶段的主线推进。>",
|
|
52
|
-
"",
|
|
53
|
-
"## 关键转折",
|
|
54
|
-
"- <转折1>",
|
|
55
|
-
"- <转折2>",
|
|
56
|
-
"",
|
|
57
|
-
"## 未解决悬念",
|
|
58
|
-
"- <悬念1>",
|
|
59
|
-
].join("\n");
|
|
60
|
-
const FINAL_INSTRUCTION = "根据分集索引和阶段梗概生成全剧总览。只使用输入内容,不要新增剧情、人物或关系。";
|
|
61
|
-
export const FINAL_FORMAT = [
|
|
62
|
-
"输出格式:一个纯文本结构化文档。不要包裹代码块,不要在文档前后添加解释。",
|
|
63
|
-
"",
|
|
64
|
-
"## 全文梗概",
|
|
65
|
-
"<800-1200 字,覆盖全剧主线、关键关系、主要冲突和结局走向。>",
|
|
66
|
-
"",
|
|
67
|
-
"## 主题",
|
|
68
|
-
"<一句话或一个短语>",
|
|
69
|
-
"",
|
|
70
|
-
"## 一句话",
|
|
71
|
-
"<一句完整 logline>",
|
|
72
|
-
"",
|
|
73
|
-
"## 风格",
|
|
74
|
-
"<类型 / 气质 / 叙事风格>",
|
|
75
|
-
"",
|
|
76
|
-
"## 主要人物",
|
|
77
|
-
"- <名字> | <角色定位>",
|
|
78
|
-
].join("\n");
|
|
79
|
-
export function renderEpisodeSource(script, episode, index) {
|
|
80
|
-
const episodeId = strOf(episode["episode_id"]).trim() || `ep_${String(index + 1).padStart(3, "0")}`;
|
|
81
|
-
const episodeNo = episodeNumber(episodeId, index);
|
|
82
|
-
const title = strOf(episode["title"]).trim();
|
|
83
|
-
const lines = [];
|
|
84
|
-
const scriptTitle = strOf(script["title"]).trim();
|
|
85
|
-
if (scriptTitle)
|
|
86
|
-
lines.push(`剧名:${scriptTitle}`);
|
|
87
|
-
lines.push(`集数:第${episodeNo}集`);
|
|
88
|
-
if (title)
|
|
89
|
-
lines.push(`标题:${title}`);
|
|
90
|
-
lines.push("");
|
|
91
|
-
for (const scene of asList(episode["scenes"])) {
|
|
92
|
-
lines.push(renderSceneHeader(script, scene));
|
|
93
|
-
for (const action of asList(scene["actions"])) {
|
|
94
|
-
const rendered = renderAction(script, action);
|
|
95
|
-
if (rendered)
|
|
96
|
-
lines.push(rendered);
|
|
97
|
-
}
|
|
98
|
-
lines.push("");
|
|
99
|
-
}
|
|
100
|
-
return {
|
|
101
|
-
episodeIndex: index,
|
|
102
|
-
episodeId,
|
|
103
|
-
episodeNo,
|
|
104
|
-
title,
|
|
105
|
-
existingSynopsis: strOf(episode["synopsis"]).trim(),
|
|
106
|
-
text: lines.join("\n").trim(),
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
export function splitEpisodeSource(source, config = DEFAULT_SYNOPSIS_GENERATE_CONFIG) {
|
|
110
|
-
const rawLines = source.text.split(/\r?\n/);
|
|
111
|
-
const lines = rawLines.flatMap((line) => splitLongLine(line, config.episodeChunkTargetChars));
|
|
112
|
-
if (source.text.length <= config.episodeInputMaxChars && lines.length === rawLines.length) {
|
|
113
|
-
return [{
|
|
114
|
-
episodeIndex: source.episodeIndex,
|
|
115
|
-
episodeId: source.episodeId,
|
|
116
|
-
episodeNo: source.episodeNo,
|
|
117
|
-
title: source.title,
|
|
118
|
-
part: 1,
|
|
119
|
-
partCount: 1,
|
|
120
|
-
text: source.text,
|
|
121
|
-
sourceHash: sha256Text(source.text),
|
|
122
|
-
}];
|
|
123
|
-
}
|
|
124
|
-
const chunks = [];
|
|
125
|
-
let current = [];
|
|
126
|
-
let currentChars = 0;
|
|
127
|
-
for (const line of lines) {
|
|
128
|
-
const lineChars = line.length + (current.length > 0 ? 1 : 0);
|
|
129
|
-
if (current.length > 0 && currentChars + lineChars > config.episodeChunkTargetChars) {
|
|
130
|
-
chunks.push(current.join("\n").trim());
|
|
131
|
-
current = [];
|
|
132
|
-
currentChars = 0;
|
|
133
|
-
}
|
|
134
|
-
const nextLineChars = line.length + (current.length > 0 ? 1 : 0);
|
|
135
|
-
current.push(line);
|
|
136
|
-
currentChars += nextLineChars;
|
|
137
|
-
}
|
|
138
|
-
if (current.length > 0)
|
|
139
|
-
chunks.push(current.join("\n").trim());
|
|
140
|
-
return chunks.map((text, idx) => ({
|
|
141
|
-
episodeIndex: source.episodeIndex,
|
|
142
|
-
episodeId: source.episodeId,
|
|
143
|
-
episodeNo: source.episodeNo,
|
|
144
|
-
title: source.title,
|
|
145
|
-
part: idx + 1,
|
|
146
|
-
partCount: chunks.length,
|
|
147
|
-
text,
|
|
148
|
-
sourceHash: sha256Text(text),
|
|
149
|
-
}));
|
|
150
|
-
}
|
|
151
|
-
export function parseChunkBrief(text, chunk) {
|
|
152
|
-
const sections = sectionMap(text);
|
|
153
|
-
return {
|
|
154
|
-
episodeIndex: chunk.episodeIndex,
|
|
155
|
-
episodeId: chunk.episodeId,
|
|
156
|
-
episodeNo: chunk.episodeNo,
|
|
157
|
-
title: chunk.title,
|
|
158
|
-
part: chunk.part,
|
|
159
|
-
partCount: chunk.partCount,
|
|
160
|
-
synopsis: requiredSection(sections, "片段梗概"),
|
|
161
|
-
events: parseBullets(sections.get("关键事件") ?? ""),
|
|
162
|
-
characterChanges: parseCharacterChanges(sections.get("人物变化") ?? ""),
|
|
163
|
-
hook: (sections.get("结尾钩子") ?? "").trim(),
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
export function reduceChunkBriefs(items, ctx) {
|
|
167
|
-
const source = requireScope(ctx.scope, "episode");
|
|
168
|
-
const ordered = [...items].sort((a, b) => a.part - b.part);
|
|
169
|
-
return {
|
|
170
|
-
episodeIndex: source.episodeIndex,
|
|
171
|
-
episodeId: source.episodeId,
|
|
172
|
-
episodeNo: source.episodeNo,
|
|
173
|
-
title: source.title,
|
|
174
|
-
synopsis: ordered.map((item) => item.synopsis).filter((s) => s.trim()).join("\n"),
|
|
175
|
-
oneLine: firstNonEmpty(ordered.map((item) => item.synopsis)),
|
|
176
|
-
events: uniqueStrings(ordered.flatMap((item) => item.events)),
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
export function parseEpisodeBrief(text, source) {
|
|
180
|
-
const sections = sectionMap(text);
|
|
181
|
-
return {
|
|
182
|
-
episodeIndex: source.episodeIndex,
|
|
183
|
-
episodeId: source.episodeId,
|
|
184
|
-
episodeNo: source.episodeNo,
|
|
185
|
-
title: source.title,
|
|
186
|
-
synopsis: requiredSection(sections, "分集梗概"),
|
|
187
|
-
oneLine: requiredSection(sections, "单句梗概"),
|
|
188
|
-
events: parseBullets(sections.get("关键事件") ?? ""),
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
export function buildArcParcels(episodes, arcEpisodeCount) {
|
|
192
|
-
const parcels = [];
|
|
193
|
-
for (let i = 0; i < episodes.length; i += arcEpisodeCount) {
|
|
194
|
-
const group = episodes.slice(i, i + arcEpisodeCount);
|
|
195
|
-
const first = group[0];
|
|
196
|
-
const last = group[group.length - 1];
|
|
197
|
-
parcels.push({
|
|
198
|
-
index: parcels.length + 1,
|
|
199
|
-
startEpisodeNo: first.episodeNo,
|
|
200
|
-
endEpisodeNo: last.episodeNo,
|
|
201
|
-
text: renderEpisodeBriefs(group),
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
return parcels;
|
|
205
|
-
}
|
|
206
|
-
export function buildArcParcelsFromArcs(arcs, fanout) {
|
|
207
|
-
const parcels = [];
|
|
208
|
-
for (let i = 0; i < arcs.length; i += fanout) {
|
|
209
|
-
const group = arcs.slice(i, i + fanout);
|
|
210
|
-
const first = group[0];
|
|
211
|
-
const last = group[group.length - 1];
|
|
212
|
-
parcels.push({
|
|
213
|
-
index: parcels.length + 1,
|
|
214
|
-
startEpisodeNo: first.startEpisodeNo,
|
|
215
|
-
endEpisodeNo: last.endEpisodeNo,
|
|
216
|
-
text: renderArcBriefs(group),
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
return parcels;
|
|
220
|
-
}
|
|
221
|
-
export function parseArcBrief(text, parcel) {
|
|
222
|
-
const sections = sectionMap(text);
|
|
223
|
-
return {
|
|
224
|
-
index: parcel.index,
|
|
225
|
-
startEpisodeNo: parcel.startEpisodeNo,
|
|
226
|
-
endEpisodeNo: parcel.endEpisodeNo,
|
|
227
|
-
synopsis: requiredSection(sections, "阶段梗概"),
|
|
228
|
-
turns: parseBullets(sections.get("关键转折") ?? ""),
|
|
229
|
-
openQuestions: parseBullets(sections.get("未解决悬念") ?? ""),
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
export function reduceArcBriefs(items) {
|
|
233
|
-
const ordered = [...items].sort((a, b) => a.startEpisodeNo - b.startEpisodeNo);
|
|
234
|
-
const first = ordered[0];
|
|
235
|
-
const last = ordered[ordered.length - 1];
|
|
236
|
-
if (!first || !last)
|
|
237
|
-
throw new Error("arc reduce requires at least one item");
|
|
238
|
-
return {
|
|
239
|
-
index: first.index,
|
|
240
|
-
startEpisodeNo: first.startEpisodeNo,
|
|
241
|
-
endEpisodeNo: last.endEpisodeNo,
|
|
242
|
-
synopsis: ordered.map((item) => `第${item.startEpisodeNo}-${item.endEpisodeNo}集:${item.synopsis}`).join("\n"),
|
|
243
|
-
turns: uniqueStrings(ordered.flatMap((item) => item.turns)),
|
|
244
|
-
openQuestions: uniqueStrings(ordered.flatMap((item) => item.openQuestions)),
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
export function renderFinalInput(episodes, arcs) {
|
|
248
|
-
const lines = ["分集索引:"];
|
|
249
|
-
for (const ep of [...episodes].sort((a, b) => a.episodeNo - b.episodeNo)) {
|
|
250
|
-
lines.push(`第${ep.episodeNo}集:${ep.oneLine || ep.synopsis}`);
|
|
251
|
-
}
|
|
252
|
-
lines.push("", "阶段梗概:");
|
|
253
|
-
for (const arc of [...arcs].sort((a, b) => a.startEpisodeNo - b.startEpisodeNo)) {
|
|
254
|
-
lines.push(`第${arc.startEpisodeNo}-${arc.endEpisodeNo}集:${arc.synopsis}`);
|
|
255
|
-
}
|
|
256
|
-
return lines.join("\n");
|
|
257
|
-
}
|
|
258
|
-
export function parseScriptOverview(text) {
|
|
259
|
-
const sections = sectionMap(text);
|
|
260
|
-
return {
|
|
261
|
-
synopsis: requiredSection(sections, "全文梗概"),
|
|
262
|
-
theme: requiredSection(sections, "主题"),
|
|
263
|
-
logline: requiredSection(sections, "一句话"),
|
|
264
|
-
style: requiredSection(sections, "风格"),
|
|
265
|
-
mainCharacters: parseMainCharacters(requiredSection(sections, "主要人物")),
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
export async function generateSynopsisFromScript(opts) {
|
|
269
|
-
const config = opts.config ?? DEFAULT_SYNOPSIS_GENERATE_CONFIG;
|
|
270
|
-
const episodes = asList(opts.script["episodes"]);
|
|
271
|
-
if (episodes.length === 0) {
|
|
272
|
-
throw new CliError("No episodes found in script.", {
|
|
273
|
-
exitCode: EXIT_USAGE,
|
|
274
|
-
errorCode: "SCRIPT_EPISODES_MISSING",
|
|
275
|
-
hint: "Create or parse episodes before generating synopsis.",
|
|
276
|
-
data: { expected: ["script.episodes[] with at least one episode"], actual: ["episodes: 0"] },
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
const allSources = episodes.map((episode, index) => renderEpisodeSource(opts.script, episode, index));
|
|
280
|
-
const sources = opts.overwrite ? allSources : allSources.filter((source) => !source.existingSynopsis);
|
|
281
|
-
const episodeRun = sources.length === 0
|
|
282
|
-
? []
|
|
283
|
-
: await loom(opts.script)
|
|
284
|
-
.split({
|
|
285
|
-
scope: "episode",
|
|
286
|
-
partition: () => sources,
|
|
287
|
-
chunk: (source) => splitEpisodeSource(source, config),
|
|
288
|
-
})
|
|
289
|
-
.extract(llm({
|
|
290
|
-
taskId: "synopsis.chunk",
|
|
291
|
-
instruction: CHUNK_INSTRUCTION,
|
|
292
|
-
format: CHUNK_FORMAT,
|
|
293
|
-
input: ({ parcel }) => renderChunkInput(parcel),
|
|
294
|
-
parse: ({ text, parcel }) => parseChunkBrief(text, parcel),
|
|
295
|
-
}))
|
|
296
|
-
.reduce("episode", reduceChunkBriefs)
|
|
297
|
-
.extract(llm({
|
|
298
|
-
taskId: "synopsis.episode",
|
|
299
|
-
instruction: EPISODE_INSTRUCTION,
|
|
300
|
-
format: EPISODE_FORMAT,
|
|
301
|
-
input: ({ parcel }) => renderEpisodeReduceInput(parcel),
|
|
302
|
-
parse: ({ text, parcel }) => parseEpisodeBrief(text, parcel),
|
|
303
|
-
}))
|
|
304
|
-
.reduce("root", (items) => [...items].sort((a, b) => a.episodeNo - b.episodeNo))
|
|
305
|
-
.run({
|
|
306
|
-
concurrency: opts.concurrency,
|
|
307
|
-
checkpoint: fileCheckpointer(path.join(opts.checkpointDir, "episode")),
|
|
308
|
-
checkpointSalt: opts.checkpointSalt,
|
|
309
|
-
executor: opts.executor,
|
|
310
|
-
});
|
|
311
|
-
const generatedEpisodeBriefs = Array.isArray(episodeRun) ? episodeRun : episodeRun.value;
|
|
312
|
-
const byIndex = new Map(generatedEpisodeBriefs.map((brief) => [brief.episodeIndex, brief]));
|
|
313
|
-
const episodeBriefs = allSources.map((source) => byIndex.get(source.episodeIndex) ?? {
|
|
314
|
-
episodeIndex: source.episodeIndex,
|
|
315
|
-
episodeId: source.episodeId,
|
|
316
|
-
episodeNo: source.episodeNo,
|
|
317
|
-
title: source.title,
|
|
318
|
-
synopsis: source.existingSynopsis,
|
|
319
|
-
oneLine: synopsisPreviewLine(source.existingSynopsis),
|
|
320
|
-
events: [],
|
|
321
|
-
});
|
|
322
|
-
const missing = episodeBriefs.filter((brief) => !brief.synopsis.trim()).map((brief) => brief.episodeId);
|
|
323
|
-
if (missing.length > 0) {
|
|
324
|
-
throw new CliError("Some episode synopses are still missing.", {
|
|
325
|
-
exitCode: EXIT_RUNTIME,
|
|
326
|
-
errorCode: "EPISODE_SYNOPSIS_MISSING",
|
|
327
|
-
hint: "Use --overwrite to regenerate, or manually set missing episode synopses.",
|
|
328
|
-
data: { expected: ["every episode has synopsis"], actual: missing },
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
const overviewNeeded = opts.overwrite || scriptOverviewMissing(opts.script);
|
|
332
|
-
const arcRun = overviewNeeded
|
|
333
|
-
? await generateArcBriefs({
|
|
334
|
-
episodes: episodeBriefs,
|
|
335
|
-
executor: opts.executor,
|
|
336
|
-
checkpointDir: path.join(opts.checkpointDir, "arc"),
|
|
337
|
-
checkpointSalt: opts.checkpointSalt,
|
|
338
|
-
concurrency: opts.concurrency,
|
|
339
|
-
config,
|
|
340
|
-
})
|
|
341
|
-
: { value: [], report: { reused: 0, ran: 0 } };
|
|
342
|
-
const overviewRun = overviewNeeded
|
|
343
|
-
? await generateScriptOverview({
|
|
344
|
-
episodes: episodeBriefs,
|
|
345
|
-
arcs: arcRun.value,
|
|
346
|
-
executor: opts.executor,
|
|
347
|
-
checkpointDir: path.join(opts.checkpointDir, "final"),
|
|
348
|
-
checkpointSalt: opts.checkpointSalt,
|
|
349
|
-
config,
|
|
350
|
-
})
|
|
351
|
-
: { value: existingScriptOverview(opts.script), report: { reused: 0, ran: 0 } };
|
|
352
|
-
return {
|
|
353
|
-
episodeBriefs,
|
|
354
|
-
overview: overviewRun.value,
|
|
355
|
-
overviewGenerated: overviewNeeded,
|
|
356
|
-
report: {
|
|
357
|
-
reused: (Array.isArray(episodeRun) ? 0 : episodeRun.report.reused) + arcRun.report.reused + overviewRun.report.reused,
|
|
358
|
-
ran: (Array.isArray(episodeRun) ? 0 : episodeRun.report.ran) + arcRun.report.ran + overviewRun.report.ran,
|
|
359
|
-
},
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
export async function commandSynopsisGenerate(opts, composition = PRODUCTION_LLM_COMPOSITION) {
|
|
363
|
-
const concurrency = parsePositiveInt(opts["concurrency"], DEFAULT_CONCURRENCY, "--concurrency");
|
|
364
|
-
const overwrite = Boolean(opts["overwrite"]);
|
|
365
|
-
const apply = Boolean(opts["apply"]);
|
|
366
|
-
const dryRun = Boolean(opts["dry_run"]);
|
|
367
|
-
if (apply && dryRun) {
|
|
368
|
-
throw new CliError("--apply and --dry-run are mutually exclusive.", {
|
|
369
|
-
exitCode: EXIT_USAGE,
|
|
370
|
-
errorCode: "SYNOPSIS_GENERATE_FLAG_CONFLICT",
|
|
371
|
-
hint: "Pick one mode and retry.",
|
|
372
|
-
data: { expected: ["at most one of --apply / --dry-run"], actual: ["--apply", "--dry-run"] },
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
const workspace = strOf(opts["workspace_path"] || "workspace");
|
|
376
|
-
const session = await loadScriptForEdit(opts);
|
|
377
|
-
const executor = composition.createExecutor(strOf(opts["llm_config"]).trim() || undefined);
|
|
378
|
-
const checkpoint = strOf(opts["checkpoint"]).trim() || path.join(directDir(workspace), "loom", "synopsis-generate");
|
|
379
|
-
const result = await generateSynopsisFromScript({
|
|
380
|
-
script: session.script,
|
|
381
|
-
executor,
|
|
382
|
-
checkpointDir: checkpoint,
|
|
383
|
-
concurrency,
|
|
384
|
-
overwrite,
|
|
385
|
-
});
|
|
386
|
-
const changedEpisodeIds = new Set();
|
|
387
|
-
const scriptEpisodes = asList(session.script["episodes"]);
|
|
388
|
-
for (const brief of result.episodeBriefs) {
|
|
389
|
-
const episode = scriptEpisodes[brief.episodeIndex];
|
|
390
|
-
if (episode && (overwrite || !strOf(episode["synopsis"]).trim())) {
|
|
391
|
-
if (strOf(episode["synopsis"]) !== brief.synopsis) {
|
|
392
|
-
episode["synopsis"] = brief.synopsis;
|
|
393
|
-
changedEpisodeIds.add(brief.episodeId);
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
let overviewChanged = false;
|
|
398
|
-
overviewChanged = setTextField(session.script, "synopsis", result.overview.synopsis, overwrite) || overviewChanged;
|
|
399
|
-
overviewChanged = setTextField(session.script, "theme", result.overview.theme, overwrite) || overviewChanged;
|
|
400
|
-
overviewChanged = setTextField(session.script, "logline", result.overview.logline, overwrite) || overviewChanged;
|
|
401
|
-
overviewChanged = setTextField(session.script, "style", result.overview.style, overwrite) || overviewChanged;
|
|
402
|
-
if (overwrite || asList(session.script["main_characters"]).length === 0) {
|
|
403
|
-
const nextMainCharacters = result.overview.mainCharacters.map((item) => ({ name: item.name, role: item.role }));
|
|
404
|
-
if (JSON.stringify(session.script["main_characters"] ?? []) !== JSON.stringify(nextMainCharacters)) {
|
|
405
|
-
session.script["main_characters"] = nextMainCharacters;
|
|
406
|
-
overviewChanged = true;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
const hasChanges = changedEpisodeIds.size > 0 || overviewChanged;
|
|
410
|
-
const validation = validateSession(session);
|
|
411
|
-
const passed = Boolean(validation["passed"]);
|
|
412
|
-
const resultLines = [
|
|
413
|
-
`${result.episodeBriefs.length} episodes; ${changedEpisodeIds.size} synopses ${apply ? "written" : "would change"}; overview ${result.overviewGenerated ? "generated" : "reused"}; validation ${passed ? (apply ? "passed" : "would pass") : apply ? "needs repair" : "would need repair"}${apply ? "" : "; dry-run, no write"}`,
|
|
414
|
-
`loom: ran=${result.report.ran}, reused=${result.report.reused}`,
|
|
415
|
-
`llm config: ${executor.configSource}; routes: ${executor.usage().length}`,
|
|
416
|
-
];
|
|
417
|
-
let revision;
|
|
418
|
-
let idempotent;
|
|
419
|
-
if (apply && hasChanges) {
|
|
420
|
-
[revision, idempotent] = await saveScriptSession(session, opts, "synopsis.generate");
|
|
421
|
-
await syncValidationResult(session, validation, revision);
|
|
422
|
-
if (session.remote)
|
|
423
|
-
resultLines.push(`revision ${revision}; idempotent ${String(idempotent).toLowerCase()}`);
|
|
424
|
-
}
|
|
425
|
-
const issues = summarizeIssues(asList(validation["issues"]));
|
|
426
|
-
if (!apply)
|
|
427
|
-
resultLines.push("Run again with --apply to write the generated synopsis fields.");
|
|
428
|
-
const report = {
|
|
429
|
-
text: [...resultLines, ...issues].join("\n"),
|
|
430
|
-
data: {
|
|
431
|
-
op: apply ? "synopsis.generate" : "synopsis.generate.dry-run",
|
|
432
|
-
changed: apply && hasChanges,
|
|
433
|
-
revision,
|
|
434
|
-
idempotent,
|
|
435
|
-
validation,
|
|
436
|
-
issues,
|
|
437
|
-
script_path: session.artifactLabel,
|
|
438
|
-
episode_synopses: result.episodeBriefs.map((brief) => ({
|
|
439
|
-
episode_id: brief.episodeId,
|
|
440
|
-
title: brief.title,
|
|
441
|
-
synopsis: brief.synopsis,
|
|
442
|
-
one_line: brief.oneLine,
|
|
443
|
-
})),
|
|
444
|
-
config_source: executor.configSource,
|
|
445
|
-
llm_routes: executor.usage(),
|
|
446
|
-
},
|
|
447
|
-
};
|
|
448
|
-
return [report, EXIT_OK];
|
|
449
|
-
}
|
|
450
|
-
function splitLongLine(line, maxChars) {
|
|
451
|
-
if (line.length <= maxChars)
|
|
452
|
-
return [line];
|
|
453
|
-
const parts = [];
|
|
454
|
-
for (let i = 0; i < line.length; i += maxChars) {
|
|
455
|
-
parts.push(line.slice(i, i + maxChars));
|
|
456
|
-
}
|
|
457
|
-
return parts;
|
|
458
|
-
}
|
|
459
|
-
async function generateArcBriefs(opts) {
|
|
460
|
-
let current = buildArcParcels(opts.episodes, opts.config.arcEpisodeCount);
|
|
461
|
-
let level = 1;
|
|
462
|
-
const report = { reused: 0, ran: 0 };
|
|
463
|
-
while (true) {
|
|
464
|
-
const run = await loom(current)
|
|
465
|
-
.split({
|
|
466
|
-
scope: "arc",
|
|
467
|
-
partition: (parcels) => parcels,
|
|
468
|
-
chunk: (parcel) => [parcel],
|
|
469
|
-
})
|
|
470
|
-
.extract(llm({
|
|
471
|
-
taskId: "synopsis.arc",
|
|
472
|
-
instruction: ARC_INSTRUCTION,
|
|
473
|
-
format: ARC_FORMAT,
|
|
474
|
-
input: ({ parcel }) => renderArcInput(parcel),
|
|
475
|
-
parse: ({ text, parcel }) => parseArcBrief(text, parcel),
|
|
476
|
-
}))
|
|
477
|
-
.reduce("arc", (items) => requireSingle(items, "arc"))
|
|
478
|
-
.reduce("root", (items) => [...items].sort((a, b) => a.startEpisodeNo - b.startEpisodeNo))
|
|
479
|
-
.run({
|
|
480
|
-
concurrency: opts.concurrency,
|
|
481
|
-
checkpoint: fileCheckpointer(path.join(opts.checkpointDir, `level-${level}`)),
|
|
482
|
-
checkpointSalt: opts.checkpointSalt,
|
|
483
|
-
executor: opts.executor,
|
|
484
|
-
});
|
|
485
|
-
report.reused += run.report.reused;
|
|
486
|
-
report.ran += run.report.ran;
|
|
487
|
-
const briefs = run.value;
|
|
488
|
-
const finalInput = renderFinalInput(opts.episodes, briefs);
|
|
489
|
-
if (finalInput.length <= opts.config.finalMaxInputChars || briefs.length <= 1)
|
|
490
|
-
return { value: briefs, report };
|
|
491
|
-
current = buildArcParcelsFromArcs(briefs, opts.config.arcEpisodeCount);
|
|
492
|
-
level += 1;
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
async function generateScriptOverview(opts) {
|
|
496
|
-
let arcs = opts.arcs;
|
|
497
|
-
while (renderFinalInput(opts.episodes, arcs).length > opts.config.finalMaxInputChars && arcs.length > 1) {
|
|
498
|
-
arcs = [reduceArcBriefs(arcs)];
|
|
499
|
-
}
|
|
500
|
-
const run = await loom({ episodes: opts.episodes, arcs })
|
|
501
|
-
.extract(llm({
|
|
502
|
-
taskId: "synopsis.script-overview",
|
|
503
|
-
instruction: FINAL_INSTRUCTION,
|
|
504
|
-
format: FINAL_FORMAT,
|
|
505
|
-
input: ({ parcel }) => renderFinalInput(parcel.episodes, parcel.arcs),
|
|
506
|
-
parse: ({ text }) => parseScriptOverview(text),
|
|
507
|
-
}))
|
|
508
|
-
.run({
|
|
509
|
-
concurrency: 1,
|
|
510
|
-
checkpoint: fileCheckpointer(opts.checkpointDir),
|
|
511
|
-
checkpointSalt: opts.checkpointSalt,
|
|
512
|
-
executor: opts.executor,
|
|
513
|
-
});
|
|
514
|
-
return { value: run.value, report: run.report };
|
|
515
|
-
}
|
|
516
|
-
function renderSceneHeader(script, scene) {
|
|
517
|
-
const env = isDict(scene["environment"]) ? scene["environment"] : {};
|
|
518
|
-
const space = strOf(env["space"]).trim();
|
|
519
|
-
const time = strOf(env["time"]).trim();
|
|
520
|
-
const refs = sceneRefs(scene);
|
|
521
|
-
const locations = asList(refs["locations"]).map((ref) => assetName(script, "locations", "location_id", "location_name", strOf(ref["location_id"]))).filter((s) => s);
|
|
522
|
-
const actors = asList(refs["actors"]).map((ref) => assetName(script, "actors", "actor_id", "actor_name", strOf(ref["actor_id"]))).filter((s) => s);
|
|
523
|
-
const location = locations.join("、") || "-";
|
|
524
|
-
const envText = [space, time].filter((s) => s).join(" ");
|
|
525
|
-
return `[场景] ${envText || "-"}|${location}|出场:${actors.join("、") || "-"}`;
|
|
526
|
-
}
|
|
527
|
-
function renderAction(script, action) {
|
|
528
|
-
const type = strOf(action["type"]).trim();
|
|
529
|
-
if (type === "dialogue") {
|
|
530
|
-
const speaker = actionSpeakerName(script, action);
|
|
531
|
-
const content = strOf(action["content"]).trim();
|
|
532
|
-
return content ? `[对白] ${speaker ? `${speaker}:` : ""}${content}` : "";
|
|
533
|
-
}
|
|
534
|
-
if (type === "inner_thought") {
|
|
535
|
-
const speaker = actionSpeakerName(script, action);
|
|
536
|
-
const content = strOf(action["content"]).trim();
|
|
537
|
-
return content ? `[心声] ${speaker ? `${speaker}:` : ""}${content}` : "";
|
|
538
|
-
}
|
|
539
|
-
const content = strOf(action["content"]).trim();
|
|
540
|
-
return content ? `[动作] ${content}` : "";
|
|
541
|
-
}
|
|
542
|
-
function actionSpeakerName(script, action) {
|
|
543
|
-
// v3: a single inline speaker — an actor ref, or a non-actor kind with a label.
|
|
544
|
-
const s = action["speaker"];
|
|
545
|
-
if (!isDict(s))
|
|
546
|
-
return "";
|
|
547
|
-
const actorId = strOf(s["actor_id"]).trim();
|
|
548
|
-
if (actorId)
|
|
549
|
-
return assetName(script, "actors", "actor_id", "actor_name", actorId) || actorId;
|
|
550
|
-
const kind = strOf(s["kind"]).trim();
|
|
551
|
-
if (kind)
|
|
552
|
-
return strOf(s["label"]).trim() || kind;
|
|
553
|
-
return "";
|
|
554
|
-
}
|
|
555
|
-
function assetName(script, collection, idKey, nameKey, id) {
|
|
556
|
-
const item = asList(script[collection]).find((entry) => strOf(entry[idKey]) === id);
|
|
557
|
-
return item ? strOf(item[nameKey]).trim() : "";
|
|
558
|
-
}
|
|
559
|
-
function episodeNumber(episodeId, index) {
|
|
560
|
-
const m = /^ep_(\d+)$/.exec(episodeId);
|
|
561
|
-
return m ? Number(m[1]) : index + 1;
|
|
562
|
-
}
|
|
563
|
-
function sectionMap(text) {
|
|
564
|
-
const sections = new Map();
|
|
565
|
-
let current = null;
|
|
566
|
-
let lines = [];
|
|
567
|
-
const flush = () => {
|
|
568
|
-
if (current)
|
|
569
|
-
sections.set(current, lines.join("\n").trim());
|
|
570
|
-
lines = [];
|
|
571
|
-
};
|
|
572
|
-
for (const rawLine of text.split(/\r?\n/)) {
|
|
573
|
-
const heading = parseSectionHeading(rawLine);
|
|
574
|
-
if (heading) {
|
|
575
|
-
if (current === heading.name && heading.inline) {
|
|
576
|
-
lines.push(rawLine);
|
|
577
|
-
continue;
|
|
578
|
-
}
|
|
579
|
-
flush();
|
|
580
|
-
current = heading.name;
|
|
581
|
-
if (heading.inline)
|
|
582
|
-
lines.push(heading.inline);
|
|
583
|
-
continue;
|
|
584
|
-
}
|
|
585
|
-
if (current)
|
|
586
|
-
lines.push(rawLine);
|
|
587
|
-
}
|
|
588
|
-
flush();
|
|
589
|
-
return sections;
|
|
590
|
-
}
|
|
591
|
-
const SYNOPSIS_SECTION_NAMES = new Set([
|
|
592
|
-
"片段梗概",
|
|
593
|
-
"关键事件",
|
|
594
|
-
"人物变化",
|
|
595
|
-
"结尾钩子",
|
|
596
|
-
"分集梗概",
|
|
597
|
-
"单句梗概",
|
|
598
|
-
"阶段梗概",
|
|
599
|
-
"关键转折",
|
|
600
|
-
"未解决悬念",
|
|
601
|
-
"全文梗概",
|
|
602
|
-
"主题",
|
|
603
|
-
"一句话",
|
|
604
|
-
"风格",
|
|
605
|
-
"主要人物",
|
|
606
|
-
]);
|
|
607
|
-
function parseSectionHeading(rawLine) {
|
|
608
|
-
const line = rawLine.trim();
|
|
609
|
-
const md = /^#{1,6}\s+(.+?)\s*$/.exec(line);
|
|
610
|
-
if (md) {
|
|
611
|
-
const name = md[1].trim();
|
|
612
|
-
return SYNOPSIS_SECTION_NAMES.has(name) ? { name, inline: "" } : null;
|
|
613
|
-
}
|
|
614
|
-
const colon = line.search(/[::]/);
|
|
615
|
-
const name = (colon >= 0 ? line.slice(0, colon) : line).trim();
|
|
616
|
-
if (!SYNOPSIS_SECTION_NAMES.has(name))
|
|
617
|
-
return null;
|
|
618
|
-
return { name, inline: colon >= 0 ? line.slice(colon + 1).trim() : "" };
|
|
619
|
-
}
|
|
620
|
-
function requiredSection(sections, name) {
|
|
621
|
-
const value = (sections.get(name) ?? "").trim();
|
|
622
|
-
if (!value)
|
|
623
|
-
throw new Error(`synopsis output missing section: ${name}`);
|
|
624
|
-
return value;
|
|
625
|
-
}
|
|
626
|
-
function parseBullets(text) {
|
|
627
|
-
return text.split(/\r?\n/)
|
|
628
|
-
.map((line) => line.trim())
|
|
629
|
-
.map((line) => line.replace(/^[-*]\s*/, "").trim())
|
|
630
|
-
.filter((line) => line.length > 0);
|
|
631
|
-
}
|
|
632
|
-
function parseCharacterChanges(text) {
|
|
633
|
-
return parseBullets(text).map((line) => {
|
|
634
|
-
const [name, ...rest] = line.split("|");
|
|
635
|
-
return { name: strOf(name).trim(), change: rest.join("|").trim() };
|
|
636
|
-
}).filter((item) => item.name && item.change);
|
|
637
|
-
}
|
|
638
|
-
function parseMainCharacters(text) {
|
|
639
|
-
return parseBullets(text).map((line) => {
|
|
640
|
-
const [name, ...rest] = line.split("|");
|
|
641
|
-
return { name: strOf(name).trim(), role: rest.join("|").trim() };
|
|
642
|
-
}).filter((item) => item.name && item.role);
|
|
643
|
-
}
|
|
644
|
-
function renderChunkInput(chunk) {
|
|
645
|
-
return [
|
|
646
|
-
`当前分集:第${chunk.episodeNo}集 ${chunk.title || ""}`.trim(),
|
|
647
|
-
`当前片段:${chunk.part}/${chunk.partCount}`,
|
|
648
|
-
"",
|
|
649
|
-
"这是当前任务的原文:",
|
|
650
|
-
chunk.text,
|
|
651
|
-
].join("\n");
|
|
652
|
-
}
|
|
653
|
-
function renderEpisodeReduceInput(episode) {
|
|
654
|
-
return [
|
|
655
|
-
`当前分集:第${episode.episodeNo}集 ${episode.title || ""}`.trim(),
|
|
656
|
-
"",
|
|
657
|
-
"片段梗概:",
|
|
658
|
-
episode.synopsis,
|
|
659
|
-
"",
|
|
660
|
-
"片段关键事件:",
|
|
661
|
-
...episode.events.map((event) => `- ${event}`),
|
|
662
|
-
].join("\n");
|
|
663
|
-
}
|
|
664
|
-
function renderEpisodeBriefs(episodes) {
|
|
665
|
-
const lines = [];
|
|
666
|
-
for (const ep of episodes) {
|
|
667
|
-
lines.push(`第${ep.episodeNo}集 ${ep.title || ""}`.trim());
|
|
668
|
-
lines.push(`单句:${ep.oneLine}`);
|
|
669
|
-
lines.push(`梗概:${ep.synopsis}`);
|
|
670
|
-
if (ep.events.length > 0) {
|
|
671
|
-
lines.push("关键事件:");
|
|
672
|
-
for (const event of ep.events)
|
|
673
|
-
lines.push(`- ${event}`);
|
|
674
|
-
}
|
|
675
|
-
lines.push("");
|
|
676
|
-
}
|
|
677
|
-
return lines.join("\n").trim();
|
|
678
|
-
}
|
|
679
|
-
function renderArcBriefs(arcs) {
|
|
680
|
-
const lines = [];
|
|
681
|
-
for (const arc of arcs) {
|
|
682
|
-
lines.push(`第${arc.startEpisodeNo}-${arc.endEpisodeNo}集`);
|
|
683
|
-
lines.push(`阶段梗概:${arc.synopsis}`);
|
|
684
|
-
if (arc.turns.length > 0) {
|
|
685
|
-
lines.push("关键转折:");
|
|
686
|
-
for (const turn of arc.turns)
|
|
687
|
-
lines.push(`- ${turn}`);
|
|
688
|
-
}
|
|
689
|
-
if (arc.openQuestions.length > 0) {
|
|
690
|
-
lines.push("未解决悬念:");
|
|
691
|
-
for (const q of arc.openQuestions)
|
|
692
|
-
lines.push(`- ${q}`);
|
|
693
|
-
}
|
|
694
|
-
lines.push("");
|
|
695
|
-
}
|
|
696
|
-
return lines.join("\n").trim();
|
|
697
|
-
}
|
|
698
|
-
function renderArcInput(parcel) {
|
|
699
|
-
return [
|
|
700
|
-
`当前阶段:第${parcel.startEpisodeNo}-${parcel.endEpisodeNo}集`,
|
|
701
|
-
"",
|
|
702
|
-
"分集梗概:",
|
|
703
|
-
parcel.text,
|
|
704
|
-
].join("\n");
|
|
705
|
-
}
|
|
706
|
-
function requireScope(scope, name) {
|
|
707
|
-
if (scope === null)
|
|
708
|
-
throw new Error(`${name} scope missing`);
|
|
709
|
-
return scope;
|
|
710
|
-
}
|
|
711
|
-
function requireSingle(items, name) {
|
|
712
|
-
const item = items[0];
|
|
713
|
-
if (!item || items.length !== 1)
|
|
714
|
-
throw new Error(`${name} reduce requires exactly one item`);
|
|
715
|
-
return item;
|
|
716
|
-
}
|
|
717
|
-
function firstNonEmpty(values) {
|
|
718
|
-
return values.map((value) => value.trim()).find((value) => value.length > 0) ?? "";
|
|
719
|
-
}
|
|
720
|
-
function uniqueStrings(values) {
|
|
721
|
-
const seen = new Set();
|
|
722
|
-
const out = [];
|
|
723
|
-
for (const value of values.map((v) => v.trim()).filter((v) => v.length > 0)) {
|
|
724
|
-
if (seen.has(value))
|
|
725
|
-
continue;
|
|
726
|
-
seen.add(value);
|
|
727
|
-
out.push(value);
|
|
728
|
-
}
|
|
729
|
-
return out;
|
|
730
|
-
}
|
|
731
|
-
function synopsisPreviewLine(text) {
|
|
732
|
-
const clean = text.replace(/\s+/g, " ").trim();
|
|
733
|
-
return clean.length > 50 ? clean.slice(0, 50) : clean;
|
|
734
|
-
}
|
|
735
|
-
function parsePositiveInt(value, fallback, label) {
|
|
736
|
-
if (value === undefined || value === null || value === "")
|
|
737
|
-
return fallback;
|
|
738
|
-
const n = Number(value);
|
|
739
|
-
if (!Number.isFinite(n) || n <= 0) {
|
|
740
|
-
throw new CliError(`${label} must be a positive integer.`, {
|
|
741
|
-
exitCode: EXIT_USAGE,
|
|
742
|
-
errorCode: "NUMERIC_OPTION_INVALID",
|
|
743
|
-
hint: `Pass ${label} ${fallback}.`,
|
|
744
|
-
data: { expected: [`${label}: positive integer`], actual: [strOf(value)] },
|
|
745
|
-
});
|
|
746
|
-
}
|
|
747
|
-
return Math.floor(n);
|
|
748
|
-
}
|
|
749
|
-
function setTextField(script, key, value, overwrite) {
|
|
750
|
-
if (!overwrite && strOf(script[key]).trim())
|
|
751
|
-
return false;
|
|
752
|
-
if (strOf(script[key]) === value)
|
|
753
|
-
return false;
|
|
754
|
-
script[key] = value;
|
|
755
|
-
return true;
|
|
756
|
-
}
|
|
757
|
-
function scriptOverviewMissing(script) {
|
|
758
|
-
return !strOf(script["synopsis"]).trim()
|
|
759
|
-
|| !strOf(script["theme"]).trim()
|
|
760
|
-
|| !strOf(script["logline"]).trim()
|
|
761
|
-
|| !strOf(script["style"]).trim()
|
|
762
|
-
|| asList(script["main_characters"]).length === 0;
|
|
763
|
-
}
|
|
764
|
-
function existingScriptOverview(script) {
|
|
765
|
-
return {
|
|
766
|
-
synopsis: strOf(script["synopsis"]).trim(),
|
|
767
|
-
theme: strOf(script["theme"]).trim(),
|
|
768
|
-
logline: strOf(script["logline"]).trim(),
|
|
769
|
-
style: strOf(script["style"]).trim(),
|
|
770
|
-
mainCharacters: asList(script["main_characters"]).map((item) => ({
|
|
771
|
-
name: strOf(item["name"]).trim(),
|
|
772
|
-
role: strOf(item["role"]).trim(),
|
|
773
|
-
})).filter((item) => item.name && item.role),
|
|
774
|
-
};
|
|
775
|
-
}
|
|
776
|
-
//# sourceMappingURL=synopsis-generate.js.map
|