@lingjingai/scriptctl 0.49.15 → 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.49.16.md +15 -0
- 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 +126 -283
- package/skills/scriptctl/references/atomic-edit-workflow.md +45 -0
- 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
- package/skills/scriptctl/references/atomic-write-workflow.md +0 -176
|
@@ -1,165 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { asList, isDict, isList, opErr, strOf } from "../shared.js";
|
|
3
|
-
import { findScene, idKeyForKind, nextStateId, pluralForKind } from "../lookups.js";
|
|
4
|
-
import { parseAssetTarget, parseSceneRef, parseStateTarget } from "../address.js";
|
|
5
|
-
import { sceneRefs, setSceneRefs } from "../scene-refs.js";
|
|
6
|
-
import { contextRefIndex, contextRefsForKind, matchingContextRefIndexes, resolveAssetByTarget, resolveState, sceneRefOccurrence, setContextState, validateStateForTarget, } from "./helpers.js";
|
|
7
|
-
export function op_state_add(__ctx) {
|
|
8
|
-
const { script, op, applied, kind } = __ctx;
|
|
9
|
-
const [targetKind, targetId] = parseAssetTarget(op["target"]);
|
|
10
|
-
const asset = resolveAssetByTarget(script, targetKind, targetId);
|
|
11
|
-
const name = strOf(op["name"] || op["state_name"]).trim();
|
|
12
|
-
const description = strOf(op["description"]).trim();
|
|
13
|
-
const stateId = strOf(op["state_id"]).trim() || nextStateId(script);
|
|
14
|
-
if (!name) {
|
|
15
|
-
throw opErr("SCRIPT OP BLOCKED: State name empty", "State name empty.", {
|
|
16
|
-
required: ["name"], received: [JSON.stringify(op)],
|
|
17
|
-
nextSteps: ["Provide a state name."], op: kind, errorCode: "STATE_NAME_EMPTY",
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
const reason = stateRejectionReason(targetKind, name);
|
|
21
|
-
if (reason) {
|
|
22
|
-
throw opErr("SCRIPT OP BLOCKED: State label invalid", "State label invalid.", {
|
|
23
|
-
required: ["one clear state label"], received: [name],
|
|
24
|
-
nextSteps: ["Do not combine multiple states into one label."], op: kind, errorCode: "STATE_LABEL_INVALID",
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
if (!isList(asset["states"]))
|
|
28
|
-
asset["states"] = [];
|
|
29
|
-
const existingStates = asset["states"];
|
|
30
|
-
if (existingStates.some((s) => strOf(s["state_id"]) === stateId)) {
|
|
31
|
-
throw opErr("SCRIPT OP BLOCKED: State id exists", "State id exists.", { required: ["unused state_id"], received: [stateId], nextSteps: ["Use another state_id or edit the existing state."], op: kind, errorCode: "STATE_ID_EXISTS" });
|
|
32
|
-
}
|
|
33
|
-
if (existingStates.some((s) => strOf(s["state_name"] || s["name"]) === name)) {
|
|
34
|
-
throw opErr("SCRIPT OP BLOCKED: State name exists", "State name exists.", { required: ["unused state name"], received: [name], nextSteps: ["Rename the existing state or choose another name."], op: kind, errorCode: "STATE_NAME_EXISTS" });
|
|
35
|
-
}
|
|
36
|
-
existingStates.push({ state_id: stateId, state_name: name, description });
|
|
37
|
-
op["state_id"] = stateId;
|
|
38
|
-
applied.push(kind);
|
|
39
|
-
}
|
|
40
|
-
export function op_state_rename(__ctx) {
|
|
41
|
-
const { script, op, applied, kind } = __ctx;
|
|
42
|
-
const [targetKind, targetId, stateId] = parseStateTarget(op["target"]);
|
|
43
|
-
const state = resolveState(script, targetKind, targetId, stateId);
|
|
44
|
-
const name = strOf(op["name"] || op["state_name"]).trim();
|
|
45
|
-
if (!name) {
|
|
46
|
-
throw opErr("SCRIPT OP BLOCKED: State name empty", "State name empty.", { required: ["name"], received: [JSON.stringify(op)], nextSteps: ["Provide a state name."], op: kind, errorCode: "STATE_NAME_EMPTY" });
|
|
47
|
-
}
|
|
48
|
-
const reason = stateRejectionReason(targetKind, name);
|
|
49
|
-
if (reason) {
|
|
50
|
-
throw opErr("SCRIPT OP BLOCKED: State label invalid", "State label invalid.", { required: ["one clear state label"], received: [name], nextSteps: ["Do not combine multiple states into one label."], op: kind, errorCode: "STATE_LABEL_INVALID" });
|
|
51
|
-
}
|
|
52
|
-
state["state_name"] = name;
|
|
53
|
-
applied.push(kind);
|
|
54
|
-
}
|
|
55
|
-
export function op_state_describe(__ctx) {
|
|
56
|
-
const { script, op, applied, kind } = __ctx;
|
|
57
|
-
const [targetKind, targetId, stateId] = parseStateTarget(op["target"]);
|
|
58
|
-
const state = resolveState(script, targetKind, targetId, stateId);
|
|
59
|
-
state["description"] = strOf(op["description"]).trim();
|
|
60
|
-
applied.push(kind);
|
|
61
|
-
}
|
|
62
|
-
export function op_state_delete(__ctx) {
|
|
63
|
-
const { script, op, applied, kind } = __ctx;
|
|
64
|
-
const [targetKind, targetId, stateId] = parseStateTarget(op["target"]);
|
|
65
|
-
const asset = resolveAssetByTarget(script, targetKind, targetId);
|
|
66
|
-
resolveState(script, targetKind, targetId, stateId);
|
|
67
|
-
// v3 invariant: every asset keeps exactly one 'default' state.
|
|
68
|
-
if (stateId === "default") {
|
|
69
|
-
throw opErr("SCRIPT OP BLOCKED: Cannot delete default state", "The 'default' state cannot be deleted.", {
|
|
70
|
-
required: ["a non-default state_id"], received: [stateId],
|
|
71
|
-
nextSteps: ["Delete a specific state; the default is the always-present baseline."], op: kind, errorCode: "STATE_DEFAULT_PROTECTED",
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
const strategy = strOf(op["strategy"]).trim();
|
|
75
|
-
const replacement = strOf(op["replacement"]).trim();
|
|
76
|
-
if (strategy !== "replace" && strategy !== "remove") {
|
|
77
|
-
throw opErr("SCRIPT OP BLOCKED: Delete strategy invalid", "Delete strategy invalid.", { required: ["strategy: replace or remove"], received: [strategy || "<empty>"], nextSteps: ["Choose replace with --replacement, or remove."], op: kind, errorCode: "DELETE_STRATEGY_INVALID" });
|
|
78
|
-
}
|
|
79
|
-
if (strategy === "replace") {
|
|
80
|
-
if (!replacement) {
|
|
81
|
-
throw opErr("SCRIPT OP BLOCKED: Replacement missing", "Replacement missing.", { required: ["replacement state_id"], received: ["<empty>"], nextSteps: ["Pass --replacement with an existing state_id."], op: kind, errorCode: "REPLACEMENT_MISSING" });
|
|
82
|
-
}
|
|
83
|
-
validateStateForTarget(script, targetKind, targetId, replacement);
|
|
84
|
-
}
|
|
85
|
-
const idKey = idKeyForKind(targetKind);
|
|
86
|
-
// Scrub scene refs that carried the deleted state: replace → replacement,
|
|
87
|
-
// remove → clear to null (state lives only on scene refs in v3).
|
|
88
|
-
for (const ep of asList(script["episodes"])) {
|
|
89
|
-
for (const scene of asList(ep["scenes"])) {
|
|
90
|
-
const bag = sceneRefs(scene);
|
|
91
|
-
let touched = false;
|
|
92
|
-
for (const ref of contextRefsForKind(bag, targetKind)) {
|
|
93
|
-
if (strOf(ref[idKey]) === targetId && strOf(ref["state_id"]) === stateId) {
|
|
94
|
-
ref["state_id"] = strategy === "replace" ? replacement : null;
|
|
95
|
-
touched = true;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
if (touched)
|
|
99
|
-
setSceneRefs(scene, bag);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
asset["states"] = asList(asset["states"]).filter((s) => strOf(s["state_id"]) !== stateId);
|
|
103
|
-
applied.push(kind);
|
|
104
|
-
}
|
|
105
|
-
export function op_scene_ref_set(__ctx) {
|
|
106
|
-
const { script, op, applied, kind } = __ctx;
|
|
107
|
-
const [epId, sceneId] = parseSceneRef(op["at"]);
|
|
108
|
-
const [targetKind, targetId] = parseAssetTarget(op["target"]);
|
|
109
|
-
const append = Boolean(op["append"]);
|
|
110
|
-
const occurrence = sceneRefOccurrence(op["occurrence"], kind);
|
|
111
|
-
if (append && occurrence !== undefined) {
|
|
112
|
-
throw opErr("SCRIPT OP BLOCKED: scene ref append is ambiguous", "append and occurrence cannot be combined.", {
|
|
113
|
-
required: ["append=true, or occurrence=<n>"],
|
|
114
|
-
received: ["append=true", `occurrence=${occurrence}`],
|
|
115
|
-
nextSteps: ["Append a new ref or update an existing occurrence."],
|
|
116
|
-
op: kind,
|
|
117
|
-
errorCode: "SCENE_REF_APPEND_FLAG_CONFLICT",
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
setContextState(script, epId, sceneId, targetKind, targetId, strOf(op["state"] || op["state_id"]).trim(), { append, occurrence, op: kind });
|
|
121
|
-
applied.push(kind);
|
|
122
|
-
}
|
|
123
|
-
export function op_scene_ref_clear(__ctx) {
|
|
124
|
-
const { script, op, applied, kind } = __ctx;
|
|
125
|
-
const [epId, sceneId] = parseSceneRef(op["at"]);
|
|
126
|
-
const [targetKind, targetId] = parseAssetTarget(op["target"]);
|
|
127
|
-
setContextState(script, epId, sceneId, targetKind, targetId, null, {
|
|
128
|
-
occurrence: sceneRefOccurrence(op["occurrence"], kind),
|
|
129
|
-
op: kind,
|
|
130
|
-
});
|
|
131
|
-
applied.push(kind);
|
|
132
|
-
}
|
|
133
|
-
export function op_scene_ref_remove(__ctx) {
|
|
134
|
-
const { script, op, applied, kind } = __ctx;
|
|
135
|
-
const [epId, sceneId] = parseSceneRef(op["at"]);
|
|
136
|
-
const [targetKind, targetId] = parseAssetTarget(op["target"]);
|
|
137
|
-
const scene = findScene(script, epId, sceneId);
|
|
138
|
-
const bag = sceneRefs(scene);
|
|
139
|
-
const idKey = idKeyForKind(targetKind);
|
|
140
|
-
const refs = contextRefsForKind(bag, targetKind);
|
|
141
|
-
const occurrence = sceneRefOccurrence(op["occurrence"], kind);
|
|
142
|
-
const removeIndex = contextRefIndex(refs, idKey, targetId, occurrence, kind);
|
|
143
|
-
const matchingIndexes = matchingContextRefIndexes(refs, idKey, targetId);
|
|
144
|
-
if (targetKind === "actor"
|
|
145
|
-
&& removeIndex !== undefined
|
|
146
|
-
&& matchingIndexes.length === 1
|
|
147
|
-
&& asList(scene["actions"]).some((action) => {
|
|
148
|
-
const speaker = action["speaker"];
|
|
149
|
-
return isDict(speaker) && strOf(speaker["actor_id"]) === targetId;
|
|
150
|
-
})) {
|
|
151
|
-
throw opErr("SCRIPT OP BLOCKED: Actor is used in scene", "Cannot remove an actor reference while the actor speaks in this scene.", {
|
|
152
|
-
required: ["all dialogue/inner_thought speaker refs moved or removed before scene actor removal"],
|
|
153
|
-
received: [`${epId}/${sceneId} actor:${targetId}`],
|
|
154
|
-
nextSteps: ["Reassign or remove the actor's lines, then remove the scene ref."],
|
|
155
|
-
op: kind,
|
|
156
|
-
errorCode: "ACTOR_IN_USE_IN_SCENE",
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
if (removeIndex !== undefined)
|
|
160
|
-
refs.splice(removeIndex, 1);
|
|
161
|
-
bag[pluralForKind(targetKind)] = refs;
|
|
162
|
-
setSceneRefs(scene, bag);
|
|
163
|
-
applied.push(kind);
|
|
164
|
-
}
|
|
1
|
+
export * from "../v3/patch/ops-state.js";
|
|
165
2
|
//# sourceMappingURL=ops-state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ops-state.js","sourceRoot":"","sources":["../../../../src/domain/script/patch/ops-state.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"ops-state.js","sourceRoot":"","sources":["../../../../src/domain/script/patch/ops-state.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const OP_REGISTRY: Record<string, OpHandler>;
|
|
1
|
+
export { V3_OP_REGISTRY, V3_OP_REGISTRY as OP_REGISTRY, } from "../v3/patch/registry.js";
|
|
@@ -1,53 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { op_actor_add, op_location_add, op_prop_add, op_asset_role_set, op_importance_set, op_asset_rename, op_asset_describe, op_asset_alias_set, op_asset_alias_add, op_asset_alias_remove, op_asset_states_set, op_asset_merge, op_asset_delete } from "./ops-asset.js";
|
|
3
|
-
import { op_dialogue_speaker_set } from "./ops-dialogue.js";
|
|
4
|
-
import { op_episode_add, op_episode_synopsis_set, op_meta_worldview_set, op_meta_synopsis_set } from "./ops-meta.js";
|
|
5
|
-
import { op_scene_insert, op_scene_split, op_scene_merge, op_scene_delete, op_scene_move } from "./ops-scene.js";
|
|
6
|
-
import { op_state_add, op_state_rename, op_state_describe, op_state_delete, op_scene_ref_set, op_scene_ref_clear, op_scene_ref_remove } from "./ops-state.js";
|
|
7
|
-
import { op_extend_set, op_extend_clear } from "./ops-extend.js";
|
|
8
|
-
export const OP_REGISTRY = {
|
|
9
|
-
"state.add": op_state_add,
|
|
10
|
-
"state.rename": op_state_rename,
|
|
11
|
-
"state.describe": op_state_describe,
|
|
12
|
-
"state.delete": op_state_delete,
|
|
13
|
-
"scene.ref.set": op_scene_ref_set,
|
|
14
|
-
"scene.ref.clear": op_scene_ref_clear,
|
|
15
|
-
"scene.ref.remove": op_scene_ref_remove,
|
|
16
|
-
"action.transition.set": op_action_transition_set,
|
|
17
|
-
"action.transition.clear": op_action_transition_clear,
|
|
18
|
-
"action.content.replace": op_action_content_replace,
|
|
19
|
-
"action.content.regex-replace": op_action_content_regex_replace,
|
|
20
|
-
"dialogue.speaker.set": op_dialogue_speaker_set,
|
|
21
|
-
"actor.add": op_actor_add,
|
|
22
|
-
"location.add": op_location_add,
|
|
23
|
-
"prop.add": op_prop_add,
|
|
24
|
-
"episode.add": op_episode_add,
|
|
25
|
-
"episode.synopsis.set": op_episode_synopsis_set,
|
|
26
|
-
"meta.worldview.set": op_meta_worldview_set,
|
|
27
|
-
"meta.synopsis.set": op_meta_synopsis_set,
|
|
28
|
-
"asset.role.set": op_asset_role_set,
|
|
29
|
-
"importance.set": op_importance_set,
|
|
30
|
-
"asset.rename": op_asset_rename,
|
|
31
|
-
"asset.describe": op_asset_describe,
|
|
32
|
-
"asset.alias.set": op_asset_alias_set,
|
|
33
|
-
"asset.alias.add": op_asset_alias_add,
|
|
34
|
-
"asset.alias.remove": op_asset_alias_remove,
|
|
35
|
-
"asset.states.set": op_asset_states_set,
|
|
36
|
-
"asset.merge": op_asset_merge,
|
|
37
|
-
"asset.delete": op_asset_delete,
|
|
38
|
-
"action.type.set": op_action_type_set,
|
|
39
|
-
"action.actor.set": op_action_actor_set,
|
|
40
|
-
"action.emotion.set": op_action_emotion_set,
|
|
41
|
-
"action.emotion.clear": op_action_emotion_clear,
|
|
42
|
-
"action.delete": op_action_delete,
|
|
43
|
-
"action.insert": op_action_insert,
|
|
44
|
-
"action.move": op_action_move,
|
|
45
|
-
"scene.insert": op_scene_insert,
|
|
46
|
-
"scene.split": op_scene_split,
|
|
47
|
-
"scene.merge": op_scene_merge,
|
|
48
|
-
"scene.delete": op_scene_delete,
|
|
49
|
-
"scene.move": op_scene_move,
|
|
50
|
-
"extend.set": op_extend_set,
|
|
51
|
-
"extend.clear": op_extend_clear,
|
|
52
|
-
};
|
|
1
|
+
export { V3_OP_REGISTRY, V3_OP_REGISTRY as OP_REGISTRY, } from "../v3/patch/registry.js";
|
|
53
2
|
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/domain/script/patch/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/domain/script/patch/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,IAAI,WAAW,GAC9B,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export interface OpCtx {
|
|
3
|
-
script: Dict;
|
|
4
|
-
op: Dict;
|
|
5
|
-
sourceText: string;
|
|
6
|
-
applied: string[];
|
|
7
|
-
kind: string;
|
|
8
|
-
runOps: (operations: Dict[]) => string[];
|
|
9
|
-
}
|
|
10
|
-
export type OpHandler = (ctx: OpCtx) => void;
|
|
1
|
+
export * from "../v3/patch/types.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "../v3/patch/types.js";
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/domain/script/patch/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/domain/script/patch/types.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function stateRefSummary(kind: string, targetId: string, stateId: string, location: string, role: string): Dict;
|
|
3
|
-
export declare function collectStateRefs(script: Dict, kind: string, targetId: string, stateId: string): Dict[];
|
|
4
|
-
export declare function collectAssetRefs(script: Dict, kind: string, targetId: string): Dict[];
|
|
1
|
+
export * from "./v3/refs.js";
|
|
@@ -1,64 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { sceneRefs } from "./scene-refs.js";
|
|
3
|
-
import { idKeyForKind, pluralForKind } from "./lookups.js";
|
|
4
|
-
export function stateRefSummary(kind, targetId, stateId, location, role) {
|
|
5
|
-
return { target: `${kind}:${targetId}/${stateId}`, location, role };
|
|
6
|
-
}
|
|
7
|
-
// v3: a state is referenced only where a scene's cast/props/location ref carries
|
|
8
|
-
// it (scene.actors[]/props[]/location.state_id). There are no per-action
|
|
9
|
-
// state_changes in v3, so scene refs are the whole surface.
|
|
10
|
-
export function collectStateRefs(script, kind, targetId, stateId) {
|
|
11
|
-
const refs = [];
|
|
12
|
-
const idKey = idKeyForKind(kind);
|
|
13
|
-
for (const ep of asList(script["episodes"])) {
|
|
14
|
-
const epId = strOf(ep["episode_id"]);
|
|
15
|
-
for (const scene of asList(ep["scenes"])) {
|
|
16
|
-
const sceneId = strOf(scene["scene_id"]);
|
|
17
|
-
const refsList = asList(sceneRefs(scene)[pluralForKind(kind)]);
|
|
18
|
-
for (let idx = 0; idx < refsList.length; idx++) {
|
|
19
|
-
const ref = refsList[idx];
|
|
20
|
-
if (strOf(ref[idKey]) === targetId && strOf(ref["state_id"]) === stateId) {
|
|
21
|
-
refs.push(stateRefSummary(kind, targetId, stateId, `${epId}/${sceneId}.${pluralForKind(kind)}[${idx}]`, "scene_state"));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return refs;
|
|
27
|
-
}
|
|
28
|
-
// v3: an asset is referenced by scene cast/props/location refs, by a dialogue
|
|
29
|
-
// line's inline speaker (action.speaker.actor_id, actors only), and by an
|
|
30
|
-
// action.transition_prompt.target. No speaker roster, no state_changes.
|
|
31
|
-
export function collectAssetRefs(script, kind, targetId) {
|
|
32
|
-
const refs = [];
|
|
33
|
-
const target = `${kind}:${targetId}`;
|
|
34
|
-
const idKey = idKeyForKind(kind);
|
|
35
|
-
for (const ep of asList(script["episodes"])) {
|
|
36
|
-
const epId = strOf(ep["episode_id"]);
|
|
37
|
-
for (const scene of asList(ep["scenes"])) {
|
|
38
|
-
const sceneId = strOf(scene["scene_id"]);
|
|
39
|
-
const refsList = asList(sceneRefs(scene)[pluralForKind(kind)]);
|
|
40
|
-
for (let i = 0; i < refsList.length; i++) {
|
|
41
|
-
if (strOf(refsList[i][idKey]) === targetId) {
|
|
42
|
-
refs.push({ target, location: `${epId}/${sceneId}.${pluralForKind(kind)}[${i}]`, role: `scene_${pluralForKind(kind)}` });
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
const actions = asList(scene["actions"]);
|
|
46
|
-
for (let actionIdx = 0; actionIdx < actions.length; actionIdx++) {
|
|
47
|
-
const action = actions[actionIdx];
|
|
48
|
-
const speaker = action["speaker"];
|
|
49
|
-
if (kind === "actor" && isDict(speaker) && strOf(speaker["actor_id"]) === targetId) {
|
|
50
|
-
refs.push({ target, location: `${epId}/${sceneId}#${actionIdx}.speaker`, role: "dialogue_speaker" });
|
|
51
|
-
}
|
|
52
|
-
const transition = action["transition_prompt"];
|
|
53
|
-
if (isDict(transition)) {
|
|
54
|
-
const t = strOf(transition["target"]).trim();
|
|
55
|
-
if (t === targetId || t === target) {
|
|
56
|
-
refs.push({ target, location: `${epId}/${sceneId}#${actionIdx}.transition_prompt`, role: "transition_target" });
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return refs;
|
|
63
|
-
}
|
|
1
|
+
export * from "./v3/refs.js";
|
|
64
2
|
//# sourceMappingURL=refs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refs.js","sourceRoot":"","sources":["../../../src/domain/script/refs.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"refs.js","sourceRoot":"","sources":["../../../src/domain/script/refs.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -1,35 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
// top-level scene fields — scene.actors[] / scene.props[] (arrays of
|
|
3
|
-
// {actor_id|prop_id, state_id?}) and scene.location ({location_id, state_id?} |
|
|
4
|
-
// null, single-valued) — NOT the legacy scene.context{} bag. These two functions
|
|
5
|
-
// are the ONLY place the patch ops touch that storage, so the whole context.*
|
|
6
|
-
// op family operates on v3 through the same {actors,locations,props} bag shape
|
|
7
|
-
// the ops already expect. `locations` is synthesized as a 0-or-1 array from the
|
|
8
|
-
// single scene.location so multi-location callers keep working (location stays
|
|
9
|
-
// single-valued: setSceneRefs writes locations[0] back as scene.location).
|
|
10
|
-
import { asList, isDict, isList } from "./shared.js";
|
|
11
|
-
export function sceneRefs(scene) {
|
|
12
|
-
const loc = isDict(scene["location"]) ? scene["location"] : null;
|
|
13
|
-
return {
|
|
14
|
-
actors: isList(scene["actors"]) ? scene["actors"] : [],
|
|
15
|
-
props: isList(scene["props"]) ? scene["props"] : [],
|
|
16
|
-
locations: loc && String(loc["location_id"] ?? "").trim() ? [loc] : [],
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
// Clean a single ref to v3 shape: keep the id key, keep state_id ONLY when it is
|
|
20
|
-
// a real (non-null, non-empty) materialized id — v3 validation rejects a
|
|
21
|
-
// state_id: null (it reads as "declared but not materialized").
|
|
22
|
-
function cleanRef(ref, idKey) {
|
|
23
|
-
const out = { [idKey]: ref[idKey] };
|
|
24
|
-
const state = ref["state_id"];
|
|
25
|
-
if (state != null && String(state).trim())
|
|
26
|
-
out["state_id"] = state;
|
|
27
|
-
return out;
|
|
28
|
-
}
|
|
29
|
-
export function setSceneRefs(scene, refs) {
|
|
30
|
-
scene["actors"] = asList(refs["actors"]).map((r) => cleanRef(r, "actor_id"));
|
|
31
|
-
scene["props"] = asList(refs["props"]).map((r) => cleanRef(r, "prop_id"));
|
|
32
|
-
const loc = asList(refs["locations"])[0];
|
|
33
|
-
scene["location"] = loc && String(loc["location_id"] ?? "").trim() ? cleanRef(loc, "location_id") : null;
|
|
34
|
-
}
|
|
1
|
+
export * from "./v3/scene-refs.js";
|
|
35
2
|
//# sourceMappingURL=scene-refs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-refs.js","sourceRoot":"","sources":["../../../src/domain/script/scene-refs.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"scene-refs.js","sourceRoot":"","sources":["../../../src/domain/script/scene-refs.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,56 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
// dump field definitions agents can introspect without reading source.
|
|
3
|
-
export const PATCH_OP_SCHEMA = {
|
|
4
|
-
// meta
|
|
5
|
-
"meta.worldview.set": { required: ["worldview"], optional: ["worldview_raw"], description: "Set the script.worldview enum." },
|
|
6
|
-
"meta.synopsis.set": { required: ["synopsis"], optional: [], description: "Set the whole-script synopsis." },
|
|
7
|
-
// state
|
|
8
|
-
"state.add": { required: ["target", "name"], optional: ["description", "state_id"], description: "Add a state to an asset's states[]." },
|
|
9
|
-
"state.rename": { required: ["target", "name"], optional: [], description: "Rename an asset state." },
|
|
10
|
-
"state.describe": { required: ["target", "description"], optional: [], description: "Set a state's description." },
|
|
11
|
-
"state.delete": { required: ["target", "strategy"], optional: ["replacement"], description: "Delete a state. strategy: replace|remove." },
|
|
12
|
-
// asset
|
|
13
|
-
"actor.add": { required: ["name"], optional: ["actor_id", "role_type", "importance", "description", "aliases"], description: "Register a new actor (human/character). importance: featured|background (default featured)." },
|
|
14
|
-
"location.add": { required: ["name"], optional: ["location_id", "importance", "description"], description: "Register a new location. importance: featured|background." },
|
|
15
|
-
"prop.add": { required: ["name"], optional: ["prop_id", "importance", "description"], description: "Register a new prop. importance: featured|background." },
|
|
16
|
-
"episode.add": { required: [], optional: ["episode_id", "title"], description: "Append a new empty episode (no scenes)." },
|
|
17
|
-
"episode.synopsis.set": { required: ["episode_id", "synopsis"], optional: [], description: "Set one episode's synopsis." },
|
|
18
|
-
"asset.rename": { required: ["target", "name"], optional: [], description: "Rename an asset (actor / location / prop)." },
|
|
19
|
-
"asset.describe": { required: ["target", "description"], optional: [], description: "Set asset description." },
|
|
20
|
-
"asset.alias.set": { required: ["target", "aliases"], optional: [], description: "Bulk replace aliases[]." },
|
|
21
|
-
"asset.alias.add": { required: ["target", "alias"], optional: [], description: "Append alias(es)." },
|
|
22
|
-
"asset.alias.remove": { required: ["target", "alias"], optional: [], description: "Remove alias(es)." },
|
|
23
|
-
"asset.states.set": { required: ["target", "states"], optional: ["asset_type"], description: "Bulk replace states[] (the 'default' state is always preserved)." },
|
|
24
|
-
"asset.role.set": { required: ["target", "role_type"], optional: [], description: "Set actor role_type (主角|配角)." },
|
|
25
|
-
"importance.set": { required: ["target", "importance"], optional: [], description: "Set an asset's importance tier: featured (主角/配角) | background (龙套/背景)." },
|
|
26
|
-
"asset.merge": { required: ["from", "into"], optional: [], description: "Merge from asset into another; from disappears." },
|
|
27
|
-
"asset.delete": { required: ["target"], optional: ["strategy", "replacement"], description: "Delete an asset. strategy: replace|remove (required if refs exist)." },
|
|
28
|
-
// action
|
|
29
|
-
"action.type.set": { required: ["at", "type"], optional: [], description: "Set action.type (dialogue|action|inner_thought|transition)." },
|
|
30
|
-
"action.actor.set": { required: ["at"], optional: ["actor_id"], description: "Set/clear the dialogue line's speaker to an actor (action.speaker={actor_id}). Omit actor_id to clear." },
|
|
31
|
-
"action.emotion.set": { required: ["at", "emotion"], optional: [], description: "Set action.emotion." },
|
|
32
|
-
"action.emotion.clear": { required: ["at"], optional: [], description: "Clear action.emotion." },
|
|
33
|
-
"action.content.replace": { required: ["at", "from"], optional: ["to", "all"], description: "Literal substring replace in action.content." },
|
|
34
|
-
"action.content.regex-replace": { required: ["at", "pattern"], optional: ["to", "all"], description: "Regex (/re/flags) replace in action.content. ReDoS-guarded." },
|
|
35
|
-
"action.transition.set": { required: ["at", "target", "process", "contrast"], optional: [], description: "Set transition_prompt {target, process, contrast}." },
|
|
36
|
-
"action.transition.clear": { required: ["at"], optional: [], description: "Clear transition_prompt." },
|
|
37
|
-
"action.delete": { required: ["at"], optional: [], description: "Remove an action; later indices shift." },
|
|
38
|
-
"action.insert": { required: ["at", "type"], optional: ["content", "emotion", "at_index", "before", "after", "actor_id", "kind", "label"], description: "Insert body into a scene after its asset refs and states are ready. dialogue/inner_thought requires actor_id or a non-actor kind." },
|
|
39
|
-
"action.move": { required: ["at", "to"], optional: [], description: "Move an action (within or across scenes)." },
|
|
40
|
-
// scene
|
|
41
|
-
"scene.split": { required: ["at", "at_index"], optional: ["new_scene_id"], description: "Split a scene at an action boundary." },
|
|
42
|
-
"scene.merge": { required: ["from", "into"], optional: [], description: "Merge two scenes within the same episode." },
|
|
43
|
-
"scene.delete": { required: ["at"], optional: ["force"], description: "Delete a scene; empty by default, force=true for non-empty." },
|
|
44
|
-
"scene.move": { required: ["at", "to"], optional: ["at_index"], description: "Move a scene to another episode." },
|
|
45
|
-
"scene.insert": { required: ["at", "location"], optional: ["time", "space", "at_index", "before", "after", "scene_id"], description: "Insert a new empty scene." },
|
|
46
|
-
// scene refs (v3: cast/props/location live directly on the scene, no context{})
|
|
47
|
-
"scene.ref.set": { required: ["at", "target"], optional: ["state", "state_id", "append", "occurrence"], description: "Set a scene ref state. append=true adds another actor ref; occurrence is the 1-based matching ref to update. Location remains single-valued." },
|
|
48
|
-
"scene.ref.clear": { required: ["at", "target"], optional: ["occurrence"], description: "Keep the scene ref and clear its state_id. occurrence is the 1-based matching ref." },
|
|
49
|
-
"scene.ref.remove": { required: ["at", "target"], optional: ["occurrence"], description: "Remove a scene ref. occurrence is required when the target appears more than once." },
|
|
50
|
-
// dialogue speaker (v3: single inline speaker per line — actor or non-actor kind)
|
|
51
|
-
"dialogue.speaker.set": { required: ["at"], optional: ["actor_id", "kind", "label"], description: "Set the dialogue line's inline speaker: actor_id (an actor) OR kind (system|broadcast|offscreen|group) + optional label." },
|
|
52
|
-
// extend (free-form namespace, any dimension)
|
|
53
|
-
"extend.set": { required: ["at", "key", "value"], optional: [], description: "Set a free-form key on a node's extend{} namespace. at: action(ep/scn#i)|scene(ep/scn)|episode(ep)|asset(kind:id)|state(kind:id/st)|speaker(spk_x)|global. key is a flat name (dots are literal, not traversed). value is any JSON." },
|
|
54
|
-
"extend.clear": { required: ["at"], optional: ["key"], description: "Delete one extend key (key set) or clear the whole extend{} container (key omitted). Empty container is removed; deleting a missing key is a no-op." },
|
|
55
|
-
};
|
|
1
|
+
export * from "./v3/schema.js";
|
|
56
2
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/domain/script/schema.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/domain/script/schema.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,45 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { type Dict } from "./shared.js";
|
|
3
|
-
export declare const MAX_GREP_PATTERN_LEN = 256;
|
|
4
|
-
export declare function isDangerousRegex(pattern: string): boolean;
|
|
5
|
-
export type ActionCoord = {
|
|
6
|
-
scn: number;
|
|
7
|
-
idx: number;
|
|
8
|
-
};
|
|
9
|
-
export type SelectorRegion = {
|
|
10
|
-
level: "episode";
|
|
11
|
-
lo: number;
|
|
12
|
-
hi: number;
|
|
13
|
-
} | {
|
|
14
|
-
level: "scene";
|
|
15
|
-
lo: number;
|
|
16
|
-
hi: number;
|
|
17
|
-
} | {
|
|
18
|
-
level: "action";
|
|
19
|
-
lo: ActionCoord;
|
|
20
|
-
hi: ActionCoord;
|
|
21
|
-
};
|
|
22
|
-
export interface InSelector {
|
|
23
|
-
readonly isEmpty: boolean;
|
|
24
|
-
matchesScene(epId: string, sceneId: string): boolean;
|
|
25
|
-
matchesAction(epId: string, sceneId: string, idx: number): boolean;
|
|
26
|
-
}
|
|
27
|
-
export declare function cmpAction(a: ActionCoord, b: ActionCoord): number;
|
|
28
|
-
export declare function regionMatchesScene(r: SelectorRegion, ep: number, scn: number): boolean;
|
|
29
|
-
export declare function regionMatchesAction(r: SelectorRegion, ep: number, scn: number, idx: number): boolean;
|
|
30
|
-
export declare class RegionSelector implements InSelector {
|
|
31
|
-
readonly regions: SelectorRegion[];
|
|
32
|
-
constructor(regions: SelectorRegion[]);
|
|
33
|
-
get isEmpty(): boolean;
|
|
34
|
-
matchesScene(epId: string, sceneId: string): boolean;
|
|
35
|
-
matchesAction(epId: string, sceneId: string, idx: number): boolean;
|
|
36
|
-
}
|
|
37
|
-
export declare function inSelectorError(detail: string, received: string): CliError;
|
|
38
|
-
export declare function parseRegion(region: string, full: string): SelectorRegion;
|
|
39
|
-
export declare const WHOLE_SCRIPT: InSelector;
|
|
40
|
-
export declare function parseInSelector(raw: unknown): InSelector;
|
|
41
|
-
export declare function selectorSingleActionPoint(sel: InSelector): {
|
|
42
|
-
scn: number;
|
|
43
|
-
idx: number;
|
|
44
|
-
} | null;
|
|
45
|
-
export declare function expandSelectorToActionRefs(script: Dict, selector: InSelector): string[];
|
|
1
|
+
export * from "./v3/selector.js";
|