@lingjingai/scriptctl 0.49.16 → 0.50.0
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 +8 -2
- package/changes/0.50.0.md +63 -0
- package/changes/unreleased.md +2 -1
- package/dist/cli.js +26 -5
- package/dist/cli.js.map +1 -1
- package/dist/domain/authoring/apply.d.ts +1 -33
- package/dist/domain/authoring/apply.js +1 -783
- package/dist/domain/authoring/apply.js.map +1 -1
- package/dist/domain/authoring/export.d.ts +1 -7
- package/dist/domain/authoring/export.js +1 -84
- package/dist/domain/authoring/export.js.map +1 -1
- package/dist/domain/authoring/parser.d.ts +2 -3
- package/dist/domain/authoring/parser.js +2 -914
- package/dist/domain/authoring/parser.js.map +1 -1
- package/dist/domain/authoring/serializer.d.ts +1 -2
- package/dist/domain/authoring/serializer.js +1 -243
- package/dist/domain/authoring/serializer.js.map +1 -1
- package/dist/domain/authoring/shared/bracket.d.ts +4 -0
- package/dist/domain/authoring/shared/bracket.js +95 -0
- package/dist/domain/authoring/shared/bracket.js.map +1 -0
- package/dist/domain/authoring/shared/types.d.ts +12 -0
- package/dist/domain/authoring/shared/types.js +2 -0
- package/dist/domain/authoring/shared/types.js.map +1 -0
- package/dist/domain/authoring/types.d.ts +2 -87
- package/dist/domain/authoring/types.js +2 -1
- package/dist/domain/authoring/types.js.map +1 -1
- package/dist/domain/authoring/v3/apply.d.ts +33 -0
- package/dist/domain/authoring/v3/apply.js +784 -0
- package/dist/domain/authoring/v3/apply.js.map +1 -0
- package/dist/domain/authoring/v3/export.d.ts +7 -0
- package/dist/domain/authoring/v3/export.js +85 -0
- package/dist/domain/authoring/v3/export.js.map +1 -0
- package/dist/domain/authoring/v3/parser.d.ts +3 -0
- package/dist/domain/authoring/v3/parser.js +823 -0
- package/dist/domain/authoring/v3/parser.js.map +1 -0
- package/dist/domain/authoring/v3/serializer.d.ts +2 -0
- package/dist/domain/authoring/v3/serializer.js +244 -0
- package/dist/domain/authoring/v3/serializer.js.map +1 -0
- package/dist/domain/authoring/v3/types.d.ts +76 -0
- package/dist/domain/authoring/v3/types.js +2 -0
- package/dist/domain/authoring/v3/types.js.map +1 -0
- package/dist/domain/authoring/v4/apply.d.ts +40 -0
- package/dist/domain/authoring/v4/apply.js +451 -0
- package/dist/domain/authoring/v4/apply.js.map +1 -0
- package/dist/domain/authoring/v4/parser.d.ts +2 -0
- package/dist/domain/authoring/v4/parser.js +729 -0
- package/dist/domain/authoring/v4/parser.js.map +1 -0
- package/dist/domain/authoring/v4/serializer.d.ts +6 -0
- package/dist/domain/authoring/v4/serializer.js +280 -0
- package/dist/domain/authoring/v4/serializer.js.map +1 -0
- package/dist/domain/authoring/v4/types.d.ts +50 -0
- package/dist/domain/authoring/v4/types.js +2 -0
- package/dist/domain/authoring/v4/types.js.map +1 -0
- package/dist/domain/ingest/apply-plan.d.ts +1 -1
- package/dist/domain/ingest/assembler.d.ts +9 -0
- package/dist/domain/ingest/assembler.js +98 -36
- package/dist/domain/ingest/assembler.js.map +1 -1
- package/dist/domain/ingest/asset-audit.d.ts +50 -0
- package/dist/domain/ingest/asset-audit.js +196 -0
- package/dist/domain/ingest/asset-audit.js.map +1 -0
- package/dist/domain/ingest/production-validation.d.ts +5 -4
- package/dist/domain/ingest/production-validation.js +10 -25
- package/dist/domain/ingest/production-validation.js.map +1 -1
- package/dist/domain/ingest/records.d.ts +1 -1
- package/dist/domain/ingest/records.js +1 -1
- package/dist/domain/ingest/records.js.map +1 -1
- package/dist/domain/ingest/serial-context.d.ts +1 -1
- package/dist/domain/ingest/validation.d.ts +1 -11
- package/dist/domain/ingest/validation.js +1 -199
- package/dist/domain/ingest/validation.js.map +1 -1
- package/dist/domain/ingest/video-apply.js +68 -45
- package/dist/domain/ingest/video-apply.js.map +1 -1
- package/dist/domain/script/address.d.ts +1 -32
- package/dist/domain/script/address.js +1 -144
- package/dist/domain/script/address.js.map +1 -1
- package/dist/domain/script/dispatch.d.ts +14 -0
- package/dist/domain/script/dispatch.js +47 -0
- package/dist/domain/script/dispatch.js.map +1 -0
- package/dist/domain/script/lookups.d.ts +1 -33
- package/dist/domain/script/lookups.js +1 -316
- package/dist/domain/script/lookups.js.map +1 -1
- package/dist/domain/script/parse.d.ts +1 -3
- package/dist/domain/script/parse.js +1 -164
- package/dist/domain/script/parse.js.map +1 -1
- package/dist/domain/script/patch/apply.d.ts +1 -2
- package/dist/domain/script/patch/apply.js +1 -30
- package/dist/domain/script/patch/apply.js.map +1 -1
- package/dist/domain/script/patch/helpers.d.ts +1 -17
- package/dist/domain/script/patch/helpers.js +1 -210
- package/dist/domain/script/patch/helpers.js.map +1 -1
- package/dist/domain/script/patch/inline-speaker.d.ts +1 -2
- package/dist/domain/script/patch/inline-speaker.js +1 -49
- package/dist/domain/script/patch/inline-speaker.js.map +1 -1
- package/dist/domain/script/patch/ops-action.d.ts +1 -12
- package/dist/domain/script/patch/ops-action.js +1 -366
- package/dist/domain/script/patch/ops-action.js.map +1 -1
- package/dist/domain/script/patch/ops-asset.d.ts +1 -14
- package/dist/domain/script/patch/ops-asset.js +1 -364
- package/dist/domain/script/patch/ops-asset.js.map +1 -1
- package/dist/domain/script/patch/ops-dialogue.d.ts +1 -2
- package/dist/domain/script/patch/ops-dialogue.js +1 -25
- package/dist/domain/script/patch/ops-dialogue.js.map +1 -1
- package/dist/domain/script/patch/ops-extend.d.ts +1 -8
- package/dist/domain/script/patch/ops-extend.js +1 -110
- package/dist/domain/script/patch/ops-extend.js.map +1 -1
- package/dist/domain/script/patch/ops-meta.d.ts +1 -5
- package/dist/domain/script/patch/ops-meta.js +1 -81
- package/dist/domain/script/patch/ops-meta.js.map +1 -1
- package/dist/domain/script/patch/ops-scene.d.ts +1 -6
- package/dist/domain/script/patch/ops-scene.js +1 -350
- package/dist/domain/script/patch/ops-scene.js.map +1 -1
- package/dist/domain/script/patch/ops-state.d.ts +1 -8
- package/dist/domain/script/patch/ops-state.js +1 -164
- package/dist/domain/script/patch/ops-state.js.map +1 -1
- package/dist/domain/script/patch/registry.d.ts +1 -2
- package/dist/domain/script/patch/registry.js +1 -52
- package/dist/domain/script/patch/registry.js.map +1 -1
- package/dist/domain/script/patch/types.d.ts +1 -10
- package/dist/domain/script/patch/types.js +1 -1
- package/dist/domain/script/patch/types.js.map +1 -1
- package/dist/domain/script/refs.d.ts +1 -4
- package/dist/domain/script/refs.js +1 -63
- package/dist/domain/script/refs.js.map +1 -1
- package/dist/domain/script/scene-refs.d.ts +1 -3
- package/dist/domain/script/scene-refs.js +1 -34
- package/dist/domain/script/scene-refs.js.map +1 -1
- package/dist/domain/script/schema.d.ts +1 -6
- package/dist/domain/script/schema.js +1 -55
- package/dist/domain/script/schema.js.map +1 -1
- package/dist/domain/script/selector.d.ts +1 -45
- package/dist/domain/script/selector.js +1 -184
- package/dist/domain/script/selector.js.map +1 -1
- package/dist/domain/script/shared/regex.d.ts +2 -0
- package/dist/domain/script/shared/regex.js +7 -0
- package/dist/domain/script/shared/regex.js.map +1 -0
- package/dist/domain/script/shared/types.d.ts +18 -0
- package/dist/domain/script/shared/types.js +9 -0
- package/dist/domain/script/shared/types.js.map +1 -0
- package/dist/domain/script/shared/validation.d.ts +10 -0
- package/dist/domain/script/shared/validation.js +2 -0
- package/dist/domain/script/shared/validation.js.map +1 -0
- package/dist/domain/script/types.d.ts +1 -123
- package/dist/domain/script/types.js +1 -8
- package/dist/domain/script/types.js.map +1 -1
- package/dist/domain/script/v3/address.d.ts +32 -0
- package/dist/domain/script/v3/address.js +145 -0
- package/dist/domain/script/v3/address.js.map +1 -0
- package/dist/domain/script/v3/lookups.d.ts +33 -0
- package/dist/domain/script/v3/lookups.js +317 -0
- package/dist/domain/script/v3/lookups.js.map +1 -0
- package/dist/domain/script/v3/ordinal.d.ts +8 -0
- package/dist/domain/script/v3/ordinal.js +92 -0
- package/dist/domain/script/v3/ordinal.js.map +1 -0
- package/dist/domain/script/v3/parse.d.ts +3 -0
- package/dist/domain/script/v3/parse.js +165 -0
- package/dist/domain/script/v3/parse.js.map +1 -0
- package/dist/domain/script/v3/patch/apply.d.ts +2 -0
- package/dist/domain/script/v3/patch/apply.js +31 -0
- package/dist/domain/script/v3/patch/apply.js.map +1 -0
- package/dist/domain/script/v3/patch/helpers.d.ts +17 -0
- package/dist/domain/script/v3/patch/helpers.js +211 -0
- package/dist/domain/script/v3/patch/helpers.js.map +1 -0
- package/dist/domain/script/v3/patch/inline-speaker.d.ts +2 -0
- package/dist/domain/script/v3/patch/inline-speaker.js +50 -0
- package/dist/domain/script/v3/patch/inline-speaker.js.map +1 -0
- package/dist/domain/script/v3/patch/ops-action.d.ts +12 -0
- package/dist/domain/script/v3/patch/ops-action.js +367 -0
- package/dist/domain/script/v3/patch/ops-action.js.map +1 -0
- package/dist/domain/script/v3/patch/ops-asset.d.ts +14 -0
- package/dist/domain/script/v3/patch/ops-asset.js +365 -0
- package/dist/domain/script/v3/patch/ops-asset.js.map +1 -0
- package/dist/domain/script/v3/patch/ops-dialogue.d.ts +2 -0
- package/dist/domain/script/v3/patch/ops-dialogue.js +26 -0
- package/dist/domain/script/v3/patch/ops-dialogue.js.map +1 -0
- package/dist/domain/script/v3/patch/ops-extend.d.ts +8 -0
- package/dist/domain/script/v3/patch/ops-extend.js +111 -0
- package/dist/domain/script/v3/patch/ops-extend.js.map +1 -0
- package/dist/domain/script/v3/patch/ops-meta.d.ts +5 -0
- package/dist/domain/script/v3/patch/ops-meta.js +82 -0
- package/dist/domain/script/v3/patch/ops-meta.js.map +1 -0
- package/dist/domain/script/v3/patch/ops-scene.d.ts +6 -0
- package/dist/domain/script/v3/patch/ops-scene.js +351 -0
- package/dist/domain/script/v3/patch/ops-scene.js.map +1 -0
- package/dist/domain/script/v3/patch/ops-state.d.ts +8 -0
- package/dist/domain/script/v3/patch/ops-state.js +165 -0
- package/dist/domain/script/v3/patch/ops-state.js.map +1 -0
- package/dist/domain/script/v3/patch/registry.d.ts +2 -0
- package/dist/domain/script/v3/patch/registry.js +53 -0
- package/dist/domain/script/v3/patch/registry.js.map +1 -0
- package/dist/domain/script/v3/patch/types.d.ts +10 -0
- package/dist/domain/script/v3/patch/types.js +2 -0
- package/dist/domain/script/v3/patch/types.js.map +1 -0
- package/dist/domain/script/v3/refs.d.ts +4 -0
- package/dist/domain/script/v3/refs.js +64 -0
- package/dist/domain/script/v3/refs.js.map +1 -0
- package/dist/domain/script/v3/scene-refs.d.ts +3 -0
- package/dist/domain/script/v3/scene-refs.js +35 -0
- package/dist/domain/script/v3/scene-refs.js.map +1 -0
- package/dist/domain/script/v3/schema.d.ts +6 -0
- package/dist/domain/script/v3/schema.js +56 -0
- package/dist/domain/script/v3/schema.js.map +1 -0
- package/dist/domain/script/v3/selector.d.ts +44 -0
- package/dist/domain/script/v3/selector.js +180 -0
- package/dist/domain/script/v3/selector.js.map +1 -0
- package/dist/domain/script/v3/types.d.ts +106 -0
- package/dist/domain/script/v3/types.js +2 -0
- package/dist/domain/script/v3/types.js.map +1 -0
- package/dist/domain/script/v3/validation.d.ts +3 -0
- package/dist/domain/script/v3/validation.js +200 -0
- package/dist/domain/script/v3/validation.js.map +1 -0
- package/dist/domain/script/v4/address.d.ts +61 -0
- package/dist/domain/script/v4/address.js +100 -0
- package/dist/domain/script/v4/address.js.map +1 -0
- package/dist/domain/script/v4/factory.d.ts +2 -0
- package/dist/domain/script/v4/factory.js +13 -0
- package/dist/domain/script/v4/factory.js.map +1 -0
- package/dist/domain/script/v4/from-v3.d.ts +29 -0
- package/dist/domain/script/v4/from-v3.js +307 -0
- package/dist/domain/script/v4/from-v3.js.map +1 -0
- package/dist/domain/script/v4/ids.d.ts +27 -0
- package/dist/domain/script/v4/ids.js +63 -0
- package/dist/domain/script/v4/ids.js.map +1 -0
- package/dist/domain/script/v4/ordinal.d.ts +3 -0
- package/dist/domain/script/v4/ordinal.js +67 -0
- package/dist/domain/script/v4/ordinal.js.map +1 -0
- package/dist/domain/script/v4/parse.d.ts +3 -0
- package/dist/domain/script/v4/parse.js +18 -0
- package/dist/domain/script/v4/parse.js.map +1 -0
- package/dist/domain/script/v4/patch/apply.d.ts +3 -0
- package/dist/domain/script/v4/patch/apply.js +24 -0
- package/dist/domain/script/v4/patch/apply.js.map +1 -0
- package/dist/domain/script/v4/patch/helpers.d.ts +32 -0
- package/dist/domain/script/v4/patch/helpers.js +139 -0
- package/dist/domain/script/v4/patch/helpers.js.map +1 -0
- package/dist/domain/script/v4/patch/ops-action.d.ts +13 -0
- package/dist/domain/script/v4/patch/ops-action.js +379 -0
- package/dist/domain/script/v4/patch/ops-action.js.map +1 -0
- package/dist/domain/script/v4/patch/ops-asset.d.ts +17 -0
- package/dist/domain/script/v4/patch/ops-asset.js +617 -0
- package/dist/domain/script/v4/patch/ops-asset.js.map +1 -0
- package/dist/domain/script/v4/patch/ops-extend.d.ts +11 -0
- package/dist/domain/script/v4/patch/ops-extend.js +86 -0
- package/dist/domain/script/v4/patch/ops-extend.js.map +1 -0
- package/dist/domain/script/v4/patch/ops-meta.d.ts +5 -0
- package/dist/domain/script/v4/patch/ops-meta.js +49 -0
- package/dist/domain/script/v4/patch/ops-meta.js.map +1 -0
- package/dist/domain/script/v4/patch/ops-scene-ref.d.ts +3 -0
- package/dist/domain/script/v4/patch/ops-scene-ref.js +98 -0
- package/dist/domain/script/v4/patch/ops-scene-ref.js.map +1 -0
- package/dist/domain/script/v4/patch/ops-structure.d.ts +6 -0
- package/dist/domain/script/v4/patch/ops-structure.js +236 -0
- package/dist/domain/script/v4/patch/ops-structure.js.map +1 -0
- package/dist/domain/script/v4/patch/registry.d.ts +2 -0
- package/dist/domain/script/v4/patch/registry.js +50 -0
- package/dist/domain/script/v4/patch/registry.js.map +1 -0
- package/dist/domain/script/v4/patch/schema.d.ts +7 -0
- package/dist/domain/script/v4/patch/schema.js +75 -0
- package/dist/domain/script/v4/patch/schema.js.map +1 -0
- package/dist/domain/script/v4/patch/types.d.ts +10 -0
- package/dist/domain/script/v4/patch/types.js +2 -0
- package/dist/domain/script/v4/patch/types.js.map +1 -0
- package/dist/domain/script/v4/selector.d.ts +11 -0
- package/dist/domain/script/v4/selector.js +125 -0
- package/dist/domain/script/v4/selector.js.map +1 -0
- package/dist/domain/script/v4/types.d.ts +120 -0
- package/dist/domain/script/v4/types.js +2 -0
- package/dist/domain/script/v4/types.js.map +1 -0
- package/dist/domain/script/v4/validation.d.ts +2 -0
- package/dist/domain/script/v4/validation.js +378 -0
- package/dist/domain/script/v4/validation.js.map +1 -0
- package/dist/help-text.js +146 -114
- package/dist/help-text.js.map +1 -1
- package/dist/llm/config.js +2 -0
- package/dist/llm/config.js.map +1 -1
- package/dist/llm/registry.d.ts +1 -0
- package/dist/llm/registry.js +3 -0
- package/dist/llm/registry.js.map +1 -1
- package/dist/llm/tasks/ingest/asset-audit.d.ts +6 -0
- package/dist/llm/tasks/ingest/asset-audit.js +164 -0
- package/dist/llm/tasks/ingest/asset-audit.js.map +1 -0
- package/dist/llm/tasks/ingest/asset-curate.d.ts +1 -1
- package/dist/llm/types.d.ts +1 -1
- package/dist/llm/types.js.map +1 -1
- package/dist/usecases/ingest/command.js +1 -1
- package/dist/usecases/ingest/final-asset-audit.d.ts +39 -0
- package/dist/usecases/ingest/final-asset-audit.js +88 -0
- package/dist/usecases/ingest/final-asset-audit.js.map +1 -0
- package/dist/usecases/ingest/pipeline.js +62 -11
- package/dist/usecases/ingest/pipeline.js.map +1 -1
- package/dist/usecases/ingest/serial-govern.d.ts +2 -1
- package/dist/usecases/ingest/serial-govern.js +11 -4
- package/dist/usecases/ingest/serial-govern.js.map +1 -1
- package/dist/usecases/ingest/video-pipeline.js +100 -14
- package/dist/usecases/ingest/video-pipeline.js.map +1 -1
- package/dist/usecases/ingest/view-server.js +2 -2
- package/dist/usecases/ingest/view-server.js.map +1 -1
- package/dist/usecases/script/actions.js +101 -5
- package/dist/usecases/script/actions.js.map +1 -1
- package/dist/usecases/script/actors.js +16 -7
- package/dist/usecases/script/actors.js.map +1 -1
- package/dist/usecases/script/alias.js +7 -6
- package/dist/usecases/script/alias.js.map +1 -1
- package/dist/usecases/script/assets.js +18 -2
- package/dist/usecases/script/assets.js.map +1 -1
- package/dist/usecases/script/audit-assets.d.ts +4 -0
- package/dist/usecases/script/audit-assets.js +40 -0
- package/dist/usecases/script/audit-assets.js.map +1 -0
- package/dist/usecases/script/command-constraints.d.ts +36 -0
- package/dist/usecases/script/command-constraints.js +115 -0
- package/dist/usecases/script/command-constraints.js.map +1 -0
- package/dist/usecases/script/context.js +31 -4
- package/dist/usecases/script/context.js.map +1 -1
- package/dist/usecases/script/create.js +2 -2
- package/dist/usecases/script/create.js.map +1 -1
- package/dist/usecases/script/delete.js +6 -3
- package/dist/usecases/script/delete.js.map +1 -1
- package/dist/usecases/script/describe.js +7 -4
- package/dist/usecases/script/describe.js.map +1 -1
- package/dist/usecases/script/dialogue.js +15 -5
- package/dist/usecases/script/dialogue.js.map +1 -1
- package/dist/usecases/script/dispatch.d.ts +3 -0
- package/dist/usecases/script/dispatch.js +10 -0
- package/dist/usecases/script/dispatch.js.map +1 -0
- package/dist/usecases/script/do.js +74 -11
- package/dist/usecases/script/do.js.map +1 -1
- package/dist/usecases/script/emotion.js +14 -3
- package/dist/usecases/script/emotion.js.map +1 -1
- package/dist/usecases/script/episodes.js +15 -4
- package/dist/usecases/script/episodes.js.map +1 -1
- package/dist/usecases/script/export-authoring.js +35 -11
- package/dist/usecases/script/export-authoring.js.map +1 -1
- package/dist/usecases/script/extend.js +23 -15
- package/dist/usecases/script/extend.js.map +1 -1
- package/dist/usecases/script/ids.js +53 -10
- package/dist/usecases/script/ids.js.map +1 -1
- package/dist/usecases/script/insert.js +74 -38
- package/dist/usecases/script/insert.js.map +1 -1
- package/dist/usecases/script/lib.d.ts +50 -1
- package/dist/usecases/script/lib.js +599 -61
- package/dist/usecases/script/lib.js.map +1 -1
- package/dist/usecases/script/locations.js +16 -7
- package/dist/usecases/script/locations.js.map +1 -1
- package/dist/usecases/script/merge.js +8 -5
- package/dist/usecases/script/merge.js.map +1 -1
- package/dist/usecases/script/move.js +24 -5
- package/dist/usecases/script/move.js.map +1 -1
- package/dist/usecases/script/parenthetical.d.ts +3 -0
- package/dist/usecases/script/parenthetical.js +55 -0
- package/dist/usecases/script/parenthetical.js.map +1 -0
- package/dist/usecases/script/props.js +16 -7
- package/dist/usecases/script/props.js.map +1 -1
- package/dist/usecases/script/refs.js +44 -0
- package/dist/usecases/script/refs.js.map +1 -1
- package/dist/usecases/script/rename.js +7 -4
- package/dist/usecases/script/rename.js.map +1 -1
- package/dist/usecases/script/scenes.js +32 -6
- package/dist/usecases/script/scenes.js.map +1 -1
- package/dist/usecases/script/script-patch.js +180 -16
- package/dist/usecases/script/script-patch.js.map +1 -1
- package/dist/usecases/script/session.d.ts +3 -0
- package/dist/usecases/script/session.js +25 -5
- package/dist/usecases/script/session.js.map +1 -1
- package/dist/usecases/script/split.js +12 -6
- package/dist/usecases/script/split.js.map +1 -1
- package/dist/usecases/script/states.js +45 -1
- package/dist/usecases/script/states.js.map +1 -1
- package/dist/usecases/script/synopsis.js +11 -4
- package/dist/usecases/script/synopsis.js.map +1 -1
- package/dist/usecases/script/v3/mutations.d.ts +2 -0
- package/dist/usecases/script/v3/mutations.js +5 -0
- package/dist/usecases/script/v3/mutations.js.map +1 -0
- package/dist/usecases/script/v4/mutations.d.ts +2 -0
- package/dist/usecases/script/v4/mutations.js +6 -0
- package/dist/usecases/script/v4/mutations.js.map +1 -0
- package/dist/usecases/script/v4/queries.d.ts +14 -0
- package/dist/usecases/script/v4/queries.js +154 -0
- package/dist/usecases/script/v4/queries.js.map +1 -0
- package/dist/usecases/script/working-copy.js +3 -3
- package/dist/usecases/script/working-copy.js.map +1 -1
- package/dist/usecases/script/write-authoring.js +99 -5
- package/dist/usecases/script/write-authoring.js.map +1 -1
- package/package.json +3 -2
- package/skills/scriptctl/SKILL.md +122 -282
- package/skills/scriptctl/references/atomic-edit-workflow.md +23 -38
- package/skills/scriptctl/references/bulk-authoring.md +35 -154
- package/skills/scriptctl/references/ingest-workflow.md +12 -11
- package/skills/scriptctl/references/production-writing-standard.md +38 -67
- package/skills/scriptctl/references/state-reference-repair.md +19 -42
|
@@ -1,185 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { asList, idNum, strOf } from "./shared.js";
|
|
3
|
-
import { parseAnyAddress } from "./address.js";
|
|
4
|
-
export const MAX_GREP_PATTERN_LEN = 256;
|
|
5
|
-
export function isDangerousRegex(pattern) {
|
|
6
|
-
if (pattern.length > MAX_GREP_PATTERN_LEN)
|
|
7
|
-
return true;
|
|
8
|
-
return /\([^)]*[*+?{][^)]*\)[*+?{]/.test(pattern);
|
|
9
|
-
}
|
|
10
|
-
export function cmpAction(a, b) {
|
|
11
|
-
return a.scn - b.scn || a.idx - b.idx;
|
|
12
|
-
}
|
|
13
|
-
export function regionMatchesScene(r, ep, scn) {
|
|
14
|
-
switch (r.level) {
|
|
15
|
-
case "episode": return ep >= r.lo && ep <= r.hi;
|
|
16
|
-
case "scene": return scn >= r.lo && scn <= r.hi;
|
|
17
|
-
case "action": return scn >= r.lo.scn && scn <= r.hi.scn;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
export function regionMatchesAction(r, ep, scn, idx) {
|
|
21
|
-
switch (r.level) {
|
|
22
|
-
case "episode": return ep >= r.lo && ep <= r.hi;
|
|
23
|
-
case "scene": return scn >= r.lo && scn <= r.hi;
|
|
24
|
-
case "action": {
|
|
25
|
-
const p = { scn, idx };
|
|
26
|
-
// Lexicographic (scn, idx) containment covers same-scene, cross-scene
|
|
27
|
-
// start/internal/end in one comparison.
|
|
28
|
-
return cmpAction(r.lo, p) <= 0 && cmpAction(p, r.hi) <= 0;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export class RegionSelector {
|
|
33
|
-
regions;
|
|
34
|
-
constructor(regions) {
|
|
35
|
-
this.regions = regions;
|
|
36
|
-
}
|
|
37
|
-
get isEmpty() {
|
|
38
|
-
return this.regions.length === 0;
|
|
39
|
-
}
|
|
40
|
-
matchesScene(epId, sceneId) {
|
|
41
|
-
if (this.regions.length === 0)
|
|
42
|
-
return true;
|
|
43
|
-
const ep = idNum(epId, "ep");
|
|
44
|
-
const scn = idNum(sceneId, "scn");
|
|
45
|
-
return this.regions.some((r) => regionMatchesScene(r, ep, scn));
|
|
46
|
-
}
|
|
47
|
-
matchesAction(epId, sceneId, idx) {
|
|
48
|
-
if (this.regions.length === 0)
|
|
49
|
-
return true;
|
|
50
|
-
const ep = idNum(epId, "ep");
|
|
51
|
-
const scn = idNum(sceneId, "scn");
|
|
52
|
-
return this.regions.some((r) => regionMatchesAction(r, ep, scn, idx));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
export function inSelectorError(detail, received) {
|
|
56
|
-
return new CliError("QUERY BLOCKED: --in address invalid", "--in address invalid.", {
|
|
57
|
-
exitCode: EXIT_USAGE,
|
|
58
|
-
required: ["--in: ep_NNN | ep_NNN/scn_NNN | ep_NNN/scn_NNN#idx; ranges via '..'; multiple regions comma-separated"],
|
|
59
|
-
received: [`${received} (${detail})`],
|
|
60
|
-
nextSteps: ["Example: ep_003..ep_007,ep_010/scn_001..ep_010/scn_004"],
|
|
61
|
-
errorCode: "IN_ADDRESS_INVALID",
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
export function parseRegion(region, full) {
|
|
65
|
-
const parts = region.split("..");
|
|
66
|
-
if (parts.length > 2)
|
|
67
|
-
throw inSelectorError(`too many '..' in "${region}"`, full);
|
|
68
|
-
const loRaw = parts[0].trim();
|
|
69
|
-
const hiRaw = (parts.length === 2 ? parts[1] : parts[0]).trim();
|
|
70
|
-
if (!loRaw || !hiRaw)
|
|
71
|
-
throw inSelectorError(`empty range endpoint in "${region}"`, full);
|
|
72
|
-
let loAddr;
|
|
73
|
-
let hiAddr;
|
|
74
|
-
try {
|
|
75
|
-
loAddr = parseAnyAddress(loRaw);
|
|
76
|
-
hiAddr = parseAnyAddress(hiRaw);
|
|
77
|
-
}
|
|
78
|
-
catch {
|
|
79
|
-
throw inSelectorError(`endpoint not a valid address in "${region}"`, full);
|
|
80
|
-
}
|
|
81
|
-
if (loAddr.kind !== hiAddr.kind) {
|
|
82
|
-
throw new CliError("QUERY BLOCKED: --in range endpoints mismatch", "Range endpoints must be the same address kind.", {
|
|
83
|
-
exitCode: EXIT_USAGE,
|
|
84
|
-
required: ["both endpoints episode | scene | action"],
|
|
85
|
-
received: [`${loRaw}(${loAddr.kind})..${hiRaw}(${hiAddr.kind})`],
|
|
86
|
-
nextSteps: ["Make both endpoints the same kind, e.g. ep_003..ep_007 or ep_001/scn_002..ep_003/scn_009."],
|
|
87
|
-
errorCode: "IN_RANGE_KIND_MISMATCH",
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
if (loAddr.kind === "episode" && hiAddr.kind === "episode") {
|
|
91
|
-
const a = idNum(loAddr.episodeId, "ep");
|
|
92
|
-
const b = idNum(hiAddr.episodeId, "ep");
|
|
93
|
-
if (Number.isNaN(a) || Number.isNaN(b))
|
|
94
|
-
throw inSelectorError(`malformed episode id in "${region}"`, full);
|
|
95
|
-
return a <= b ? { level: "episode", lo: a, hi: b } : { level: "episode", lo: b, hi: a };
|
|
96
|
-
}
|
|
97
|
-
if (loAddr.kind === "scene" && hiAddr.kind === "scene") {
|
|
98
|
-
const a = idNum(loAddr.sceneId, "scn");
|
|
99
|
-
const b = idNum(hiAddr.sceneId, "scn");
|
|
100
|
-
if (Number.isNaN(a) || Number.isNaN(b))
|
|
101
|
-
throw inSelectorError(`malformed scene id in "${region}"`, full);
|
|
102
|
-
return a <= b ? { level: "scene", lo: a, hi: b } : { level: "scene", lo: b, hi: a };
|
|
103
|
-
}
|
|
104
|
-
if (loAddr.kind === "action" && hiAddr.kind === "action") {
|
|
105
|
-
const a = { scn: idNum(loAddr.sceneId, "scn"), idx: loAddr.actionIndex };
|
|
106
|
-
const b = { scn: idNum(hiAddr.sceneId, "scn"), idx: hiAddr.actionIndex };
|
|
107
|
-
if (Number.isNaN(a.scn) || Number.isNaN(b.scn))
|
|
108
|
-
throw inSelectorError(`malformed scene id in "${region}"`, full);
|
|
109
|
-
return cmpAction(a, b) <= 0 ? { level: "action", lo: a, hi: b } : { level: "action", lo: b, hi: a };
|
|
110
|
-
}
|
|
111
|
-
// asset / state / speaker addresses are not valid scope anchors for --in.
|
|
112
|
-
throw inSelectorError(`address kind '${loAddr.kind}' not valid in --in`, full);
|
|
113
|
-
}
|
|
114
|
-
// Whole-script selector: `--in '*'`. Distinct from an empty selector — it
|
|
115
|
-
// matches everything but `isEmpty` is false, so writes can tell "scope is
|
|
116
|
-
// intentionally the whole script" apart from "no scope given" (a bare,
|
|
117
|
-
// dangerous dump that callers refuse).
|
|
118
|
-
export const WHOLE_SCRIPT = {
|
|
119
|
-
isEmpty: false,
|
|
120
|
-
matchesScene: () => true,
|
|
121
|
-
matchesAction: () => true,
|
|
122
|
-
};
|
|
123
|
-
export function parseInSelector(raw) {
|
|
124
|
-
const value = strOf(raw).trim();
|
|
125
|
-
if (!value)
|
|
126
|
-
return new RegionSelector([]);
|
|
127
|
-
if (value === "*")
|
|
128
|
-
return WHOLE_SCRIPT;
|
|
129
|
-
const regions = [];
|
|
130
|
-
for (const seg of value.split(",")) {
|
|
131
|
-
const region = seg.trim();
|
|
132
|
-
if (!region)
|
|
133
|
-
throw inSelectorError("empty region (stray comma?)", value);
|
|
134
|
-
regions.push(parseRegion(region, value));
|
|
135
|
-
}
|
|
136
|
-
return new RegionSelector(regions);
|
|
137
|
-
}
|
|
138
|
-
// When the entire selector is a single action point (e.g. `ep_001/scn_003#2`),
|
|
139
|
-
// asset queries preserve their legacy "narrow to that one action's refs"
|
|
140
|
-
// behavior. Any range or multi-region selector falls back to the union over
|
|
141
|
-
// matched scenes. Returns the global scn number + action index, or null.
|
|
142
|
-
export function selectorSingleActionPoint(sel) {
|
|
143
|
-
if (!(sel instanceof RegionSelector))
|
|
144
|
-
return null;
|
|
145
|
-
if (sel.regions.length !== 1)
|
|
146
|
-
return null;
|
|
147
|
-
const r = sel.regions[0];
|
|
148
|
-
if (r.level !== "action")
|
|
149
|
-
return null;
|
|
150
|
-
if (r.lo.scn !== r.hi.scn || r.lo.idx !== r.hi.idx)
|
|
151
|
-
return null;
|
|
152
|
-
return { scn: r.lo.scn, idx: r.lo.idx };
|
|
153
|
-
}
|
|
154
|
-
// Expand a selector into the concrete action refs (`ep/scn#idx`, 0-based) it
|
|
155
|
-
// matches, in document order. The batch-edit framework feeds these straight
|
|
156
|
-
// into parseActionRef-based ops. Scene IDs remain stable throughout.
|
|
157
|
-
export function expandSelectorToActionRefs(script, selector) {
|
|
158
|
-
const refs = [];
|
|
159
|
-
for (const ep of asList(script["episodes"])) {
|
|
160
|
-
const epId = strOf(ep["episode_id"]);
|
|
161
|
-
for (const scene of asList(ep["scenes"])) {
|
|
162
|
-
const sceneId = strOf(scene["scene_id"]);
|
|
163
|
-
if (!selector.matchesScene(epId, sceneId))
|
|
164
|
-
continue;
|
|
165
|
-
const actions = asList(scene["actions"]);
|
|
166
|
-
for (let i = 0; i < actions.length; i++) {
|
|
167
|
-
if (!selector.matchesAction(epId, sceneId, i))
|
|
168
|
-
continue;
|
|
169
|
-
refs.push(`${epId}/${sceneId}#${i}`);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return refs;
|
|
174
|
-
}
|
|
175
|
-
// Reverse lookup for asset / speaker references. Parallel to collectStateRefs
|
|
176
|
-
// but tracks where an actor/location/prop/speaker is mentioned rather than
|
|
177
|
-
// where a specific state is mentioned. Returns one `{target, location, role}`
|
|
178
|
-
// entry per reference site. Walks the same edges the validator does
|
|
179
|
-
// (script-core.ts validateScript) so coverage is complete:
|
|
180
|
-
// - scene.context.{actors|locations|props}[]
|
|
181
|
-
// - action.actor_id (actor only)
|
|
182
|
-
// - action.speaker_id + action.speakers[] + action.lines[].speaker_id (speaker only)
|
|
183
|
-
// - action.state_changes[].target_{kind,id}
|
|
184
|
-
// - action.transition_prompt.target_{kind,id}
|
|
1
|
+
export * from "./v3/selector.js";
|
|
185
2
|
//# sourceMappingURL=selector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selector.js","sourceRoot":"","sources":["../../../src/domain/script/selector.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"selector.js","sourceRoot":"","sources":["../../../src/domain/script/selector.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex.js","sourceRoot":"","sources":["../../../../src/domain/script/shared/regex.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAExC,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,IAAI,OAAO,CAAC,MAAM,GAAG,oBAAoB;QAAE,OAAO,IAAI,CAAC;IACvD,OAAO,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
2
|
+
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
3
|
+
[key: string]: JsonValue;
|
|
4
|
+
};
|
|
5
|
+
export type ExtensionMap = Record<string, JsonValue>;
|
|
6
|
+
export declare const ACTION_TYPES: readonly ["action", "dialogue", "inner_thought", "transition"];
|
|
7
|
+
export type ActionType = (typeof ACTION_TYPES)[number];
|
|
8
|
+
export declare const ACTION_TYPE_SET: ReadonlySet<string>;
|
|
9
|
+
export declare const NON_ACTOR_SPEAKER_KINDS: readonly ["system", "broadcast", "offscreen", "group"];
|
|
10
|
+
export type NonActorSpeakerKind = (typeof NON_ACTOR_SPEAKER_KINDS)[number];
|
|
11
|
+
export declare const NON_ACTOR_SPEAKER_KIND_SET: ReadonlySet<string>;
|
|
12
|
+
export declare const IMPORTANCE_TIERS: readonly ["featured", "background"];
|
|
13
|
+
export type Importance = (typeof IMPORTANCE_TIERS)[number];
|
|
14
|
+
export declare const IMPORTANCE_TIER_SET: ReadonlySet<string>;
|
|
15
|
+
export declare const ROLE_TYPES: readonly ["主角", "配角"];
|
|
16
|
+
export type RoleType = (typeof ROLE_TYPES)[number];
|
|
17
|
+
export declare const ROLE_TYPE_SET: ReadonlySet<string>;
|
|
18
|
+
export type AssetKind = "actor" | "location" | "prop";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const ACTION_TYPES = ["action", "dialogue", "inner_thought", "transition"];
|
|
2
|
+
export const ACTION_TYPE_SET = new Set(ACTION_TYPES);
|
|
3
|
+
export const NON_ACTOR_SPEAKER_KINDS = ["system", "broadcast", "offscreen", "group"];
|
|
4
|
+
export const NON_ACTOR_SPEAKER_KIND_SET = new Set(NON_ACTOR_SPEAKER_KINDS);
|
|
5
|
+
export const IMPORTANCE_TIERS = ["featured", "background"];
|
|
6
|
+
export const IMPORTANCE_TIER_SET = new Set(IMPORTANCE_TIERS);
|
|
7
|
+
export const ROLE_TYPES = ["主角", "配角"];
|
|
8
|
+
export const ROLE_TYPE_SET = new Set(ROLE_TYPES);
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/domain/script/shared/types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,CAAU,CAAC;AAE3F,MAAM,CAAC,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC;AAE1E,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,CAAU,CAAC;AAE9F,MAAM,CAAC,MAAM,0BAA0B,GAAwB,IAAI,GAAG,CAAC,uBAAuB,CAAC,CAAC;AAEhG,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,YAAY,CAAU,CAAC;AAEpE,MAAM,CAAC,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAElF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,IAAI,CAAU,CAAC;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../src/domain/script/shared/validation.ts"],"names":[],"mappings":""}
|
|
@@ -1,123 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
3
|
-
[key: string]: JsonValue;
|
|
4
|
-
};
|
|
5
|
-
export type ExtensionMap = Record<string, JsonValue>;
|
|
6
|
-
export declare const ACTION_TYPES: readonly ["action", "dialogue", "inner_thought", "transition"];
|
|
7
|
-
export type ActionType = (typeof ACTION_TYPES)[number];
|
|
8
|
-
export declare const ACTION_TYPE_SET: ReadonlySet<string>;
|
|
9
|
-
export declare const NON_ACTOR_SPEAKER_KINDS: readonly ["system", "broadcast", "offscreen", "group"];
|
|
10
|
-
export type NonActorSpeakerKind = (typeof NON_ACTOR_SPEAKER_KINDS)[number];
|
|
11
|
-
export declare const NON_ACTOR_SPEAKER_KIND_SET: ReadonlySet<string>;
|
|
12
|
-
export declare const IMPORTANCE_TIERS: readonly ["featured", "background"];
|
|
13
|
-
export type Importance = (typeof IMPORTANCE_TIERS)[number];
|
|
14
|
-
export declare const IMPORTANCE_TIER_SET: ReadonlySet<string>;
|
|
15
|
-
export declare const ROLE_TYPES: readonly ["主角", "配角"];
|
|
16
|
-
export type RoleType = (typeof ROLE_TYPES)[number];
|
|
17
|
-
export declare const ROLE_TYPE_SET: ReadonlySet<string>;
|
|
18
|
-
export interface ActorSpeakerV3 {
|
|
19
|
-
actor_id: string;
|
|
20
|
-
state_id?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface NonActorSpeakerV3 {
|
|
23
|
-
kind: NonActorSpeakerKind;
|
|
24
|
-
label?: string;
|
|
25
|
-
}
|
|
26
|
-
export type SpeakerV3 = ActorSpeakerV3 | NonActorSpeakerV3;
|
|
27
|
-
export interface TransitionPromptV3 {
|
|
28
|
-
target: string;
|
|
29
|
-
process: string;
|
|
30
|
-
contrast: string;
|
|
31
|
-
}
|
|
32
|
-
export interface ActionV3 {
|
|
33
|
-
type: ActionType;
|
|
34
|
-
content: string;
|
|
35
|
-
speaker?: SpeakerV3;
|
|
36
|
-
emotion?: string;
|
|
37
|
-
transition_prompt?: TransitionPromptV3;
|
|
38
|
-
extend?: ExtensionMap;
|
|
39
|
-
}
|
|
40
|
-
export interface EnvironmentV3 {
|
|
41
|
-
space?: string;
|
|
42
|
-
time?: string;
|
|
43
|
-
}
|
|
44
|
-
export interface ActorRefV3 {
|
|
45
|
-
actor_id: string;
|
|
46
|
-
state_id?: string;
|
|
47
|
-
}
|
|
48
|
-
export interface LocationRefV3 {
|
|
49
|
-
location_id: string;
|
|
50
|
-
state_id?: string;
|
|
51
|
-
}
|
|
52
|
-
export interface PropRefV3 {
|
|
53
|
-
prop_id: string;
|
|
54
|
-
state_id?: string;
|
|
55
|
-
}
|
|
56
|
-
export interface SceneV3 {
|
|
57
|
-
scene_id: string;
|
|
58
|
-
environment?: EnvironmentV3;
|
|
59
|
-
location: LocationRefV3 | null;
|
|
60
|
-
actors: ActorRefV3[];
|
|
61
|
-
props: PropRefV3[];
|
|
62
|
-
actions: ActionV3[];
|
|
63
|
-
extend?: ExtensionMap;
|
|
64
|
-
}
|
|
65
|
-
export interface EpisodeV3 {
|
|
66
|
-
episode_id: string;
|
|
67
|
-
title?: string;
|
|
68
|
-
synopsis?: string;
|
|
69
|
-
scenes: SceneV3[];
|
|
70
|
-
extend?: ExtensionMap;
|
|
71
|
-
}
|
|
72
|
-
export interface StateV3 {
|
|
73
|
-
state_id: string;
|
|
74
|
-
state_name: string;
|
|
75
|
-
description: string;
|
|
76
|
-
extend?: ExtensionMap;
|
|
77
|
-
}
|
|
78
|
-
interface AssetV3 {
|
|
79
|
-
importance: Importance;
|
|
80
|
-
aliases?: string[];
|
|
81
|
-
description: string;
|
|
82
|
-
states: StateV3[];
|
|
83
|
-
extend?: ExtensionMap;
|
|
84
|
-
}
|
|
85
|
-
export interface ActorV3 extends AssetV3 {
|
|
86
|
-
actor_id: string;
|
|
87
|
-
actor_name: string;
|
|
88
|
-
role_type?: RoleType;
|
|
89
|
-
}
|
|
90
|
-
export interface LocationV3 extends AssetV3 {
|
|
91
|
-
location_id: string;
|
|
92
|
-
location_name: string;
|
|
93
|
-
}
|
|
94
|
-
export interface PropV3 extends AssetV3 {
|
|
95
|
-
prop_id: string;
|
|
96
|
-
prop_name: string;
|
|
97
|
-
}
|
|
98
|
-
export interface ScriptV3 {
|
|
99
|
-
version: 3;
|
|
100
|
-
title: string;
|
|
101
|
-
worldview: string;
|
|
102
|
-
worldview_raw?: string;
|
|
103
|
-
style: string;
|
|
104
|
-
synopsis?: string;
|
|
105
|
-
logline?: string;
|
|
106
|
-
theme?: string;
|
|
107
|
-
main_characters?: Array<{
|
|
108
|
-
name: string;
|
|
109
|
-
role: string;
|
|
110
|
-
}>;
|
|
111
|
-
actors: ActorV3[];
|
|
112
|
-
locations: LocationV3[];
|
|
113
|
-
props: PropV3[];
|
|
114
|
-
episodes: EpisodeV3[];
|
|
115
|
-
extend?: ExtensionMap;
|
|
116
|
-
}
|
|
117
|
-
export type AssetKind = "actor" | "location" | "prop";
|
|
118
|
-
export type AssetV3ByKind = {
|
|
119
|
-
actor: ActorV3;
|
|
120
|
-
location: LocationV3;
|
|
121
|
-
prop: PropV3;
|
|
122
|
-
};
|
|
123
|
-
export {};
|
|
1
|
+
export * from "./v3/types.js";
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export const ACTION_TYPE_SET = new Set(ACTION_TYPES);
|
|
3
|
-
export const NON_ACTOR_SPEAKER_KINDS = ["system", "broadcast", "offscreen", "group"];
|
|
4
|
-
export const NON_ACTOR_SPEAKER_KIND_SET = new Set(NON_ACTOR_SPEAKER_KINDS);
|
|
5
|
-
export const IMPORTANCE_TIERS = ["featured", "background"];
|
|
6
|
-
export const IMPORTANCE_TIER_SET = new Set(IMPORTANCE_TIERS);
|
|
7
|
-
export const ROLE_TYPES = ["主角", "配角"];
|
|
8
|
-
export const ROLE_TYPE_SET = new Set(ROLE_TYPES);
|
|
1
|
+
export * from "./v3/types.js";
|
|
9
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/domain/script/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/domain/script/types.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare function parseAssetTarget(raw: unknown): [string, string];
|
|
2
|
+
export declare function parseStateTarget(raw: unknown): [string, string, string];
|
|
3
|
+
export declare function parseSceneRef(raw: unknown): [string, string];
|
|
4
|
+
export declare function parseActionRef(raw: unknown): [string, string, number];
|
|
5
|
+
export type AnyAddress = {
|
|
6
|
+
kind: "action";
|
|
7
|
+
episodeId: string;
|
|
8
|
+
sceneId: string;
|
|
9
|
+
actionIndex: number;
|
|
10
|
+
} | {
|
|
11
|
+
kind: "scene";
|
|
12
|
+
episodeId: string;
|
|
13
|
+
sceneId: string;
|
|
14
|
+
} | {
|
|
15
|
+
kind: "asset";
|
|
16
|
+
assetKind: string;
|
|
17
|
+
assetId: string;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "state";
|
|
20
|
+
assetKind: string;
|
|
21
|
+
assetId: string;
|
|
22
|
+
stateId: string;
|
|
23
|
+
} | {
|
|
24
|
+
kind: "episode";
|
|
25
|
+
episodeId: string;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "speaker";
|
|
28
|
+
speakerId: string;
|
|
29
|
+
} | {
|
|
30
|
+
kind: "global";
|
|
31
|
+
};
|
|
32
|
+
export declare function parseAnyAddress(raw: unknown): AnyAddress;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { CliError, EXIT_USAGE, SCRIPT_TARGET_KINDS, } from "../../../common.js";
|
|
2
|
+
import { strOf } from "../shared.js";
|
|
3
|
+
export function parseAssetTarget(raw) {
|
|
4
|
+
const value = strOf(raw).trim();
|
|
5
|
+
if (!value.includes(":")) {
|
|
6
|
+
throw new CliError("SCRIPT OP BLOCKED: Target invalid", "Target invalid.", {
|
|
7
|
+
exitCode: EXIT_USAGE,
|
|
8
|
+
required: ["target: actor:<id>, location:<id>, or prop:<id>"],
|
|
9
|
+
received: [value || "<empty>"],
|
|
10
|
+
nextSteps: ["Use a concrete asset target."],
|
|
11
|
+
errorCode: "TARGET_INVALID",
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
const idx = value.indexOf(":");
|
|
15
|
+
const kind = value.slice(0, idx).trim();
|
|
16
|
+
const targetId = value.slice(idx + 1).trim();
|
|
17
|
+
if (!SCRIPT_TARGET_KINDS.has(kind) || !targetId) {
|
|
18
|
+
throw new CliError("SCRIPT OP BLOCKED: Target invalid", "Target invalid.", {
|
|
19
|
+
exitCode: EXIT_USAGE,
|
|
20
|
+
required: ["target: actor:<id>, location:<id>, or prop:<id>"],
|
|
21
|
+
received: [value],
|
|
22
|
+
nextSteps: ["Use actor, location, or prop with a non-empty id."],
|
|
23
|
+
errorCode: "TARGET_INVALID",
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return [kind, targetId];
|
|
27
|
+
}
|
|
28
|
+
export function parseStateTarget(raw) {
|
|
29
|
+
const value = strOf(raw).trim();
|
|
30
|
+
if (!value.includes("/")) {
|
|
31
|
+
throw new CliError("SCRIPT OP BLOCKED: State target invalid", "State target invalid.", {
|
|
32
|
+
exitCode: EXIT_USAGE,
|
|
33
|
+
required: ["state target: actor:<id>/<state_id>"],
|
|
34
|
+
received: [value || "<empty>"],
|
|
35
|
+
nextSteps: ["Use a concrete state target."],
|
|
36
|
+
errorCode: "STATE_TARGET_INVALID",
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
const lastSlash = value.lastIndexOf("/");
|
|
40
|
+
const assetRaw = value.slice(0, lastSlash);
|
|
41
|
+
const stateId = value.slice(lastSlash + 1).trim();
|
|
42
|
+
const [kind, targetId] = parseAssetTarget(assetRaw);
|
|
43
|
+
if (!stateId) {
|
|
44
|
+
throw new CliError("SCRIPT OP BLOCKED: State target invalid", "State target invalid.", {
|
|
45
|
+
exitCode: EXIT_USAGE,
|
|
46
|
+
required: ["state_id after '/'"],
|
|
47
|
+
received: [value],
|
|
48
|
+
nextSteps: ["Use a non-empty state_id."],
|
|
49
|
+
errorCode: "STATE_TARGET_INVALID",
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return [kind, targetId, stateId];
|
|
53
|
+
}
|
|
54
|
+
export function parseSceneRef(raw) {
|
|
55
|
+
const value = strOf(raw).trim();
|
|
56
|
+
if (!value.includes("/")) {
|
|
57
|
+
throw new CliError("SCRIPT OP BLOCKED: Scene ref invalid", "Scene ref invalid.", {
|
|
58
|
+
exitCode: EXIT_USAGE,
|
|
59
|
+
required: ["scene ref: ep_001/scn_001"],
|
|
60
|
+
received: [value || "<empty>"],
|
|
61
|
+
nextSteps: ["Use ep_id/scn_id."],
|
|
62
|
+
errorCode: "SCENE_REF_INVALID",
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
const idx = value.indexOf("/");
|
|
66
|
+
return [value.slice(0, idx).trim(), value.slice(idx + 1).trim()];
|
|
67
|
+
}
|
|
68
|
+
export function parseActionRef(raw) {
|
|
69
|
+
const value = strOf(raw).trim();
|
|
70
|
+
if (!value.includes("#")) {
|
|
71
|
+
throw new CliError("SCRIPT OP BLOCKED: Action ref invalid", "Action ref invalid.", {
|
|
72
|
+
exitCode: EXIT_USAGE,
|
|
73
|
+
required: ["action ref: ep_001/scn_001#4"],
|
|
74
|
+
received: [value || "<empty>"],
|
|
75
|
+
nextSteps: ["Use ep_id/scn_id#action_index."],
|
|
76
|
+
errorCode: "ACTION_REF_INVALID",
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const lastHash = value.lastIndexOf("#");
|
|
80
|
+
const sceneRaw = value.slice(0, lastHash);
|
|
81
|
+
const indexRaw = value.slice(lastHash + 1);
|
|
82
|
+
const [epId, sceneId] = parseSceneRef(sceneRaw);
|
|
83
|
+
const actionIndex = parseInt(indexRaw, 10);
|
|
84
|
+
if (Number.isNaN(actionIndex)) {
|
|
85
|
+
throw new CliError("SCRIPT OP BLOCKED: Action index invalid", "Action index invalid.", {
|
|
86
|
+
exitCode: EXIT_USAGE,
|
|
87
|
+
required: ["integer action index after '#'"],
|
|
88
|
+
received: [value],
|
|
89
|
+
nextSteps: ["Use a zero-based action index."],
|
|
90
|
+
errorCode: "ACTION_INDEX_INVALID",
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return [epId, sceneId, actionIndex];
|
|
94
|
+
}
|
|
95
|
+
// Try each format in order. The order matters: action (has `#`) is checked
|
|
96
|
+
// before scene (just `/`), and asset+state (has `:`) is checked before scene.
|
|
97
|
+
// Episode and speaker are bare ids (no separators) distinguished by prefix;
|
|
98
|
+
// `global` is the literal script-level sentinel.
|
|
99
|
+
export function parseAnyAddress(raw) {
|
|
100
|
+
const value = strOf(raw).trim();
|
|
101
|
+
if (!value) {
|
|
102
|
+
throw new CliError("ADDRESS BLOCKED: Address empty", "Address empty.", {
|
|
103
|
+
exitCode: EXIT_USAGE,
|
|
104
|
+
required: ["one of the supported address formats"],
|
|
105
|
+
received: ["<empty>"],
|
|
106
|
+
nextSteps: ["Pass an address like ep_001/scn_001#3, ep_001/scn_001, actor:act_001, actor:act_001/st_001, ep_001, spk_001, or global."],
|
|
107
|
+
errorCode: "ADDRESS_EMPTY",
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
if (value.includes("#")) {
|
|
111
|
+
const [episodeId, sceneId, actionIndex] = parseActionRef(value);
|
|
112
|
+
return { kind: "action", episodeId, sceneId, actionIndex };
|
|
113
|
+
}
|
|
114
|
+
if (value.includes(":")) {
|
|
115
|
+
if (value.slice(value.indexOf(":") + 1).includes("/")) {
|
|
116
|
+
const [assetKind, assetId, stateId] = parseStateTarget(value);
|
|
117
|
+
return { kind: "state", assetKind, assetId, stateId };
|
|
118
|
+
}
|
|
119
|
+
const [assetKind, assetId] = parseAssetTarget(value);
|
|
120
|
+
return { kind: "asset", assetKind, assetId };
|
|
121
|
+
}
|
|
122
|
+
if (value.includes("/")) {
|
|
123
|
+
const [episodeId, sceneId] = parseSceneRef(value);
|
|
124
|
+
return { kind: "scene", episodeId, sceneId };
|
|
125
|
+
}
|
|
126
|
+
if (value === "global") {
|
|
127
|
+
return { kind: "global" };
|
|
128
|
+
}
|
|
129
|
+
if (/^ep_/.test(value)) {
|
|
130
|
+
return { kind: "episode", episodeId: value };
|
|
131
|
+
}
|
|
132
|
+
if (/^spk_/.test(value)) {
|
|
133
|
+
return { kind: "speaker", speakerId: value };
|
|
134
|
+
}
|
|
135
|
+
throw new CliError("ADDRESS BLOCKED: Address invalid", "Address invalid.", {
|
|
136
|
+
exitCode: EXIT_USAGE,
|
|
137
|
+
required: [
|
|
138
|
+
"address: ep_NNN/scn_NNN#idx (action) | ep_NNN/scn_NNN (scene) | actor|location|prop:id (asset) | actor|location|prop:id/state_id (state) | ep_NNN (episode) | spk_XXX (speaker) | global (script-level)",
|
|
139
|
+
],
|
|
140
|
+
received: [value],
|
|
141
|
+
nextSteps: ["Use a recognized address format."],
|
|
142
|
+
errorCode: "ADDRESS_INVALID",
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.js","source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EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAC/C,CAAC;IACD,MAAM,IAAI,QAAQ,CAAC,kCAAkC,EAAE,kBAAkB,EAAE;QACzE,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE;YACR,yMAAyM;SAC1M;QACD,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,SAAS,EAAE,CAAC,kCAAkC,CAAC;QAC/C,SAAS,EAAE,iBAAiB;KAC7B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Dict } from "../shared.js";
|
|
2
|
+
export declare function findAction(script: Dict, epId: string, sceneId: string, actionIndex: number): Dict;
|
|
3
|
+
export declare function findEpisode(script: Dict, epId: string): Dict;
|
|
4
|
+
export declare function findScene(script: Dict, epId: string, sceneId: string): Dict;
|
|
5
|
+
/**
|
|
6
|
+
* Minimal schema-v3 script skeleton: every required top-level field present,
|
|
7
|
+
* all collections empty. It is the starting point for building a script
|
|
8
|
+
* bottom-up with the atomic add/insert verbs instead of assembling it from
|
|
9
|
+
* source material (direct) or md (parse). `worldview`/`style`/`title` are
|
|
10
|
+
* present-but-empty so the field-presence checks pass; they get filled in
|
|
11
|
+
* later via `worldview` / `patch`. A blank script validates clean: NO_EPISODES
|
|
12
|
+
* is a completeness warning (`incomplete_ok`), not a blocker. v3 has no speaker
|
|
13
|
+
* roster (dialogue speakers are inline on each action).
|
|
14
|
+
*/
|
|
15
|
+
export declare function blankScript(title?: string): Dict;
|
|
16
|
+
export declare function resolveAsset(items: Dict[], idKey: string, nameKey: string, raw: string): Dict | null;
|
|
17
|
+
export declare const ASSET_KEY_MAP: Record<string, [string, string, string]>;
|
|
18
|
+
export declare function assetKeys(assetType: string): [string, string, string];
|
|
19
|
+
export declare function resolvePatchAsset(script: Dict, op: Dict, assetType?: string | null): [Dict, string, string];
|
|
20
|
+
export declare function nextStateId(script: Dict): string;
|
|
21
|
+
export declare function normalizeStates(script: Dict, rawStates: unknown, assetKind?: string): Dict[];
|
|
22
|
+
export declare function ensureRefId(script: Dict, assetType: string, rawId: unknown, opts?: {
|
|
23
|
+
allowNone?: boolean;
|
|
24
|
+
}): string | null;
|
|
25
|
+
export declare function idKeyForKind(kind: string): string;
|
|
26
|
+
export declare function pluralForKind(kind: string): string;
|
|
27
|
+
export declare const ASSET_ID_PREFIX: Record<string, string>;
|
|
28
|
+
export declare function nextSeqId(existingIds: Iterable<unknown>, prefix: string): string;
|
|
29
|
+
export declare function nextSceneId(script: Dict): string;
|
|
30
|
+
export declare function nextAssetId(script: Dict, kind: string): string;
|
|
31
|
+
export declare function nextEpisodeId(script: Dict): string;
|
|
32
|
+
export declare function sceneIdExists(script: Dict, sceneId: string): boolean;
|
|
33
|
+
export declare function pushAsset(script: Dict, kind: string, op: Dict): Dict;
|