@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,823 +0,0 @@
|
|
|
1
|
-
import { ACTION_TYPE_SET, IMPORTANCE_TIER_SET, NON_ACTOR_SPEAKER_KIND_SET, ROLE_TYPE_SET, } from "../../script/v3/types.js";
|
|
2
|
-
import { authoringError, parseBracketRecord, } from "../shared/bracket.js";
|
|
3
|
-
export { parseBracketRecord } from "../shared/bracket.js";
|
|
4
|
-
function emptyModifiers() {
|
|
5
|
-
return { extend: {}, extendPresent: false, aliases: [], aliasesPresent: false, phase: "extend" };
|
|
6
|
-
}
|
|
7
|
-
function hasModifiers(modifiers) {
|
|
8
|
-
return modifiers.extendPresent
|
|
9
|
-
|| modifiers.aliasesPresent
|
|
10
|
-
|| modifiers.prompt !== undefined;
|
|
11
|
-
}
|
|
12
|
-
function extensionOrUndefined(modifiers) {
|
|
13
|
-
return modifiers.extendPresent ? modifiers.extend : undefined;
|
|
14
|
-
}
|
|
15
|
-
function isJsonValue(value) {
|
|
16
|
-
if (value === null)
|
|
17
|
-
return true;
|
|
18
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean")
|
|
19
|
-
return true;
|
|
20
|
-
if (Array.isArray(value))
|
|
21
|
-
return value.every(isJsonValue);
|
|
22
|
-
if (typeof value !== "object")
|
|
23
|
-
return false;
|
|
24
|
-
return Object.values(value).every(isJsonValue);
|
|
25
|
-
}
|
|
26
|
-
function canonicalJson(value) {
|
|
27
|
-
if (Array.isArray(value))
|
|
28
|
-
return value.map(canonicalJson);
|
|
29
|
-
if (value !== null && typeof value === "object") {
|
|
30
|
-
const result = {};
|
|
31
|
-
for (const key of Object.keys(value).sort())
|
|
32
|
-
result[key] = canonicalJson(value[key]);
|
|
33
|
-
return result;
|
|
34
|
-
}
|
|
35
|
-
return value;
|
|
36
|
-
}
|
|
37
|
-
function isImportance(value) {
|
|
38
|
-
return value === "featured" || value === "background";
|
|
39
|
-
}
|
|
40
|
-
function isRoleType(value) {
|
|
41
|
-
return value === "主角" || value === "配角";
|
|
42
|
-
}
|
|
43
|
-
function isNonActorSpeakerKind(value) {
|
|
44
|
-
return value === "system" || value === "broadcast" || value === "offscreen" || value === "group";
|
|
45
|
-
}
|
|
46
|
-
function isAssetKind(value) {
|
|
47
|
-
return value === "actor" || value === "location" || value === "prop";
|
|
48
|
-
}
|
|
49
|
-
function parsePositiveInteger(raw, source, label, allowZero) {
|
|
50
|
-
if (!/^\d+$/.test(raw)) {
|
|
51
|
-
throw authoringError(`${label} must be an integer.`, source, raw || "<empty>", `Use ${allowZero ? "a non-negative" : "a positive"} integer.`);
|
|
52
|
-
}
|
|
53
|
-
const value = Number(raw);
|
|
54
|
-
if (!Number.isSafeInteger(value) || (allowZero ? value < 0 : value < 1)) {
|
|
55
|
-
throw authoringError(`${label} is out of range.`, source, raw, `Use ${allowZero ? "a non-negative" : "a positive"} safe integer.`);
|
|
56
|
-
}
|
|
57
|
-
return value;
|
|
58
|
-
}
|
|
59
|
-
function parseTag(raw, line) {
|
|
60
|
-
const text = raw.trim();
|
|
61
|
-
if (!text.startsWith("<"))
|
|
62
|
-
return null;
|
|
63
|
-
const source = { line, column: raw.indexOf("<") + 1 };
|
|
64
|
-
const closingMatch = /^<\/([a-z-]+)>$/.exec(text);
|
|
65
|
-
if (closingMatch)
|
|
66
|
-
return { name: closingMatch[1], closing: true, attrs: new Map(), source };
|
|
67
|
-
const openMatch = /^<([a-z-]+)(?: ([^>]+))?>$/.exec(text);
|
|
68
|
-
if (!openMatch) {
|
|
69
|
-
throw authoringError("Block tag syntax is invalid.", source, raw, "Use <name key=value> or </name> on its own line.");
|
|
70
|
-
}
|
|
71
|
-
const attrs = new Map();
|
|
72
|
-
const attrText = openMatch[2] ?? "";
|
|
73
|
-
if (attrText) {
|
|
74
|
-
for (const token of attrText.split(" ")) {
|
|
75
|
-
if (!token) {
|
|
76
|
-
throw authoringError("Block attributes must use one space separators.", source, raw, "Use canonical key=value attributes separated by one space.");
|
|
77
|
-
}
|
|
78
|
-
const match = /^([a-z]+)=([A-Za-z0-9_./#:-]+)$/.exec(token);
|
|
79
|
-
if (!match) {
|
|
80
|
-
throw authoringError("Block attribute syntax is invalid.", source, token, "Use unquoted canonical key=value attributes.");
|
|
81
|
-
}
|
|
82
|
-
if (attrs.has(match[1])) {
|
|
83
|
-
throw authoringError("Block attribute is duplicated.", source, match[1], "Keep exactly one value for each attribute.");
|
|
84
|
-
}
|
|
85
|
-
attrs.set(match[1], match[2]);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return { name: openMatch[1], closing: false, attrs, source };
|
|
89
|
-
}
|
|
90
|
-
function assertAttributes(tag, required, optional = []) {
|
|
91
|
-
const allowed = new Set([...required, ...optional]);
|
|
92
|
-
const unknown = [...tag.attrs.keys()].filter((key) => !allowed.has(key));
|
|
93
|
-
const missing = required.filter((key) => !tag.attrs.has(key));
|
|
94
|
-
if (unknown.length > 0 || missing.length > 0) {
|
|
95
|
-
throw authoringError(`Attributes for <${tag.name}> are invalid.`, tag.source, `missing=${missing.join(",") || "-"} unknown=${unknown.join(",") || "-"}`, `Use ${[...required, ...optional].map((key) => `${key}=...`).join(" ")}.`);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function speakerFromSlot(raw, source) {
|
|
99
|
-
if (!raw) {
|
|
100
|
-
throw authoringError("Speaker is required.", source, "<empty>", "Use act_ID[/state_ID] or system|broadcast|offscreen|group[:label].");
|
|
101
|
-
}
|
|
102
|
-
const slash = raw.indexOf("/");
|
|
103
|
-
const actorId = slash >= 0 ? raw.slice(0, slash) : raw;
|
|
104
|
-
if (/^act_[A-Za-z0-9_-]+$/.test(actorId)) {
|
|
105
|
-
if (slash < 0)
|
|
106
|
-
return { actor_id: actorId };
|
|
107
|
-
const stateId = raw.slice(slash + 1);
|
|
108
|
-
if (!stateId || stateId.includes("/")) {
|
|
109
|
-
throw authoringError("Actor speaker state is invalid.", source, raw, "Use act_ID/state_ID.");
|
|
110
|
-
}
|
|
111
|
-
return { actor_id: actorId, state_id: stateId };
|
|
112
|
-
}
|
|
113
|
-
const colon = raw.indexOf(":");
|
|
114
|
-
const kind = colon >= 0 ? raw.slice(0, colon) : raw;
|
|
115
|
-
if (!NON_ACTOR_SPEAKER_KIND_SET.has(kind) || !isNonActorSpeakerKind(kind)) {
|
|
116
|
-
throw authoringError("Speaker kind is invalid.", source, raw, "Use an actor ID or system, broadcast, offscreen, or group.");
|
|
117
|
-
}
|
|
118
|
-
if (colon < 0)
|
|
119
|
-
return { kind };
|
|
120
|
-
return { kind, label: raw.slice(colon + 1) };
|
|
121
|
-
}
|
|
122
|
-
function actionFromRecord(record, modifiers) {
|
|
123
|
-
const map = {
|
|
124
|
-
act: "action",
|
|
125
|
-
dlg: "dialogue",
|
|
126
|
-
think: "inner_thought",
|
|
127
|
-
trans: "transition",
|
|
128
|
-
};
|
|
129
|
-
const type = map[record.type];
|
|
130
|
-
if (type === undefined || !ACTION_TYPE_SET.has(type)) {
|
|
131
|
-
throw authoringError("Body record type is invalid.", record.source, record.type, "Use [act], [dlg], [think], or [trans].");
|
|
132
|
-
}
|
|
133
|
-
const action = { type, content: record.content };
|
|
134
|
-
if (type === "dialogue" || type === "inner_thought") {
|
|
135
|
-
if (record.slots.length < 1 || record.slots.length > 2) {
|
|
136
|
-
throw authoringError("Speaker record slots are invalid.", record.source, record.slots.join("|"), `Use [${record.type}|speaker|emotion?].`);
|
|
137
|
-
}
|
|
138
|
-
action.speaker = speakerFromSlot(record.slots[0], record.source);
|
|
139
|
-
if (record.slots.length === 2)
|
|
140
|
-
action.emotion = record.slots[1];
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
if (record.slots.length > 1) {
|
|
144
|
-
throw authoringError("Body record slots are invalid.", record.source, record.slots.join("|"), `Use [${record.type}|emotion?].`);
|
|
145
|
-
}
|
|
146
|
-
if (record.slots.length === 1)
|
|
147
|
-
action.emotion = record.slots[0];
|
|
148
|
-
}
|
|
149
|
-
const extend = extensionOrUndefined(modifiers);
|
|
150
|
-
if (extend !== undefined)
|
|
151
|
-
action.extend = extend;
|
|
152
|
-
if (modifiers.aliasesPresent) {
|
|
153
|
-
throw authoringError("Alias cannot modify an action.", modifiers.source ?? record.source, modifiers.aliases.join(","), "Use [alias] only before an asset declaration.");
|
|
154
|
-
}
|
|
155
|
-
if (modifiers.prompt !== undefined)
|
|
156
|
-
action.transition_prompt = modifiers.prompt;
|
|
157
|
-
return action;
|
|
158
|
-
}
|
|
159
|
-
class Parser {
|
|
160
|
-
lines;
|
|
161
|
-
index = 0;
|
|
162
|
-
constructor(text) {
|
|
163
|
-
this.lines = text.replace(/\r\n?/g, "\n").split("\n");
|
|
164
|
-
}
|
|
165
|
-
parse() {
|
|
166
|
-
this.skipBlank();
|
|
167
|
-
const root = this.takeOpen("authoring");
|
|
168
|
-
assertAttributes(root, ["version"]);
|
|
169
|
-
if (root.attrs.get("version") !== "1") {
|
|
170
|
-
throw authoringError("Authoring version is unsupported.", root.source, root.attrs.get("version") ?? "<missing>", "Use <authoring version=1>.");
|
|
171
|
-
}
|
|
172
|
-
const declarations = [];
|
|
173
|
-
const targets = [];
|
|
174
|
-
let seenTarget = false;
|
|
175
|
-
let pending = emptyModifiers();
|
|
176
|
-
while (true) {
|
|
177
|
-
this.skipBlank();
|
|
178
|
-
if (this.peekClose("authoring")) {
|
|
179
|
-
if (hasModifiers(pending))
|
|
180
|
-
this.throwDangling(pending);
|
|
181
|
-
this.takeClose("authoring");
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
const next = this.peekSemantic();
|
|
185
|
-
if (next === null)
|
|
186
|
-
throw this.eofError("authoring");
|
|
187
|
-
if (next.record?.type === "extensions" || next.record?.type === "extend") {
|
|
188
|
-
pending = this.addModifier(pending, this.takeRecord());
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
if (next.tag?.name === "create" && !next.tag.closing) {
|
|
192
|
-
if (seenTarget)
|
|
193
|
-
throw authoringError("<create> must precede every target.", next.tag.source, "<create>", "Move the single <create> block before the targets.");
|
|
194
|
-
if (hasModifiers(pending))
|
|
195
|
-
this.throwUnsupportedModifiers(pending, "create");
|
|
196
|
-
declarations.push(...this.parseCreate());
|
|
197
|
-
seenTarget = true;
|
|
198
|
-
continue;
|
|
199
|
-
}
|
|
200
|
-
seenTarget = true;
|
|
201
|
-
targets.push(this.parseTarget(pending));
|
|
202
|
-
pending = emptyModifiers();
|
|
203
|
-
}
|
|
204
|
-
this.skipBlank();
|
|
205
|
-
if (this.index < this.lines.length) {
|
|
206
|
-
const source = { line: this.index + 1, column: 1 };
|
|
207
|
-
throw authoringError("Content exists after </authoring>.", source, this.lines[this.index], "Remove content outside the root block.");
|
|
208
|
-
}
|
|
209
|
-
if (targets.length === 0) {
|
|
210
|
-
throw authoringError("Authoring file has no target.", root.source, "<authoring>", "Add one or more homogeneous target blocks.");
|
|
211
|
-
}
|
|
212
|
-
const targetKind = targets[0].kind;
|
|
213
|
-
const mixed = targets.find((target) => target.kind !== targetKind);
|
|
214
|
-
if (mixed !== undefined) {
|
|
215
|
-
throw authoringError("Authoring targets are not homogeneous.", mixed.source, mixed.kind, `Keep only ${targetKind} targets in this file.`);
|
|
216
|
-
}
|
|
217
|
-
if (targetKind === "script" && targets.length !== 1) {
|
|
218
|
-
throw authoringError("A script authoring file has exactly one target.", targets[1].source, "second <script>", "Keep one <script> target.");
|
|
219
|
-
}
|
|
220
|
-
return { version: 1, declarations, targets, targetKind };
|
|
221
|
-
}
|
|
222
|
-
parseCreate() {
|
|
223
|
-
const tag = this.takeOpen("create");
|
|
224
|
-
assertAttributes(tag, []);
|
|
225
|
-
const declarations = [];
|
|
226
|
-
let pending = emptyModifiers();
|
|
227
|
-
while (true) {
|
|
228
|
-
this.skipBlank();
|
|
229
|
-
if (this.peekClose("create")) {
|
|
230
|
-
if (hasModifiers(pending))
|
|
231
|
-
this.throwDangling(pending);
|
|
232
|
-
this.takeClose("create");
|
|
233
|
-
return declarations;
|
|
234
|
-
}
|
|
235
|
-
const record = this.takeRecord();
|
|
236
|
-
if (record.type === "extensions" || record.type === "extend" || record.type === "aliases" || record.type === "alias" || record.type === "prompt") {
|
|
237
|
-
pending = this.addModifier(pending, record);
|
|
238
|
-
continue;
|
|
239
|
-
}
|
|
240
|
-
if (record.type === "actor") {
|
|
241
|
-
if (record.slots.length < 3 || record.slots.length > 4) {
|
|
242
|
-
throw authoringError("Actor declaration slots are invalid.", record.source, record.slots.join("|"), "Use [actor|id|name|importance|role?] description.");
|
|
243
|
-
}
|
|
244
|
-
const [actorId, actorName, importance, role] = record.slots;
|
|
245
|
-
if (!actorId || !actorName || !importance || !IMPORTANCE_TIER_SET.has(importance) || !isImportance(importance)) {
|
|
246
|
-
throw authoringError("Actor declaration is invalid.", record.source, record.slots.join("|"), "Provide id, name, and featured|background importance.");
|
|
247
|
-
}
|
|
248
|
-
if (role !== undefined && (!ROLE_TYPE_SET.has(role) || !isRoleType(role))) {
|
|
249
|
-
throw authoringError("Actor role is invalid.", record.source, role, "Use 主角 or 配角, or omit the slot.");
|
|
250
|
-
}
|
|
251
|
-
const value = {
|
|
252
|
-
actor_id: actorId,
|
|
253
|
-
actor_name: actorName,
|
|
254
|
-
importance,
|
|
255
|
-
description: record.content,
|
|
256
|
-
states: [],
|
|
257
|
-
};
|
|
258
|
-
if (role !== undefined)
|
|
259
|
-
value.role_type = role;
|
|
260
|
-
if (pending.aliasesPresent)
|
|
261
|
-
value.aliases = [...pending.aliases];
|
|
262
|
-
const extend = extensionOrUndefined(pending);
|
|
263
|
-
if (extend !== undefined)
|
|
264
|
-
value.extend = extend;
|
|
265
|
-
if (pending.prompt !== undefined)
|
|
266
|
-
this.throwUnsupportedModifiers(pending, "actor");
|
|
267
|
-
declarations.push({ declarationKind: "actor", value, source: record.source });
|
|
268
|
-
pending = emptyModifiers();
|
|
269
|
-
continue;
|
|
270
|
-
}
|
|
271
|
-
if (record.type === "location" || record.type === "prop") {
|
|
272
|
-
if (record.slots.length !== 3) {
|
|
273
|
-
throw authoringError(`${record.type} declaration slots are invalid.`, record.source, record.slots.join("|"), `Use [${record.type}|id|name|importance] description.`);
|
|
274
|
-
}
|
|
275
|
-
const [id, name, importance] = record.slots;
|
|
276
|
-
if (!id || !name || !importance || !IMPORTANCE_TIER_SET.has(importance) || !isImportance(importance)) {
|
|
277
|
-
throw authoringError(`${record.type} declaration is invalid.`, record.source, record.slots.join("|"), "Provide id, name, and featured|background importance.");
|
|
278
|
-
}
|
|
279
|
-
if (pending.prompt !== undefined)
|
|
280
|
-
this.throwUnsupportedModifiers(pending, record.type);
|
|
281
|
-
const extend = extensionOrUndefined(pending);
|
|
282
|
-
if (record.type === "location") {
|
|
283
|
-
const value = {
|
|
284
|
-
location_id: id,
|
|
285
|
-
location_name: name,
|
|
286
|
-
importance,
|
|
287
|
-
description: record.content,
|
|
288
|
-
states: [],
|
|
289
|
-
};
|
|
290
|
-
if (pending.aliasesPresent)
|
|
291
|
-
value.aliases = [...pending.aliases];
|
|
292
|
-
if (extend !== undefined)
|
|
293
|
-
value.extend = extend;
|
|
294
|
-
declarations.push({ declarationKind: "location", value, source: record.source });
|
|
295
|
-
}
|
|
296
|
-
else {
|
|
297
|
-
const value = {
|
|
298
|
-
prop_id: id,
|
|
299
|
-
prop_name: name,
|
|
300
|
-
importance,
|
|
301
|
-
description: record.content,
|
|
302
|
-
states: [],
|
|
303
|
-
};
|
|
304
|
-
if (pending.aliasesPresent)
|
|
305
|
-
value.aliases = [...pending.aliases];
|
|
306
|
-
if (extend !== undefined)
|
|
307
|
-
value.extend = extend;
|
|
308
|
-
declarations.push({ declarationKind: "prop", value, source: record.source });
|
|
309
|
-
}
|
|
310
|
-
pending = emptyModifiers();
|
|
311
|
-
continue;
|
|
312
|
-
}
|
|
313
|
-
if (record.type === "state") {
|
|
314
|
-
if (record.slots.length !== 3) {
|
|
315
|
-
throw authoringError("State declaration slots are invalid.", record.source, record.slots.join("|"), "Use [state|kind:asset_id|state_id|state_name] description.");
|
|
316
|
-
}
|
|
317
|
-
if (pending.aliasesPresent || pending.prompt !== undefined)
|
|
318
|
-
this.throwUnsupportedModifiers(pending, "state");
|
|
319
|
-
const [owner, stateId, stateName] = record.slots;
|
|
320
|
-
const ownerMatch = /^(actor|location|prop):(.+)$/.exec(owner ?? "");
|
|
321
|
-
const ownerKind = ownerMatch?.[1] ?? "";
|
|
322
|
-
if (!ownerMatch || !isAssetKind(ownerKind) || !stateId || !stateName) {
|
|
323
|
-
throw authoringError("State declaration is invalid.", record.source, record.slots.join("|"), "Use a typed owner and non-empty state ID/name.");
|
|
324
|
-
}
|
|
325
|
-
const value = { state_id: stateId, state_name: stateName, description: record.content };
|
|
326
|
-
const extend = extensionOrUndefined(pending);
|
|
327
|
-
if (extend !== undefined)
|
|
328
|
-
value.extend = extend;
|
|
329
|
-
declarations.push({
|
|
330
|
-
declarationKind: "state",
|
|
331
|
-
ownerKind,
|
|
332
|
-
ownerId: ownerMatch[2],
|
|
333
|
-
value,
|
|
334
|
-
source: record.source,
|
|
335
|
-
});
|
|
336
|
-
pending = emptyModifiers();
|
|
337
|
-
continue;
|
|
338
|
-
}
|
|
339
|
-
throw authoringError("Record is not allowed in <create>.", record.source, record.type, "Use actor, location, prop, state, or a supported prefix modifier.");
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
parseTarget(modifiers) {
|
|
343
|
-
const tag = this.peekTag();
|
|
344
|
-
if (tag === null || tag.closing) {
|
|
345
|
-
const source = tag?.source ?? { line: this.index + 1, column: 1 };
|
|
346
|
-
throw authoringError("Expected a target block.", source, this.lines[this.index] ?? "<eof>", "Add a supported target block.");
|
|
347
|
-
}
|
|
348
|
-
if (modifiers.aliasesPresent || modifiers.prompt !== undefined)
|
|
349
|
-
this.throwUnsupportedModifiers(modifiers, tag.name);
|
|
350
|
-
switch (tag.name) {
|
|
351
|
-
case "script": return this.parseScript(modifiers);
|
|
352
|
-
case "episode": return { kind: "episode", value: this.parseEpisode(modifiers), source: tag.source, ...(extensionOrUndefined(modifiers) ? { extend: extensionOrUndefined(modifiers) } : {}) };
|
|
353
|
-
case "episode-span": return this.parseEpisodeSpan(modifiers);
|
|
354
|
-
case "scene": {
|
|
355
|
-
assertAttributes(tag, ["id", "parent"]);
|
|
356
|
-
const parent = tag.attrs.get("parent");
|
|
357
|
-
return { kind: "scene", parent, value: this.parseScene(modifiers, true), source: tag.source, ...(extensionOrUndefined(modifiers) ? { extend: extensionOrUndefined(modifiers) } : {}) };
|
|
358
|
-
}
|
|
359
|
-
case "scene-span": return this.parseSceneSpan(modifiers);
|
|
360
|
-
case "action-span": return this.parseActionSpan(modifiers);
|
|
361
|
-
default:
|
|
362
|
-
throw authoringError("Unknown target block.", tag.source, tag.name, "Use script, episode, episode-span, scene, scene-span, or action-span.");
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
parseScript(modifiers) {
|
|
366
|
-
const tag = this.takeOpen("script");
|
|
367
|
-
assertAttributes(tag, []);
|
|
368
|
-
const recordOrder = ["title", "worldview", "worldview-raw", "style", "synopsis", "logline", "theme", "main-characters", "main-character"];
|
|
369
|
-
const values = new Map();
|
|
370
|
-
const mainCharacters = [];
|
|
371
|
-
const episodes = [];
|
|
372
|
-
let lastRecord = -1;
|
|
373
|
-
let episodesStarted = false;
|
|
374
|
-
let pending = emptyModifiers();
|
|
375
|
-
while (true) {
|
|
376
|
-
this.skipBlank();
|
|
377
|
-
if (this.peekClose("script")) {
|
|
378
|
-
if (hasModifiers(pending))
|
|
379
|
-
this.throwDangling(pending);
|
|
380
|
-
this.takeClose("script");
|
|
381
|
-
break;
|
|
382
|
-
}
|
|
383
|
-
const next = this.peekSemantic();
|
|
384
|
-
if (next?.record !== undefined) {
|
|
385
|
-
const record = this.takeRecord();
|
|
386
|
-
if (record.type === "extensions" || record.type === "extend" || record.type === "aliases" || record.type === "alias" || record.type === "prompt") {
|
|
387
|
-
pending = this.addModifier(pending, record);
|
|
388
|
-
continue;
|
|
389
|
-
}
|
|
390
|
-
if (hasModifiers(pending))
|
|
391
|
-
this.throwUnsupportedModifiers(pending, record.type);
|
|
392
|
-
const order = recordOrder.indexOf(record.type);
|
|
393
|
-
const repeatedMainCharacter = record.type === "main-character";
|
|
394
|
-
if (episodesStarted || order < 0 || order < lastRecord || (!repeatedMainCharacter && values.has(record.type))) {
|
|
395
|
-
throw authoringError("Metadata record in <script> is invalid or out of order.", record.source, record.type, `Use ${recordOrder.join(", ")} in canonical order before episode blocks.`);
|
|
396
|
-
}
|
|
397
|
-
lastRecord = order;
|
|
398
|
-
if (record.type === "main-characters") {
|
|
399
|
-
if (record.slots.length !== 0 || record.content !== "") {
|
|
400
|
-
throw authoringError("Main characters marker is invalid.", record.source, record.content, "Use [main-characters] with no slots or content.");
|
|
401
|
-
}
|
|
402
|
-
values.set(record.type, "");
|
|
403
|
-
}
|
|
404
|
-
else if (repeatedMainCharacter) {
|
|
405
|
-
if (record.slots.length !== 2 || !record.slots[0] || !record.slots[1] || record.content !== "") {
|
|
406
|
-
throw authoringError("Main character record is invalid.", record.source, record.slots.join("|"), "Use [main-character|name|role] with no content.");
|
|
407
|
-
}
|
|
408
|
-
mainCharacters.push({ name: record.slots[0], role: record.slots[1] });
|
|
409
|
-
}
|
|
410
|
-
else {
|
|
411
|
-
if (record.slots.length !== 0) {
|
|
412
|
-
throw authoringError("Script metadata record has unexpected slots.", record.source, record.slots.join("|"), `Use [${record.type}] content.`);
|
|
413
|
-
}
|
|
414
|
-
values.set(record.type, record.content);
|
|
415
|
-
}
|
|
416
|
-
continue;
|
|
417
|
-
}
|
|
418
|
-
if (next?.tag === undefined || next.tag.closing || next.tag.name !== "episode") {
|
|
419
|
-
const source = next?.tag?.source ?? { line: this.index + 1, column: 1 };
|
|
420
|
-
throw authoringError("Unexpected member in <script>.", source, this.lines[this.index] ?? "<eof>", "Use metadata records followed by <episode> blocks.");
|
|
421
|
-
}
|
|
422
|
-
episodesStarted = true;
|
|
423
|
-
episodes.push(this.parseEpisode(pending));
|
|
424
|
-
pending = emptyModifiers();
|
|
425
|
-
}
|
|
426
|
-
const title = this.requiredMetadata(values, "title", tag.source);
|
|
427
|
-
const worldview = this.requiredMetadata(values, "worldview", tag.source);
|
|
428
|
-
const style = this.requiredMetadata(values, "style", tag.source);
|
|
429
|
-
const extend = extensionOrUndefined(modifiers);
|
|
430
|
-
return {
|
|
431
|
-
kind: "script",
|
|
432
|
-
title,
|
|
433
|
-
worldview,
|
|
434
|
-
style,
|
|
435
|
-
...(values.get("worldview-raw") !== undefined ? { worldviewRaw: values.get("worldview-raw") } : {}),
|
|
436
|
-
...(values.get("synopsis") !== undefined ? { synopsis: values.get("synopsis") } : {}),
|
|
437
|
-
...(values.get("logline") !== undefined ? { logline: values.get("logline") } : {}),
|
|
438
|
-
...(values.get("theme") !== undefined ? { theme: values.get("theme") } : {}),
|
|
439
|
-
...(values.has("main-characters") || mainCharacters.length > 0 ? { mainCharacters } : {}),
|
|
440
|
-
episodes,
|
|
441
|
-
source: tag.source,
|
|
442
|
-
...(extend !== undefined ? { extend } : {}),
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
parseEpisode(modifiers) {
|
|
446
|
-
const tag = this.takeOpen("episode");
|
|
447
|
-
assertAttributes(tag, ["id"]);
|
|
448
|
-
if (modifiers.aliasesPresent || modifiers.prompt !== undefined)
|
|
449
|
-
this.throwUnsupportedModifiers(modifiers, "episode");
|
|
450
|
-
const metadata = this.parseMetadataAndChildren("episode", ["title", "synopsis"], "scene", (childModifiers) => this.parseScene(childModifiers, false));
|
|
451
|
-
const episode = { episode_id: tag.attrs.get("id"), scenes: metadata.children };
|
|
452
|
-
if (metadata.values.has("title"))
|
|
453
|
-
episode.title = metadata.values.get("title");
|
|
454
|
-
if (metadata.values.has("synopsis"))
|
|
455
|
-
episode.synopsis = metadata.values.get("synopsis");
|
|
456
|
-
const extend = extensionOrUndefined(modifiers);
|
|
457
|
-
if (extend !== undefined)
|
|
458
|
-
episode.extend = extend;
|
|
459
|
-
return episode;
|
|
460
|
-
}
|
|
461
|
-
parseScene(modifiers, root) {
|
|
462
|
-
const tag = this.takeOpen("scene");
|
|
463
|
-
assertAttributes(tag, root ? ["id", "parent"] : ["id"]);
|
|
464
|
-
if (modifiers.aliasesPresent || modifiers.prompt !== undefined)
|
|
465
|
-
this.throwUnsupportedModifiers(modifiers, "scene");
|
|
466
|
-
let environment;
|
|
467
|
-
let location;
|
|
468
|
-
const actors = [];
|
|
469
|
-
const props = [];
|
|
470
|
-
let phase = "environment";
|
|
471
|
-
let actions;
|
|
472
|
-
while (true) {
|
|
473
|
-
this.skipBlank();
|
|
474
|
-
if (this.peekClose("scene")) {
|
|
475
|
-
this.takeClose("scene");
|
|
476
|
-
break;
|
|
477
|
-
}
|
|
478
|
-
const next = this.peekSemantic();
|
|
479
|
-
if (next?.tag?.name === "body" && !next.tag.closing) {
|
|
480
|
-
if (phase === "body")
|
|
481
|
-
throw authoringError("Scene has more than one body.", next.tag.source, "<body>", "Keep exactly one <body>.");
|
|
482
|
-
phase = "body";
|
|
483
|
-
actions = this.parseBody();
|
|
484
|
-
continue;
|
|
485
|
-
}
|
|
486
|
-
if (next?.record === undefined) {
|
|
487
|
-
const source = next?.tag?.source ?? { line: this.index + 1, column: 1 };
|
|
488
|
-
throw authoringError("Only scene records and <body> are allowed here.", source, this.lines[this.index] ?? "<eof>", "Use environment, location, cast, prop, then body.");
|
|
489
|
-
}
|
|
490
|
-
const record = this.takeRecord();
|
|
491
|
-
if (record.type === "extensions" || record.type === "extend" || record.type === "aliases" || record.type === "alias" || record.type === "prompt") {
|
|
492
|
-
throw authoringError("Scene prefix modifier must directly precede <scene>.", record.source, record.type, "Move the modifier before the <scene> opening tag.");
|
|
493
|
-
}
|
|
494
|
-
if (record.type === "environment") {
|
|
495
|
-
if (phase !== "environment" || environment !== undefined || record.slots.length > 2) {
|
|
496
|
-
throw authoringError("Environment record is out of order or invalid.", record.source, record.slots.join("|"), "Place at most one [environment|space?|time?] first.");
|
|
497
|
-
}
|
|
498
|
-
environment = {};
|
|
499
|
-
if (record.slots.length >= 1 && record.slots[0] !== "")
|
|
500
|
-
environment.space = record.slots[0];
|
|
501
|
-
if (record.slots.length >= 2 && record.slots[1] !== "")
|
|
502
|
-
environment.time = record.slots[1];
|
|
503
|
-
continue;
|
|
504
|
-
}
|
|
505
|
-
if (record.type === "location") {
|
|
506
|
-
if (phase === "cast" || phase === "prop" || phase === "body" || location !== undefined || record.slots.length > 2) {
|
|
507
|
-
throw authoringError("Location record is out of order or invalid.", record.source, record.slots.join("|"), "Place exactly one [location|id?|state?] before cast.");
|
|
508
|
-
}
|
|
509
|
-
phase = "location";
|
|
510
|
-
const id = record.slots[0];
|
|
511
|
-
if (id === undefined || id === "")
|
|
512
|
-
location = null;
|
|
513
|
-
else
|
|
514
|
-
location = record.slots.length === 2 ? { location_id: id, state_id: record.slots[1] } : { location_id: id };
|
|
515
|
-
continue;
|
|
516
|
-
}
|
|
517
|
-
if (record.type === "cast") {
|
|
518
|
-
if (location === undefined || phase === "prop" || phase === "body" || record.slots.length < 1 || record.slots.length > 2 || !record.slots[0]) {
|
|
519
|
-
throw authoringError("Cast record is out of order or invalid.", record.source, record.slots.join("|"), "Place [cast|actor_id|state_id?] after location and before props.");
|
|
520
|
-
}
|
|
521
|
-
phase = "cast";
|
|
522
|
-
actors.push(record.slots.length === 2 ? { actor_id: record.slots[0], state_id: record.slots[1] } : { actor_id: record.slots[0] });
|
|
523
|
-
continue;
|
|
524
|
-
}
|
|
525
|
-
if (record.type === "prop") {
|
|
526
|
-
if (location === undefined || phase === "body" || record.slots.length < 1 || record.slots.length > 2 || !record.slots[0]) {
|
|
527
|
-
throw authoringError("Prop record is out of order or invalid.", record.source, record.slots.join("|"), "Place [prop|prop_id|state_id?] after cast and before body.");
|
|
528
|
-
}
|
|
529
|
-
phase = "prop";
|
|
530
|
-
props.push(record.slots.length === 2 ? { prop_id: record.slots[0], state_id: record.slots[1] } : { prop_id: record.slots[0] });
|
|
531
|
-
continue;
|
|
532
|
-
}
|
|
533
|
-
throw authoringError("Record is not allowed in a scene header.", record.source, record.type, "Use environment, location, cast, prop, or body records.");
|
|
534
|
-
}
|
|
535
|
-
if (location === undefined)
|
|
536
|
-
throw authoringError("Scene location record is missing.", tag.source, `<scene id=${tag.attrs.get("id")}>`, "Add [location] or [location|loc_ID|state_ID].");
|
|
537
|
-
if (actions === undefined)
|
|
538
|
-
throw authoringError("Scene body is missing.", tag.source, `<scene id=${tag.attrs.get("id")}>`, "Add one <body> block.");
|
|
539
|
-
const scene = { scene_id: tag.attrs.get("id"), location, actors, props, actions };
|
|
540
|
-
if (environment !== undefined)
|
|
541
|
-
scene.environment = environment;
|
|
542
|
-
const extend = extensionOrUndefined(modifiers);
|
|
543
|
-
if (extend !== undefined)
|
|
544
|
-
scene.extend = extend;
|
|
545
|
-
return scene;
|
|
546
|
-
}
|
|
547
|
-
parseBody() {
|
|
548
|
-
const tag = this.takeOpen("body");
|
|
549
|
-
assertAttributes(tag, []);
|
|
550
|
-
const actions = [];
|
|
551
|
-
let pending = emptyModifiers();
|
|
552
|
-
while (true) {
|
|
553
|
-
this.skipBlank();
|
|
554
|
-
if (this.peekClose("body")) {
|
|
555
|
-
if (hasModifiers(pending))
|
|
556
|
-
this.throwDangling(pending);
|
|
557
|
-
this.takeClose("body");
|
|
558
|
-
return actions;
|
|
559
|
-
}
|
|
560
|
-
const record = this.takeRecord();
|
|
561
|
-
if (record.type === "extensions" || record.type === "extend" || record.type === "aliases" || record.type === "prompt" || record.type === "alias") {
|
|
562
|
-
pending = this.addModifier(pending, record);
|
|
563
|
-
continue;
|
|
564
|
-
}
|
|
565
|
-
actions.push(actionFromRecord(record, pending));
|
|
566
|
-
pending = emptyModifiers();
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
parseEpisodeSpan(modifiers) {
|
|
570
|
-
const tag = this.takeOpen("episode-span");
|
|
571
|
-
assertAttributes(tag, ["from", "through"]);
|
|
572
|
-
const episodes = this.parseOnlyChildren("episode-span", "episode", (childModifiers) => this.parseEpisode(childModifiers));
|
|
573
|
-
const extend = extensionOrUndefined(modifiers);
|
|
574
|
-
return {
|
|
575
|
-
kind: "episode-span",
|
|
576
|
-
from: tag.attrs.get("from"),
|
|
577
|
-
through: tag.attrs.get("through"),
|
|
578
|
-
episodes,
|
|
579
|
-
source: tag.source,
|
|
580
|
-
...(extend !== undefined ? { extend } : {}),
|
|
581
|
-
};
|
|
582
|
-
}
|
|
583
|
-
parseSceneSpan(modifiers) {
|
|
584
|
-
const tag = this.takeOpen("scene-span");
|
|
585
|
-
assertAttributes(tag, ["parent", "from", "through"]);
|
|
586
|
-
const scenes = this.parseOnlyChildren("scene-span", "scene", (childModifiers) => this.parseScene(childModifiers, false));
|
|
587
|
-
const extend = extensionOrUndefined(modifiers);
|
|
588
|
-
return {
|
|
589
|
-
kind: "scene-span",
|
|
590
|
-
parent: tag.attrs.get("parent"),
|
|
591
|
-
from: tag.attrs.get("from"),
|
|
592
|
-
through: tag.attrs.get("through"),
|
|
593
|
-
scenes,
|
|
594
|
-
source: tag.source,
|
|
595
|
-
...(extend !== undefined ? { extend } : {}),
|
|
596
|
-
};
|
|
597
|
-
}
|
|
598
|
-
parseActionSpan(modifiers) {
|
|
599
|
-
const tag = this.takeOpen("action-span");
|
|
600
|
-
assertAttributes(tag, ["parent", "from", "through"]);
|
|
601
|
-
this.skipBlank();
|
|
602
|
-
const actions = this.parseBody();
|
|
603
|
-
this.skipBlank();
|
|
604
|
-
this.takeClose("action-span");
|
|
605
|
-
const extend = extensionOrUndefined(modifiers);
|
|
606
|
-
return {
|
|
607
|
-
kind: "action-span",
|
|
608
|
-
parent: tag.attrs.get("parent"),
|
|
609
|
-
from: parsePositiveInteger(tag.attrs.get("from"), tag.source, "action-span from", true),
|
|
610
|
-
through: parsePositiveInteger(tag.attrs.get("through"), tag.source, "action-span through", true),
|
|
611
|
-
actions,
|
|
612
|
-
source: tag.source,
|
|
613
|
-
...(extend !== undefined ? { extend } : {}),
|
|
614
|
-
};
|
|
615
|
-
}
|
|
616
|
-
parseMetadataAndChildren(block, recordOrder, childName, parseChild) {
|
|
617
|
-
const values = new Map();
|
|
618
|
-
const children = [];
|
|
619
|
-
let lastRecord = -1;
|
|
620
|
-
let childrenStarted = false;
|
|
621
|
-
let pending = emptyModifiers();
|
|
622
|
-
while (true) {
|
|
623
|
-
this.skipBlank();
|
|
624
|
-
if (this.peekClose(block)) {
|
|
625
|
-
if (hasModifiers(pending))
|
|
626
|
-
this.throwDangling(pending);
|
|
627
|
-
this.takeClose(block);
|
|
628
|
-
return { values, children };
|
|
629
|
-
}
|
|
630
|
-
const next = this.peekSemantic();
|
|
631
|
-
if (next?.record !== undefined) {
|
|
632
|
-
const record = this.takeRecord();
|
|
633
|
-
if (record.type === "extensions" || record.type === "extend" || record.type === "aliases" || record.type === "alias" || record.type === "prompt") {
|
|
634
|
-
pending = this.addModifier(pending, record);
|
|
635
|
-
continue;
|
|
636
|
-
}
|
|
637
|
-
if (hasModifiers(pending))
|
|
638
|
-
this.throwUnsupportedModifiers(pending, record.type);
|
|
639
|
-
const order = recordOrder.indexOf(record.type);
|
|
640
|
-
if (childrenStarted || order < 0 || order < lastRecord || values.has(record.type) || record.slots.length !== 0) {
|
|
641
|
-
throw authoringError(`Metadata record in <${block}> is invalid or out of order.`, record.source, record.type, `Use each of ${recordOrder.join(", ")} at most once in canonical order before child blocks.`);
|
|
642
|
-
}
|
|
643
|
-
lastRecord = order;
|
|
644
|
-
values.set(record.type, record.content);
|
|
645
|
-
continue;
|
|
646
|
-
}
|
|
647
|
-
const tag = next?.tag;
|
|
648
|
-
if (tag === undefined || tag.closing || tag.name !== childName) {
|
|
649
|
-
const source = tag?.source ?? { line: this.index + 1, column: 1 };
|
|
650
|
-
throw authoringError(`Unexpected member in <${block}>.`, source, this.lines[this.index] ?? "<eof>", `Use metadata records followed by <${childName}> blocks.`);
|
|
651
|
-
}
|
|
652
|
-
childrenStarted = true;
|
|
653
|
-
children.push(parseChild(pending));
|
|
654
|
-
pending = emptyModifiers();
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
parseOnlyChildren(block, childName, parseChild) {
|
|
658
|
-
const children = [];
|
|
659
|
-
let pending = emptyModifiers();
|
|
660
|
-
while (true) {
|
|
661
|
-
this.skipBlank();
|
|
662
|
-
if (this.peekClose(block)) {
|
|
663
|
-
if (hasModifiers(pending))
|
|
664
|
-
this.throwDangling(pending);
|
|
665
|
-
this.takeClose(block);
|
|
666
|
-
return children;
|
|
667
|
-
}
|
|
668
|
-
const next = this.peekSemantic();
|
|
669
|
-
if (next?.record?.type === "extensions" || next?.record?.type === "extend") {
|
|
670
|
-
pending = this.addModifier(pending, this.takeRecord());
|
|
671
|
-
continue;
|
|
672
|
-
}
|
|
673
|
-
if (next?.tag === undefined || next.tag.closing || next.tag.name !== childName) {
|
|
674
|
-
const source = next?.tag?.source ?? next?.record?.source ?? { line: this.index + 1, column: 1 };
|
|
675
|
-
throw authoringError(`Only <${childName}> children are allowed in <${block}>.`, source, this.lines[this.index] ?? "<eof>", `Add complete <${childName}> blocks.`);
|
|
676
|
-
}
|
|
677
|
-
children.push(parseChild(pending));
|
|
678
|
-
pending = emptyModifiers();
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
addModifier(modifiers, record) {
|
|
682
|
-
const next = {
|
|
683
|
-
extend: { ...modifiers.extend },
|
|
684
|
-
extendPresent: modifiers.extendPresent,
|
|
685
|
-
aliases: [...modifiers.aliases],
|
|
686
|
-
aliasesPresent: modifiers.aliasesPresent,
|
|
687
|
-
phase: modifiers.phase,
|
|
688
|
-
...(modifiers.prompt !== undefined ? { prompt: modifiers.prompt } : {}),
|
|
689
|
-
source: modifiers.source ?? record.source,
|
|
690
|
-
};
|
|
691
|
-
if (record.type === "extensions") {
|
|
692
|
-
if (next.phase !== "extend" || next.extendPresent || record.slots.length !== 0 || record.content !== "") {
|
|
693
|
-
throw authoringError("Extensions marker is invalid or out of order.", record.source, record.content || "<empty>", "Use one [extensions] marker before extension records.");
|
|
694
|
-
}
|
|
695
|
-
next.extendPresent = true;
|
|
696
|
-
return next;
|
|
697
|
-
}
|
|
698
|
-
if (record.type === "extend") {
|
|
699
|
-
if (next.phase !== "extend" || record.slots.length !== 1 || !record.slots[0]) {
|
|
700
|
-
throw authoringError("Extend modifier is invalid or out of order.", record.source, record.slots.join("|"), "Place unique [extend|key] records first.");
|
|
701
|
-
}
|
|
702
|
-
const key = record.slots[0];
|
|
703
|
-
if (Object.hasOwn(next.extend, key)) {
|
|
704
|
-
throw authoringError("Extend key is duplicated.", record.source, key, "Keep one value for each extension key.");
|
|
705
|
-
}
|
|
706
|
-
let parsed;
|
|
707
|
-
try {
|
|
708
|
-
parsed = JSON.parse(record.content);
|
|
709
|
-
}
|
|
710
|
-
catch {
|
|
711
|
-
throw authoringError("Extension value is not valid JSON.", record.source, record.content, "Use one canonical JSON value.");
|
|
712
|
-
}
|
|
713
|
-
if (!isJsonValue(parsed)) {
|
|
714
|
-
throw authoringError("Extension value is not JSON-compatible.", record.source, record.content, "Use string, number, boolean, null, array, or object.");
|
|
715
|
-
}
|
|
716
|
-
next.extendPresent = true;
|
|
717
|
-
next.extend[key] = canonicalJson(parsed);
|
|
718
|
-
return next;
|
|
719
|
-
}
|
|
720
|
-
if (record.type === "aliases") {
|
|
721
|
-
if (next.phase !== "extend" || next.aliasesPresent || record.slots.length !== 0 || record.content !== "") {
|
|
722
|
-
throw authoringError("Aliases marker is invalid or out of order.", record.source, record.content || "<empty>", "Use one [aliases] marker after extensions and before alias records.");
|
|
723
|
-
}
|
|
724
|
-
next.phase = "alias";
|
|
725
|
-
next.aliasesPresent = true;
|
|
726
|
-
return next;
|
|
727
|
-
}
|
|
728
|
-
if (record.type === "alias") {
|
|
729
|
-
if (next.phase === "prompt" || record.slots.length !== 0 || !record.content) {
|
|
730
|
-
throw authoringError("Alias modifier is invalid or out of order.", record.source, record.content || "<empty>", "Place non-empty [alias] records after extensions and before prompt.");
|
|
731
|
-
}
|
|
732
|
-
next.phase = "alias";
|
|
733
|
-
next.aliasesPresent = true;
|
|
734
|
-
if (next.aliases.includes(record.content)) {
|
|
735
|
-
throw authoringError("Alias is duplicated.", record.source, record.content, "Keep each alias once.");
|
|
736
|
-
}
|
|
737
|
-
next.aliases.push(record.content);
|
|
738
|
-
return next;
|
|
739
|
-
}
|
|
740
|
-
if (record.type === "prompt") {
|
|
741
|
-
if (next.prompt !== undefined || record.slots.length !== 3 || record.slots.some((slot) => !slot)) {
|
|
742
|
-
throw authoringError("Prompt modifier is invalid.", record.source, record.slots.join("|"), "Use one [prompt|target|process|contrast] after extensions and aliases.");
|
|
743
|
-
}
|
|
744
|
-
if (!/^(?:actor:act_|location:loc_|prop:prp_)[A-Za-z0-9_-]+$/.test(record.slots[0])) {
|
|
745
|
-
throw authoringError("Prompt target is invalid.", record.source, record.slots[0], "Use actor:act_ID, location:loc_ID, or prop:prp_ID.");
|
|
746
|
-
}
|
|
747
|
-
next.phase = "prompt";
|
|
748
|
-
next.prompt = { target: record.slots[0], process: record.slots[1], contrast: record.slots[2] };
|
|
749
|
-
return next;
|
|
750
|
-
}
|
|
751
|
-
throw authoringError("Unknown prefix modifier.", record.source, record.type, "Use extend, alias, or prompt.");
|
|
752
|
-
}
|
|
753
|
-
requiredMetadata(values, key, source) {
|
|
754
|
-
const value = values.get(key);
|
|
755
|
-
if (value === undefined)
|
|
756
|
-
throw authoringError(`Script ${key} record is missing.`, source, `<script>`, `Add [${key}] in canonical metadata order.`);
|
|
757
|
-
return value;
|
|
758
|
-
}
|
|
759
|
-
peekSemantic() {
|
|
760
|
-
this.skipBlank();
|
|
761
|
-
if (this.index >= this.lines.length)
|
|
762
|
-
return null;
|
|
763
|
-
const raw = this.lines[this.index];
|
|
764
|
-
const tag = parseTag(raw, this.index + 1);
|
|
765
|
-
if (tag !== null)
|
|
766
|
-
return { tag };
|
|
767
|
-
if (raw.trimStart().startsWith("["))
|
|
768
|
-
return { record: parseBracketRecord(raw, this.index + 1) };
|
|
769
|
-
const source = { line: this.index + 1, column: Math.max(1, raw.search(/\S/) + 1) };
|
|
770
|
-
throw authoringError("Semantic line is neither a tag nor a bracket record.", source, raw, "Use only known tags, bracket records, or blank lines.");
|
|
771
|
-
}
|
|
772
|
-
peekTag() {
|
|
773
|
-
return this.peekSemantic()?.tag ?? null;
|
|
774
|
-
}
|
|
775
|
-
takeRecord() {
|
|
776
|
-
const item = this.peekSemantic();
|
|
777
|
-
if (item?.record === undefined) {
|
|
778
|
-
const source = item?.tag?.source ?? { line: this.index + 1, column: 1 };
|
|
779
|
-
throw authoringError("Expected a bracket record.", source, this.lines[this.index] ?? "<eof>", "Use the record required at this position.");
|
|
780
|
-
}
|
|
781
|
-
this.index += 1;
|
|
782
|
-
return item.record;
|
|
783
|
-
}
|
|
784
|
-
takeOpen(name) {
|
|
785
|
-
const tag = this.peekTag();
|
|
786
|
-
if (tag === null || tag.closing || tag.name !== name) {
|
|
787
|
-
const source = tag?.source ?? { line: this.index + 1, column: 1 };
|
|
788
|
-
throw authoringError(`Expected <${name}>.`, source, this.lines[this.index] ?? "<eof>", `Open <${name}> here.`);
|
|
789
|
-
}
|
|
790
|
-
this.index += 1;
|
|
791
|
-
return tag;
|
|
792
|
-
}
|
|
793
|
-
takeClose(name) {
|
|
794
|
-
const tag = this.peekTag();
|
|
795
|
-
if (tag === null || !tag.closing || tag.name !== name) {
|
|
796
|
-
const source = tag?.source ?? { line: this.index + 1, column: 1 };
|
|
797
|
-
throw authoringError(`Expected </${name}>.`, source, this.lines[this.index] ?? "<eof>", `Close the current <${name}> block.`);
|
|
798
|
-
}
|
|
799
|
-
this.index += 1;
|
|
800
|
-
return tag;
|
|
801
|
-
}
|
|
802
|
-
peekClose(name) {
|
|
803
|
-
const tag = this.peekTag();
|
|
804
|
-
return tag !== null && tag.closing && tag.name === name;
|
|
805
|
-
}
|
|
806
|
-
skipBlank() {
|
|
807
|
-
while (this.index < this.lines.length && this.lines[this.index].trim() === "")
|
|
808
|
-
this.index += 1;
|
|
809
|
-
}
|
|
810
|
-
eofError(block) {
|
|
811
|
-
return authoringError(`Unexpected end of file inside <${block}>.`, { line: this.lines.length, column: 1 }, "<eof>", `Add </${block}>.`);
|
|
812
|
-
}
|
|
813
|
-
throwDangling(modifiers) {
|
|
814
|
-
throw authoringError("Prefix modifier has no following node.", modifiers.source ?? { line: this.index + 1, column: 1 }, "dangling modifier", "Move it directly before a supported node.");
|
|
815
|
-
}
|
|
816
|
-
throwUnsupportedModifiers(modifiers, node) {
|
|
817
|
-
throw authoringError("Prefix modifier does not apply to this node.", modifiers.source ?? { line: this.index + 1, column: 1 }, node, "Remove the unsupported modifier or move it before a supported node.");
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
export function parseAuthoring(text) {
|
|
821
|
-
return new Parser(text).parse();
|
|
822
|
-
}
|
|
823
|
-
//# sourceMappingURL=parser.js.map
|