@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,200 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
// Enforces v3 invariants: plain-text content, single scene-level location,
|
|
3
|
-
// scene-level actors/props with materialized state, no legacy v2 fields
|
|
4
|
-
// (state_changes / action.actor_id / scene.context / speakers[] / content spans).
|
|
5
|
-
import { ACTION_TYPES, IMPORTANCE_TIERS, NON_ACTOR_SPEAKER_KINDS } from "../script/types.js";
|
|
6
|
-
import { canonicalNameKey } from "../script/names.js";
|
|
7
|
-
const isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
8
|
-
const isArr = (v) => Array.isArray(v);
|
|
9
|
-
const isStr = (v) => typeof v === "string";
|
|
10
|
-
const ACTION_LEGACY = ["state_changes", "actor_id", "speakers", "lines"];
|
|
11
|
-
export function validateScriptV3(doc) {
|
|
12
|
-
const errors = [];
|
|
13
|
-
const warnings = [];
|
|
14
|
-
const err = (code, path, message) => errors.push({ code, path, message });
|
|
15
|
-
if (!isObj(doc))
|
|
16
|
-
return { ok: false, errors: [{ code: "not_object", path: "$", message: "script must be an object" }], warnings };
|
|
17
|
-
if (doc.version !== 3)
|
|
18
|
-
err("version", "$.version", "version must be 3");
|
|
19
|
-
for (const key of ["title", "worldview", "style"])
|
|
20
|
-
if (!isStr(doc[key]))
|
|
21
|
-
err("field", `$.${key}`, `${key} must be a string`);
|
|
22
|
-
const stateIds = new Map();
|
|
23
|
-
const idKind = new Map();
|
|
24
|
-
const actorNames = new Map();
|
|
25
|
-
const collect = (list, kind, idField, nameField, path) => {
|
|
26
|
-
if (!isArr(list)) {
|
|
27
|
-
err("field", path, `${path} must be an array`);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
list.forEach((raw, i) => {
|
|
31
|
-
const p = `${path}[${i}]`;
|
|
32
|
-
if (!isObj(raw)) {
|
|
33
|
-
err("asset", p, "asset must be an object");
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const id = raw[idField];
|
|
37
|
-
if (!isStr(id)) {
|
|
38
|
-
err("asset_id", `${p}.${idField}`, `${idField} required`);
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
if (idKind.has(id))
|
|
42
|
-
err("dup_id", `${p}.${idField}`, `duplicate id ${id}`);
|
|
43
|
-
idKind.set(id, kind);
|
|
44
|
-
if (!isStr(raw[nameField]))
|
|
45
|
-
err("asset_name", `${p}.${nameField}`, `${nameField} required`);
|
|
46
|
-
else if (kind === "actor") {
|
|
47
|
-
const nameKey = canonicalNameKey(raw[nameField]);
|
|
48
|
-
const existingId = actorNames.get(nameKey);
|
|
49
|
-
if (existingId !== undefined) {
|
|
50
|
-
err("dup_actor_name", `${p}.${nameField}`, `actor name ${raw[nameField]} already belongs to ${existingId}`);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
actorNames.set(nameKey, id);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
if (!isStr(raw.importance) || !IMPORTANCE_TIERS.includes(raw.importance))
|
|
57
|
-
err("importance", `${p}.importance`, `importance must be one of ${IMPORTANCE_TIERS.join("|")}`);
|
|
58
|
-
if (!isStr(raw.description))
|
|
59
|
-
err("asset_desc", `${p}.description`, "description must be a string");
|
|
60
|
-
const ids = new Set();
|
|
61
|
-
let defaults = 0;
|
|
62
|
-
if (!isArr(raw.states) || raw.states.length === 0)
|
|
63
|
-
err("states", `${p}.states`, "states must be a non-empty array");
|
|
64
|
-
else
|
|
65
|
-
raw.states.forEach((st, j) => {
|
|
66
|
-
const sp = `${p}.states[${j}]`;
|
|
67
|
-
if (!isObj(st) || !isStr(st.state_id)) {
|
|
68
|
-
err("state_id", sp, "state_id required");
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (ids.has(st.state_id))
|
|
72
|
-
err("dup_state", sp, `duplicate state_id ${st.state_id}`);
|
|
73
|
-
ids.add(st.state_id);
|
|
74
|
-
if (st.state_id === "default")
|
|
75
|
-
defaults++;
|
|
76
|
-
if (!isStr(st.state_name))
|
|
77
|
-
err("state_name", `${sp}.state_name`, "state_name required");
|
|
78
|
-
});
|
|
79
|
-
if (isArr(raw.states) && defaults !== 1)
|
|
80
|
-
err("default_state", `${p}.states`, `exactly one 'default' state required, found ${defaults}`);
|
|
81
|
-
stateIds.set(id, ids);
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
collect(doc.actors, "actor", "actor_id", "actor_name", "$.actors");
|
|
85
|
-
collect(doc.locations, "location", "location_id", "location_name", "$.locations");
|
|
86
|
-
collect(doc.props, "prop", "prop_id", "prop_name", "$.props");
|
|
87
|
-
const refState = (assetId, stateId, kind, path) => {
|
|
88
|
-
if (idKind.get(assetId) !== kind) {
|
|
89
|
-
err("ref", path, `${kind} ${assetId} not found`);
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
if (stateId !== undefined && (!isStr(stateId) || !stateIds.get(assetId)?.has(stateId)))
|
|
93
|
-
err("state_ref", path, `state ${String(stateId)} not materialized on ${assetId}`);
|
|
94
|
-
};
|
|
95
|
-
const checkEntityList = (list, kind, idField, path) => {
|
|
96
|
-
if (list === undefined) {
|
|
97
|
-
err("field", path, `${path} required (may be empty array)`);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
if (!isArr(list)) {
|
|
101
|
-
err("field", path, `${path} must be an array`);
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
list.forEach((ref, i) => {
|
|
105
|
-
if (!isObj(ref) || !isStr(ref[idField])) {
|
|
106
|
-
err("ref", `${path}[${i}]`, `${idField} required`);
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
refState(ref[idField], ref.state_id, kind, `${path}[${i}]`);
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
const checkAction = (action, path, sceneActorIds) => {
|
|
113
|
-
if (!isObj(action)) {
|
|
114
|
-
err("action", path, "action must be an object");
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
for (const bad of ACTION_LEGACY)
|
|
118
|
-
if (bad in action)
|
|
119
|
-
err("legacy_field", `${path}.${bad}`, `v3 forbids action.${bad}`);
|
|
120
|
-
const type = action.type;
|
|
121
|
-
if (!isStr(type) || !ACTION_TYPES.includes(type))
|
|
122
|
-
err("action_type", `${path}.type`, `invalid action type ${String(type)}`);
|
|
123
|
-
if (!isStr(action.content))
|
|
124
|
-
err("content", `${path}.content`, "content must be a plain-text string");
|
|
125
|
-
if (type === "dialogue" || type === "inner_thought") {
|
|
126
|
-
const sp = action.speaker;
|
|
127
|
-
if (!isObj(sp))
|
|
128
|
-
err("speaker", `${path}.speaker`, "dialogue/inner_thought needs a speaker");
|
|
129
|
-
else if ("kind" in sp) {
|
|
130
|
-
if (!isStr(sp.kind) || !NON_ACTOR_SPEAKER_KINDS.includes(sp.kind))
|
|
131
|
-
err("speaker_kind", `${path}.speaker.kind`, "invalid non-actor speaker kind");
|
|
132
|
-
}
|
|
133
|
-
else if (isStr(sp.actor_id)) {
|
|
134
|
-
refState(sp.actor_id, sp.state_id, "actor", `${path}.speaker`);
|
|
135
|
-
if (!sceneActorIds.has(sp.actor_id)) {
|
|
136
|
-
err("actor_not_in_scene", `${path}.speaker.actor_id`, `actor ${sp.actor_id} is not referenced by this scene`);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
else
|
|
140
|
-
err("speaker", `${path}.speaker`, "speaker needs actor_id or kind");
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
const episodes = doc.episodes;
|
|
144
|
-
if (!isArr(episodes))
|
|
145
|
-
err("episodes", "$.episodes", "episodes must be an array");
|
|
146
|
-
else
|
|
147
|
-
episodes.forEach((ep, ei) => {
|
|
148
|
-
const ep_p = `$.episodes[${ei}]`;
|
|
149
|
-
if (!isObj(ep) || !isStr(ep.episode_id)) {
|
|
150
|
-
err("episode_id", ep_p, "episode_id required");
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
if (!isArr(ep.scenes)) {
|
|
154
|
-
err("scenes", `${ep_p}.scenes`, "scenes must be an array");
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
ep.scenes.forEach((sc, si) => {
|
|
158
|
-
const sc_p = `${ep_p}.scenes[${si}]`;
|
|
159
|
-
if (!isObj(sc)) {
|
|
160
|
-
err("scene", sc_p, "scene must be an object");
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
if ("context" in sc)
|
|
164
|
-
err("legacy_field", `${sc_p}.context`, "v3 forbids scene.context");
|
|
165
|
-
if (!isStr(sc.scene_id))
|
|
166
|
-
err("scene_id", sc_p, "scene_id required");
|
|
167
|
-
const loc = sc.location;
|
|
168
|
-
if (loc !== null) {
|
|
169
|
-
if (!isObj(loc) || !isStr(loc.location_id))
|
|
170
|
-
err("location", `${sc_p}.location`, "location must be null or {location_id}");
|
|
171
|
-
else
|
|
172
|
-
refState(loc.location_id, loc.state_id, "location", `${sc_p}.location`);
|
|
173
|
-
}
|
|
174
|
-
checkEntityList(sc.actors, "actor", "actor_id", `${sc_p}.actors`);
|
|
175
|
-
checkEntityList(sc.props, "prop", "prop_id", `${sc_p}.props`);
|
|
176
|
-
if (isArr(sc.props)) {
|
|
177
|
-
const propIds = new Set();
|
|
178
|
-
sc.props.forEach((ref, i) => {
|
|
179
|
-
if (!isObj(ref) || !isStr(ref.prop_id))
|
|
180
|
-
return;
|
|
181
|
-
if (propIds.has(ref.prop_id))
|
|
182
|
-
err("dup_prop_ref", `${sc_p}.props[${i}]`, `duplicate prop ref ${ref.prop_id}`);
|
|
183
|
-
propIds.add(ref.prop_id);
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
const sceneActorIds = new Set(isArr(sc.actors)
|
|
187
|
-
? sc.actors
|
|
188
|
-
.filter((ref) => isObj(ref))
|
|
189
|
-
.map((ref) => ref.actor_id)
|
|
190
|
-
.filter((id) => isStr(id))
|
|
191
|
-
: []);
|
|
192
|
-
if (!isArr(sc.actions))
|
|
193
|
-
err("actions", `${sc_p}.actions`, "actions must be an array");
|
|
194
|
-
else
|
|
195
|
-
sc.actions.forEach((a, ai) => checkAction(a, `${sc_p}.actions[${ai}]`, sceneActorIds));
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
return { ok: errors.length === 0, errors, warnings };
|
|
199
|
-
}
|
|
1
|
+
export * from "../script/v3/validation.js";
|
|
200
2
|
//# sourceMappingURL=validation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/domain/ingest/validation.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/domain/ingest/validation.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}
|
|
@@ -36,52 +36,75 @@ function toSpeaker(raw) {
|
|
|
36
36
|
// v3. Actor speakers are added to the scene cast (mirrors assemble()).
|
|
37
37
|
export function docsToNameScript(docs, title) {
|
|
38
38
|
let scn = 0;
|
|
39
|
-
const episodes = docs.map((d, ei) =>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (
|
|
56
|
-
|
|
39
|
+
const episodes = docs.map((d, ei) => {
|
|
40
|
+
const episodeIdentityKey = `video:episode:${d.episode}`;
|
|
41
|
+
const sceneIdentityOccurrences = new Map();
|
|
42
|
+
return {
|
|
43
|
+
identity_key: episodeIdentityKey,
|
|
44
|
+
episode_id: `ep_${pad(ei + 1)}`,
|
|
45
|
+
scenes: d.scenes.map((s) => {
|
|
46
|
+
const sceneAnchor = s.timeRange?.trim()
|
|
47
|
+
? `time:${s.timeRange.trim()}`
|
|
48
|
+
: `index:${s.index}`;
|
|
49
|
+
const sceneOccurrence = (sceneIdentityOccurrences.get(sceneAnchor) ?? 0) + 1;
|
|
50
|
+
sceneIdentityOccurrences.set(sceneAnchor, sceneOccurrence);
|
|
51
|
+
const sceneIdentityKey = `${episodeIdentityKey}:scene:${sceneAnchor}:${sceneOccurrence}`;
|
|
52
|
+
const env = {};
|
|
53
|
+
const sp = SPACE_ZH_TO_EN[(s.environment.space ?? "").trim()];
|
|
54
|
+
const tm = TIME_ZH_TO_EN[(s.environment.time ?? "").trim()];
|
|
55
|
+
if (sp)
|
|
56
|
+
env.space = sp;
|
|
57
|
+
if (tm)
|
|
58
|
+
env.time = tm;
|
|
59
|
+
const actors = [];
|
|
60
|
+
const ensureSpeakerActor = (name) => {
|
|
61
|
+
if (!actors.some((actor) => actor.name === name))
|
|
62
|
+
actors.push({ name });
|
|
63
|
+
};
|
|
64
|
+
for (const ch of s.characters) {
|
|
65
|
+
if (ch.name && !isCrowdName(ch.name)) {
|
|
66
|
+
actors.push(ch.state ? { name: ch.name, state: ch.state } : { name: ch.name });
|
|
67
|
+
}
|
|
57
68
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
69
|
+
const actionIdentityOccurrences = new Map();
|
|
70
|
+
const actions = s.anchors.map((a) => {
|
|
71
|
+
const timestamp = (a.ts ?? "").trim();
|
|
72
|
+
const actionAnchor = timestamp
|
|
73
|
+
? `time:${timestamp}`
|
|
74
|
+
: `content:${JSON.stringify([a.kind, a.speaker ?? "", a.content])}`;
|
|
75
|
+
const actionOccurrence = (actionIdentityOccurrences.get(actionAnchor) ?? 0) + 1;
|
|
76
|
+
actionIdentityOccurrences.set(actionAnchor, actionOccurrence);
|
|
77
|
+
const out = {
|
|
78
|
+
identity_key: `${sceneIdentityKey}:action:${actionAnchor}:${actionOccurrence}`,
|
|
79
|
+
type: KIND_TO_TYPE[a.kind] ?? "action",
|
|
80
|
+
content: a.content,
|
|
81
|
+
};
|
|
82
|
+
if ((a.kind === "dlg" || a.kind === "think") && a.speaker) {
|
|
83
|
+
const spk = toSpeaker(a.speaker);
|
|
84
|
+
out.speaker = spk;
|
|
85
|
+
if ("name" in spk)
|
|
86
|
+
ensureSpeakerActor(spk.name); // actor speaker is present
|
|
87
|
+
}
|
|
88
|
+
if (a.emotion)
|
|
89
|
+
out.emotion = a.emotion;
|
|
90
|
+
const ts = (a.ts ?? "").trim();
|
|
91
|
+
if (ts)
|
|
92
|
+
out.extend = { timestamp: ts };
|
|
93
|
+
return out;
|
|
94
|
+
});
|
|
95
|
+
const loc = (s.location ?? "").trim();
|
|
96
|
+
return {
|
|
97
|
+
identity_key: sceneIdentityKey,
|
|
98
|
+
scene_id: `scn_${pad(++scn)}`,
|
|
99
|
+
...(env.space || env.time ? { environment: env } : {}),
|
|
100
|
+
location: loc ? { name: loc } : null,
|
|
101
|
+
actors,
|
|
102
|
+
props: (s.props ?? []).filter(Boolean).map((p) => ({ name: p })),
|
|
103
|
+
actions,
|
|
104
|
+
};
|
|
105
|
+
}),
|
|
106
|
+
};
|
|
107
|
+
});
|
|
85
108
|
return { title, episodes };
|
|
86
109
|
}
|
|
87
110
|
//# sourceMappingURL=video-apply.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-apply.js","sourceRoot":"","sources":["../../../src/domain/ingest/video-apply.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,0EAA0E;AAI1E,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAq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AEH,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;gBACtC,OAAO;oBACL,YAAY,EAAE,gBAAgB;oBAC9B,QAAQ,EAAE,OAAO,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE;oBAC7B,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBACtD,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI;oBACpC,MAAM;oBACN,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;oBAChE,OAAO;iBACR,CAAC;YACJ,CAAC,CAAC;SACH,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -1,32 +1 @@
|
|
|
1
|
-
export
|
|
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;
|
|
1
|
+
export * from "./v3/address.js";
|
|
@@ -1,145 +1,2 @@
|
|
|
1
|
-
|
|
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
|
-
}
|
|
1
|
+
export * from "./v3/address.js";
|
|
145
2
|
//# sourceMappingURL=address.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../src/domain/script/address.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../src/domain/script/address.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ScriptV3 } from "./v3/types.js";
|
|
2
|
+
import type { ScriptV4 } from "./v4/types.js";
|
|
3
|
+
import type { ValidationResult } from "./shared/validation.js";
|
|
4
|
+
export type ScriptVersion = 3 | 4;
|
|
5
|
+
export type ScriptDocument = ScriptV3 | ScriptV4;
|
|
6
|
+
export interface ScriptDialect {
|
|
7
|
+
readonly version: ScriptVersion;
|
|
8
|
+
readonly require: (value: unknown) => ScriptDocument;
|
|
9
|
+
readonly validate: (value: unknown) => ValidationResult;
|
|
10
|
+
}
|
|
11
|
+
export declare function scriptVersionOf(value: unknown): ScriptVersion;
|
|
12
|
+
export declare function dialectFor(value: unknown): ScriptDialect;
|
|
13
|
+
export declare function requireScriptDocument(value: unknown): ScriptDocument;
|
|
14
|
+
export declare function validateScriptDocument(value: unknown): ValidationResult;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CliError, EXIT_INPUT } from "../../common.js";
|
|
2
|
+
import { requireScriptV3 } from "./v3/parse.js";
|
|
3
|
+
import { requireScriptV4 } from "./v4/parse.js";
|
|
4
|
+
import { validateScriptV4 } from "./v4/validation.js";
|
|
5
|
+
import { validateScriptV3 } from "./v3/validation.js";
|
|
6
|
+
const DIALECTS = {
|
|
7
|
+
3: {
|
|
8
|
+
version: 3,
|
|
9
|
+
require: requireScriptV3,
|
|
10
|
+
validate: validateScriptV3,
|
|
11
|
+
},
|
|
12
|
+
4: {
|
|
13
|
+
version: 4,
|
|
14
|
+
require: requireScriptV4,
|
|
15
|
+
validate: validateScriptV4,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export function scriptVersionOf(value) {
|
|
19
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
20
|
+
throw new CliError("SCRIPT BLOCKED: invalid document", "script.json must be an object with an explicit version.", {
|
|
21
|
+
exitCode: EXIT_INPUT,
|
|
22
|
+
errorCode: "SCRIPT_VERSION_MISSING",
|
|
23
|
+
required: ["version: 3 or version: 4"],
|
|
24
|
+
received: [Array.isArray(value) ? "array" : typeof value],
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
const version = value.version;
|
|
28
|
+
if (version === 3 || version === 4)
|
|
29
|
+
return version;
|
|
30
|
+
throw new CliError("SCRIPT BLOCKED: unsupported version", "script.json must declare version 3 or version 4.", {
|
|
31
|
+
exitCode: EXIT_INPUT,
|
|
32
|
+
errorCode: version === undefined ? "SCRIPT_VERSION_MISSING" : "SCRIPT_VERSION_UNSUPPORTED",
|
|
33
|
+
required: ["version: 3 or version: 4"],
|
|
34
|
+
received: [String(version)],
|
|
35
|
+
nextSteps: ["Use an explicit supported script version; scriptctl does not infer a version from document shape."],
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export function dialectFor(value) {
|
|
39
|
+
return DIALECTS[scriptVersionOf(value)];
|
|
40
|
+
}
|
|
41
|
+
export function requireScriptDocument(value) {
|
|
42
|
+
return dialectFor(value).require(value);
|
|
43
|
+
}
|
|
44
|
+
export function validateScriptDocument(value) {
|
|
45
|
+
return dialectFor(value).validate(value);
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=dispatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../../../src/domain/script/dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACvD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