@lingjingai/scriptctl 0.63.13 → 0.63.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/changes/0.63.14.md +7 -0
- package/changes/0.63.15.md +15 -0
- package/dist/bin.js +1 -20812
- package/dist/chunk-3LPIMYYI.js +823 -0
- package/dist/cli.d.ts +214 -5
- package/dist/cli.js +1 -187
- package/dist/review-agent.js +56 -3593
- package/package.json +12 -5
- package/dist/bin.d.ts +0 -2
- package/dist/bin.js.map +0 -7
- package/dist/cli/register-authoring.d.ts +0 -4
- package/dist/cli/register-authoring.js +0 -35
- package/dist/cli/register-authoring.js.map +0 -1
- package/dist/cli/register-review.d.ts +0 -3
- package/dist/cli/register-review.js +0 -20
- package/dist/cli/register-review.js.map +0 -1
- package/dist/cli/register-script.d.ts +0 -3
- package/dist/cli/register-script.js +0 -297
- package/dist/cli/register-script.js.map +0 -1
- package/dist/cli/register-tools.d.ts +0 -3
- package/dist/cli/register-tools.js +0 -23
- package/dist/cli/register-tools.js.map +0 -1
- package/dist/cli/register-workflows.d.ts +0 -4
- package/dist/cli/register-workflows.js +0 -108
- package/dist/cli/register-workflows.js.map +0 -1
- package/dist/cli/registry.d.ts +0 -14
- package/dist/cli/registry.js +0 -65
- package/dist/cli/registry.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/common.d.ts +0 -93
- package/dist/common.js +0 -240
- package/dist/common.js.map +0 -1
- package/dist/domain/authoring/apply.d.ts +0 -1
- package/dist/domain/authoring/apply.js +0 -2
- package/dist/domain/authoring/apply.js.map +0 -1
- package/dist/domain/authoring/export.d.ts +0 -1
- package/dist/domain/authoring/export.js +0 -2
- package/dist/domain/authoring/export.js.map +0 -1
- package/dist/domain/authoring/parser.d.ts +0 -2
- package/dist/domain/authoring/parser.js +0 -3
- package/dist/domain/authoring/parser.js.map +0 -1
- package/dist/domain/authoring/serializer.d.ts +0 -1
- package/dist/domain/authoring/serializer.js +0 -2
- package/dist/domain/authoring/serializer.js.map +0 -1
- package/dist/domain/authoring/shared/bracket.d.ts +0 -4
- package/dist/domain/authoring/shared/bracket.js +0 -95
- package/dist/domain/authoring/shared/bracket.js.map +0 -1
- package/dist/domain/authoring/shared/types.d.ts +0 -12
- package/dist/domain/authoring/shared/types.js +0 -2
- package/dist/domain/authoring/shared/types.js.map +0 -1
- package/dist/domain/authoring/types.d.ts +0 -2
- package/dist/domain/authoring/types.js +0 -3
- package/dist/domain/authoring/types.js.map +0 -1
- package/dist/domain/authoring/v3/apply.d.ts +0 -33
- package/dist/domain/authoring/v3/apply.js +0 -784
- package/dist/domain/authoring/v3/apply.js.map +0 -1
- package/dist/domain/authoring/v3/export.d.ts +0 -7
- package/dist/domain/authoring/v3/export.js +0 -85
- package/dist/domain/authoring/v3/export.js.map +0 -1
- package/dist/domain/authoring/v3/parser.d.ts +0 -3
- package/dist/domain/authoring/v3/parser.js +0 -823
- package/dist/domain/authoring/v3/parser.js.map +0 -1
- package/dist/domain/authoring/v3/serializer.d.ts +0 -2
- package/dist/domain/authoring/v3/serializer.js +0 -244
- package/dist/domain/authoring/v3/serializer.js.map +0 -1
- package/dist/domain/authoring/v3/types.d.ts +0 -76
- package/dist/domain/authoring/v3/types.js +0 -2
- package/dist/domain/authoring/v3/types.js.map +0 -1
- package/dist/domain/authoring/v4/apply.d.ts +0 -40
- package/dist/domain/authoring/v4/apply.js +0 -451
- package/dist/domain/authoring/v4/apply.js.map +0 -1
- package/dist/domain/authoring/v4/parser.d.ts +0 -2
- package/dist/domain/authoring/v4/parser.js +0 -729
- package/dist/domain/authoring/v4/parser.js.map +0 -1
- package/dist/domain/authoring/v4/serializer.d.ts +0 -6
- package/dist/domain/authoring/v4/serializer.js +0 -280
- package/dist/domain/authoring/v4/serializer.js.map +0 -1
- package/dist/domain/authoring/v4/types.d.ts +0 -50
- package/dist/domain/authoring/v4/types.js +0 -2
- package/dist/domain/authoring/v4/types.js.map +0 -1
- package/dist/domain/creative-draft/compose.d.ts +0 -18
- package/dist/domain/creative-draft/compose.js +0 -448
- package/dist/domain/creative-draft/compose.js.map +0 -1
- package/dist/domain/ingest/apply-plan.d.ts +0 -23
- package/dist/domain/ingest/apply-plan.js +0 -210
- package/dist/domain/ingest/apply-plan.js.map +0 -1
- package/dist/domain/ingest/assembler.d.ts +0 -65
- package/dist/domain/ingest/assembler.js +0 -263
- package/dist/domain/ingest/assembler.js.map +0 -1
- package/dist/domain/ingest/asset-audit.d.ts +0 -50
- package/dist/domain/ingest/asset-audit.js +0 -196
- package/dist/domain/ingest/asset-audit.js.map +0 -1
- package/dist/domain/ingest/chunker.d.ts +0 -9
- package/dist/domain/ingest/chunker.js +0 -49
- package/dist/domain/ingest/chunker.js.map +0 -1
- package/dist/domain/ingest/environment.d.ts +0 -3
- package/dist/domain/ingest/environment.js +0 -32
- package/dist/domain/ingest/environment.js.map +0 -1
- package/dist/domain/ingest/evidence.d.ts +0 -5
- package/dist/domain/ingest/evidence.js +0 -66
- package/dist/domain/ingest/evidence.js.map +0 -1
- package/dist/domain/ingest/govern.d.ts +0 -3
- package/dist/domain/ingest/govern.js +0 -157
- package/dist/domain/ingest/govern.js.map +0 -1
- package/dist/domain/ingest/jsonl-parser.d.ts +0 -6
- package/dist/domain/ingest/jsonl-parser.js +0 -204
- package/dist/domain/ingest/jsonl-parser.js.map +0 -1
- package/dist/domain/ingest/markdown-parser.d.ts +0 -6
- package/dist/domain/ingest/markdown-parser.js +0 -187
- package/dist/domain/ingest/markdown-parser.js.map +0 -1
- package/dist/domain/ingest/production-validation.d.ts +0 -8
- package/dist/domain/ingest/production-validation.js +0 -37
- package/dist/domain/ingest/production-validation.js.map +0 -1
- package/dist/domain/ingest/records.d.ts +0 -72
- package/dist/domain/ingest/records.js +0 -10
- package/dist/domain/ingest/records.js.map +0 -1
- package/dist/domain/ingest/renumber.d.ts +0 -14
- package/dist/domain/ingest/renumber.js +0 -130
- package/dist/domain/ingest/renumber.js.map +0 -1
- package/dist/domain/ingest/serial-context.d.ts +0 -93
- package/dist/domain/ingest/serial-context.js +0 -355
- package/dist/domain/ingest/serial-context.js.map +0 -1
- package/dist/domain/ingest/state-identity.d.ts +0 -2
- package/dist/domain/ingest/state-identity.js +0 -3
- package/dist/domain/ingest/state-identity.js.map +0 -1
- package/dist/domain/ingest/state-reconcile.d.ts +0 -12
- package/dist/domain/ingest/state-reconcile.js +0 -92
- package/dist/domain/ingest/state-reconcile.js.map +0 -1
- package/dist/domain/ingest/validation.d.ts +0 -1
- package/dist/domain/ingest/validation.js +0 -2
- package/dist/domain/ingest/validation.js.map +0 -1
- package/dist/domain/ingest/video-apply.d.ts +0 -4
- package/dist/domain/ingest/video-apply.js +0 -128
- package/dist/domain/ingest/video-apply.js.map +0 -1
- package/dist/domain/ingest/video-context.d.ts +0 -64
- package/dist/domain/ingest/video-context.js +0 -480
- package/dist/domain/ingest/video-context.js.map +0 -1
- package/dist/domain/ingest/video-records.d.ts +0 -57
- package/dist/domain/ingest/video-records.js +0 -9
- package/dist/domain/ingest/video-records.js.map +0 -1
- package/dist/domain/ingest/video-serial-md.d.ts +0 -81
- package/dist/domain/ingest/video-serial-md.js +0 -297
- package/dist/domain/ingest/video-serial-md.js.map +0 -1
- package/dist/domain/ingest/video-source-evolution.d.ts +0 -25
- package/dist/domain/ingest/video-source-evolution.js +0 -40
- package/dist/domain/ingest/video-source-evolution.js.map +0 -1
- package/dist/domain/ingest/video-state-evidence.d.ts +0 -66
- package/dist/domain/ingest/video-state-evidence.js +0 -385
- package/dist/domain/ingest/video-state-evidence.js.map +0 -1
- package/dist/domain/ingest/video-timestamp.d.ts +0 -8
- package/dist/domain/ingest/video-timestamp.js +0 -26
- package/dist/domain/ingest/video-timestamp.js.map +0 -1
- package/dist/domain/loom/checkpointer.d.ts +0 -3
- package/dist/domain/loom/checkpointer.js +0 -30
- package/dist/domain/loom/checkpointer.js.map +0 -1
- package/dist/domain/loom/index.d.ts +0 -45
- package/dist/domain/loom/index.js +0 -277
- package/dist/domain/loom/index.js.map +0 -1
- package/dist/domain/loom/types.d.ts +0 -101
- package/dist/domain/loom/types.js +0 -2
- package/dist/domain/loom/types.js.map +0 -1
- package/dist/domain/script/address.d.ts +0 -1
- package/dist/domain/script/address.js +0 -2
- package/dist/domain/script/address.js.map +0 -1
- package/dist/domain/script/dispatch.d.ts +0 -18
- package/dist/domain/script/dispatch.js +0 -55
- package/dist/domain/script/dispatch.js.map +0 -1
- package/dist/domain/script/lookups.d.ts +0 -1
- package/dist/domain/script/lookups.js +0 -2
- package/dist/domain/script/lookups.js.map +0 -1
- package/dist/domain/script/migrations/registry.d.ts +0 -4
- package/dist/domain/script/migrations/registry.js +0 -76
- package/dist/domain/script/migrations/registry.js.map +0 -1
- package/dist/domain/script/migrations/types.d.ts +0 -17
- package/dist/domain/script/migrations/types.js +0 -2
- package/dist/domain/script/migrations/types.js.map +0 -1
- package/dist/domain/script/migrations/v3-to-v4.d.ts +0 -3
- package/dist/domain/script/migrations/v3-to-v4.js +0 -57
- package/dist/domain/script/migrations/v3-to-v4.js.map +0 -1
- package/dist/domain/script/names.d.ts +0 -1
- package/dist/domain/script/names.js +0 -2
- package/dist/domain/script/names.js.map +0 -1
- package/dist/domain/script/parse.d.ts +0 -1
- package/dist/domain/script/parse.js +0 -2
- package/dist/domain/script/parse.js.map +0 -1
- package/dist/domain/script/patch/apply.d.ts +0 -1
- package/dist/domain/script/patch/apply.js +0 -2
- package/dist/domain/script/patch/apply.js.map +0 -1
- package/dist/domain/script/patch/helpers.d.ts +0 -1
- package/dist/domain/script/patch/helpers.js +0 -2
- package/dist/domain/script/patch/helpers.js.map +0 -1
- package/dist/domain/script/patch/inline-speaker.d.ts +0 -1
- package/dist/domain/script/patch/inline-speaker.js +0 -2
- package/dist/domain/script/patch/inline-speaker.js.map +0 -1
- package/dist/domain/script/patch/ops-action.d.ts +0 -1
- package/dist/domain/script/patch/ops-action.js +0 -2
- package/dist/domain/script/patch/ops-action.js.map +0 -1
- package/dist/domain/script/patch/ops-asset.d.ts +0 -1
- package/dist/domain/script/patch/ops-asset.js +0 -2
- package/dist/domain/script/patch/ops-asset.js.map +0 -1
- package/dist/domain/script/patch/ops-dialogue.d.ts +0 -1
- package/dist/domain/script/patch/ops-dialogue.js +0 -2
- package/dist/domain/script/patch/ops-dialogue.js.map +0 -1
- package/dist/domain/script/patch/ops-extend.d.ts +0 -1
- package/dist/domain/script/patch/ops-extend.js +0 -2
- package/dist/domain/script/patch/ops-extend.js.map +0 -1
- package/dist/domain/script/patch/ops-meta.d.ts +0 -1
- package/dist/domain/script/patch/ops-meta.js +0 -2
- package/dist/domain/script/patch/ops-meta.js.map +0 -1
- package/dist/domain/script/patch/ops-scene.d.ts +0 -1
- package/dist/domain/script/patch/ops-scene.js +0 -2
- package/dist/domain/script/patch/ops-scene.js.map +0 -1
- package/dist/domain/script/patch/ops-state.d.ts +0 -1
- package/dist/domain/script/patch/ops-state.js +0 -2
- package/dist/domain/script/patch/ops-state.js.map +0 -1
- package/dist/domain/script/patch/registry.d.ts +0 -1
- package/dist/domain/script/patch/registry.js +0 -2
- package/dist/domain/script/patch/registry.js.map +0 -1
- package/dist/domain/script/patch/types.d.ts +0 -1
- package/dist/domain/script/patch/types.js +0 -2
- package/dist/domain/script/patch/types.js.map +0 -1
- package/dist/domain/script/refs.d.ts +0 -1
- package/dist/domain/script/refs.js +0 -2
- package/dist/domain/script/refs.js.map +0 -1
- package/dist/domain/script/scene-refs.d.ts +0 -1
- package/dist/domain/script/scene-refs.js +0 -2
- package/dist/domain/script/scene-refs.js.map +0 -1
- package/dist/domain/script/schema.d.ts +0 -1
- package/dist/domain/script/schema.js +0 -2
- package/dist/domain/script/schema.js.map +0 -1
- package/dist/domain/script/selector.d.ts +0 -1
- package/dist/domain/script/selector.js +0 -2
- package/dist/domain/script/selector.js.map +0 -1
- package/dist/domain/script/shared/regex.d.ts +0 -2
- package/dist/domain/script/shared/regex.js +0 -7
- package/dist/domain/script/shared/regex.js.map +0 -1
- package/dist/domain/script/shared/types.d.ts +0 -1
- package/dist/domain/script/shared/types.js +0 -5
- package/dist/domain/script/shared/types.js.map +0 -1
- package/dist/domain/script/shared/validation.d.ts +0 -1
- package/dist/domain/script/shared/validation.js +0 -3
- package/dist/domain/script/shared/validation.js.map +0 -1
- package/dist/domain/script/shared.d.ts +0 -15
- package/dist/domain/script/shared.js +0 -35
- package/dist/domain/script/shared.js.map +0 -1
- package/dist/domain/script/text-util.d.ts +0 -7
- package/dist/domain/script/text-util.js +0 -95
- package/dist/domain/script/text-util.js.map +0 -1
- package/dist/domain/script/timestamp.d.ts +0 -1
- package/dist/domain/script/timestamp.js +0 -3
- package/dist/domain/script/timestamp.js.map +0 -1
- package/dist/domain/script/types.d.ts +0 -1
- package/dist/domain/script/types.js +0 -2
- package/dist/domain/script/types.js.map +0 -1
- package/dist/domain/script/v3/address.d.ts +0 -32
- package/dist/domain/script/v3/address.js +0 -136
- package/dist/domain/script/v3/address.js.map +0 -1
- package/dist/domain/script/v3/lookups.d.ts +0 -33
- package/dist/domain/script/v3/lookups.js +0 -316
- package/dist/domain/script/v3/lookups.js.map +0 -1
- package/dist/domain/script/v3/ordinal.d.ts +0 -8
- package/dist/domain/script/v3/ordinal.js +0 -91
- package/dist/domain/script/v3/ordinal.js.map +0 -1
- package/dist/domain/script/v3/parse.d.ts +0 -3
- package/dist/domain/script/v3/parse.js +0 -164
- package/dist/domain/script/v3/parse.js.map +0 -1
- package/dist/domain/script/v3/patch/apply.d.ts +0 -2
- package/dist/domain/script/v3/patch/apply.js +0 -31
- package/dist/domain/script/v3/patch/apply.js.map +0 -1
- package/dist/domain/script/v3/patch/helpers.d.ts +0 -15
- package/dist/domain/script/v3/patch/helpers.js +0 -155
- package/dist/domain/script/v3/patch/helpers.js.map +0 -1
- package/dist/domain/script/v3/patch/inline-speaker.d.ts +0 -2
- package/dist/domain/script/v3/patch/inline-speaker.js +0 -50
- package/dist/domain/script/v3/patch/inline-speaker.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-action.d.ts +0 -12
- package/dist/domain/script/v3/patch/ops-action.js +0 -355
- package/dist/domain/script/v3/patch/ops-action.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-asset.d.ts +0 -14
- package/dist/domain/script/v3/patch/ops-asset.js +0 -347
- package/dist/domain/script/v3/patch/ops-asset.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-dialogue.d.ts +0 -2
- package/dist/domain/script/v3/patch/ops-dialogue.js +0 -21
- package/dist/domain/script/v3/patch/ops-dialogue.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-extend.d.ts +0 -8
- package/dist/domain/script/v3/patch/ops-extend.js +0 -122
- package/dist/domain/script/v3/patch/ops-extend.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-meta.d.ts +0 -5
- package/dist/domain/script/v3/patch/ops-meta.js +0 -82
- package/dist/domain/script/v3/patch/ops-meta.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-scene.d.ts +0 -6
- package/dist/domain/script/v3/patch/ops-scene.js +0 -351
- package/dist/domain/script/v3/patch/ops-scene.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-state.d.ts +0 -8
- package/dist/domain/script/v3/patch/ops-state.js +0 -155
- package/dist/domain/script/v3/patch/ops-state.js.map +0 -1
- package/dist/domain/script/v3/patch/ops-timestamp.d.ts +0 -6
- package/dist/domain/script/v3/patch/ops-timestamp.js +0 -47
- package/dist/domain/script/v3/patch/ops-timestamp.js.map +0 -1
- package/dist/domain/script/v3/patch/registry.d.ts +0 -2
- package/dist/domain/script/v3/patch/registry.js +0 -56
- package/dist/domain/script/v3/patch/registry.js.map +0 -1
- package/dist/domain/script/v3/patch/types.d.ts +0 -10
- package/dist/domain/script/v3/patch/types.js +0 -2
- package/dist/domain/script/v3/patch/types.js.map +0 -1
- package/dist/domain/script/v3/refs.d.ts +0 -4
- package/dist/domain/script/v3/refs.js +0 -64
- package/dist/domain/script/v3/refs.js.map +0 -1
- package/dist/domain/script/v3/scene-refs.d.ts +0 -3
- package/dist/domain/script/v3/scene-refs.js +0 -35
- package/dist/domain/script/v3/scene-refs.js.map +0 -1
- package/dist/domain/script/v3/schema.d.ts +0 -6
- package/dist/domain/script/v3/schema.js +0 -58
- package/dist/domain/script/v3/schema.js.map +0 -1
- package/dist/domain/script/v3/selector.d.ts +0 -44
- package/dist/domain/script/v3/selector.js +0 -178
- package/dist/domain/script/v3/selector.js.map +0 -1
- package/dist/domain/script/v3/types.d.ts +0 -106
- package/dist/domain/script/v3/types.js +0 -2
- package/dist/domain/script/v3/types.js.map +0 -1
- package/dist/domain/script/v3/validation.d.ts +0 -2
- package/dist/domain/script/v3/validation.js +0 -2
- package/dist/domain/script/v3/validation.js.map +0 -1
- package/dist/domain/script/v4/address.d.ts +0 -61
- package/dist/domain/script/v4/address.js +0 -99
- package/dist/domain/script/v4/address.js.map +0 -1
- package/dist/domain/script/v4/factory.d.ts +0 -2
- package/dist/domain/script/v4/factory.js +0 -13
- package/dist/domain/script/v4/factory.js.map +0 -1
- package/dist/domain/script/v4/from-v3.d.ts +0 -29
- package/dist/domain/script/v4/from-v3.js +0 -307
- package/dist/domain/script/v4/from-v3.js.map +0 -1
- package/dist/domain/script/v4/ids.d.ts +0 -5
- package/dist/domain/script/v4/ids.js +0 -41
- package/dist/domain/script/v4/ids.js.map +0 -1
- package/dist/domain/script/v4/ordinal.d.ts +0 -3
- package/dist/domain/script/v4/ordinal.js +0 -66
- package/dist/domain/script/v4/ordinal.js.map +0 -1
- package/dist/domain/script/v4/parse.d.ts +0 -5
- package/dist/domain/script/v4/parse.js +0 -196
- package/dist/domain/script/v4/parse.js.map +0 -1
- package/dist/domain/script/v4/patch/apply.d.ts +0 -3
- package/dist/domain/script/v4/patch/apply.js +0 -24
- package/dist/domain/script/v4/patch/apply.js.map +0 -1
- package/dist/domain/script/v4/patch/helpers.d.ts +0 -32
- package/dist/domain/script/v4/patch/helpers.js +0 -138
- package/dist/domain/script/v4/patch/helpers.js.map +0 -1
- package/dist/domain/script/v4/patch/ops-action.d.ts +0 -13
- package/dist/domain/script/v4/patch/ops-action.js +0 -351
- package/dist/domain/script/v4/patch/ops-action.js.map +0 -1
- package/dist/domain/script/v4/patch/ops-asset.d.ts +0 -17
- package/dist/domain/script/v4/patch/ops-asset.js +0 -556
- package/dist/domain/script/v4/patch/ops-asset.js.map +0 -1
- package/dist/domain/script/v4/patch/ops-extend.d.ts +0 -11
- package/dist/domain/script/v4/patch/ops-extend.js +0 -103
- package/dist/domain/script/v4/patch/ops-extend.js.map +0 -1
- package/dist/domain/script/v4/patch/ops-meta.d.ts +0 -5
- package/dist/domain/script/v4/patch/ops-meta.js +0 -49
- package/dist/domain/script/v4/patch/ops-meta.js.map +0 -1
- package/dist/domain/script/v4/patch/ops-scene-ref.d.ts +0 -3
- package/dist/domain/script/v4/patch/ops-scene-ref.js +0 -74
- package/dist/domain/script/v4/patch/ops-scene-ref.js.map +0 -1
- package/dist/domain/script/v4/patch/ops-structure.d.ts +0 -6
- package/dist/domain/script/v4/patch/ops-structure.js +0 -236
- package/dist/domain/script/v4/patch/ops-structure.js.map +0 -1
- package/dist/domain/script/v4/patch/ops-timestamp.d.ts +0 -6
- package/dist/domain/script/v4/patch/ops-timestamp.js +0 -40
- package/dist/domain/script/v4/patch/ops-timestamp.js.map +0 -1
- package/dist/domain/script/v4/patch/registry.d.ts +0 -2
- package/dist/domain/script/v4/patch/registry.js +0 -53
- package/dist/domain/script/v4/patch/registry.js.map +0 -1
- package/dist/domain/script/v4/patch/schema.d.ts +0 -7
- package/dist/domain/script/v4/patch/schema.js +0 -77
- package/dist/domain/script/v4/patch/schema.js.map +0 -1
- package/dist/domain/script/v4/patch/types.d.ts +0 -10
- package/dist/domain/script/v4/patch/types.js +0 -2
- package/dist/domain/script/v4/patch/types.js.map +0 -1
- package/dist/domain/script/v4/selector.d.ts +0 -11
- package/dist/domain/script/v4/selector.js +0 -124
- package/dist/domain/script/v4/selector.js.map +0 -1
- package/dist/domain/script/v4/types.d.ts +0 -120
- package/dist/domain/script/v4/types.js +0 -2
- package/dist/domain/script/v4/types.js.map +0 -1
- package/dist/domain/script/v4/validation.d.ts +0 -2
- package/dist/domain/script/v4/validation.js +0 -2
- package/dist/domain/script/v4/validation.js.map +0 -1
- package/dist/failures.d.ts +0 -58
- package/dist/failures.js +0 -96
- package/dist/failures.js.map +0 -1
- package/dist/infra/converters.d.ts +0 -9
- package/dist/infra/converters.js +0 -689
- package/dist/infra/converters.js.map +0 -1
- package/dist/infra/env.d.ts +0 -2
- package/dist/infra/env.js +0 -81
- package/dist/infra/env.js.map +0 -1
- package/dist/infra/episode-title.d.ts +0 -4
- package/dist/infra/episode-title.js +0 -129
- package/dist/infra/episode-title.js.map +0 -1
- package/dist/infra/ingest/review-renderer.d.ts +0 -1
- package/dist/infra/ingest/review-renderer.js +0 -440
- package/dist/infra/ingest/review-renderer.js.map +0 -1
- package/dist/infra/ingest/source-resolver.d.ts +0 -21
- package/dist/infra/ingest/source-resolver.js +0 -51
- package/dist/infra/ingest/source-resolver.js.map +0 -1
- package/dist/infra/ingest/text-reader.d.ts +0 -3
- package/dist/infra/ingest/text-reader.js +0 -27
- package/dist/infra/ingest/text-reader.js.map +0 -1
- package/dist/infra/ingest/video-discovery.d.ts +0 -8
- package/dist/infra/ingest/video-discovery.js +0 -69
- package/dist/infra/ingest/video-discovery.js.map +0 -1
- package/dist/infra/ingest/video-source-snapshot.d.ts +0 -4
- package/dist/infra/ingest/video-source-snapshot.js +0 -47
- package/dist/infra/ingest/video-source-snapshot.js.map +0 -1
- package/dist/infra/ingest/video-state-evidence.d.ts +0 -14
- package/dist/infra/ingest/video-state-evidence.js +0 -140
- package/dist/infra/ingest/video-state-evidence.js.map +0 -1
- package/dist/infra/ingest/video-transcode.d.ts +0 -7
- package/dist/infra/ingest/video-transcode.js +0 -98
- package/dist/infra/ingest/video-transcode.js.map +0 -1
- package/dist/infra/ingest/workspace-lock.d.ts +0 -1
- package/dist/infra/ingest/workspace-lock.js +0 -32
- package/dist/infra/ingest/workspace-lock.js.map +0 -1
- package/dist/infra/ingest/workspace-store.d.ts +0 -18
- package/dist/infra/ingest/workspace-store.js +0 -70
- package/dist/infra/ingest/workspace-store.js.map +0 -1
- package/dist/infra/llm/anthropic-model.d.ts +0 -11
- package/dist/infra/llm/anthropic-model.js +0 -130
- package/dist/infra/llm/anthropic-model.js.map +0 -1
- package/dist/infra/llm/doubao-model.d.ts +0 -60
- package/dist/infra/llm/doubao-model.js +0 -249
- package/dist/infra/llm/doubao-model.js.map +0 -1
- package/dist/infra/llm/failure-mapping.d.ts +0 -6
- package/dist/infra/llm/failure-mapping.js +0 -146
- package/dist/infra/llm/failure-mapping.js.map +0 -1
- package/dist/infra/llm/gemini-upload.d.ts +0 -13
- package/dist/infra/llm/gemini-upload.js +0 -138
- package/dist/infra/llm/gemini-upload.js.map +0 -1
- package/dist/infra/llm/gemini-video-model.d.ts +0 -50
- package/dist/infra/llm/gemini-video-model.js +0 -371
- package/dist/infra/llm/gemini-video-model.js.map +0 -1
- package/dist/infra/llm/openai-compatible-model.d.ts +0 -14
- package/dist/infra/llm/openai-compatible-model.js +0 -207
- package/dist/infra/llm/openai-compatible-model.js.map +0 -1
- package/dist/infra/llm/retry.d.ts +0 -8
- package/dist/infra/llm/retry.js +0 -41
- package/dist/infra/llm/retry.js.map +0 -1
- package/dist/infra/local-script-output-store.d.ts +0 -43
- package/dist/infra/local-script-output-store.js +0 -168
- package/dist/infra/local-script-output-store.js.map +0 -1
- package/dist/infra/script-output-api.d.ts +0 -50
- package/dist/infra/script-output-api.js +0 -251
- package/dist/infra/script-output-api.js.map +0 -1
- package/dist/infra/script-output-store.d.ts +0 -152
- package/dist/infra/script-output-store.js +0 -114
- package/dist/infra/script-output-store.js.map +0 -1
- package/dist/infra/script-working-copy.d.ts +0 -23
- package/dist/infra/script-working-copy.js +0 -157
- package/dist/infra/script-working-copy.js.map +0 -1
- package/dist/infra/storage.d.ts +0 -35
- package/dist/infra/storage.js +0 -91
- package/dist/infra/storage.js.map +0 -1
- package/dist/llm/composition.d.ts +0 -5
- package/dist/llm/composition.js +0 -5
- package/dist/llm/composition.js.map +0 -1
- package/dist/llm/config.d.ts +0 -28
- package/dist/llm/config.js +0 -231
- package/dist/llm/config.js.map +0 -1
- package/dist/llm/registry.d.ts +0 -43
- package/dist/llm/registry.js +0 -69
- package/dist/llm/registry.js.map +0 -1
- package/dist/llm/router.d.ts +0 -46
- package/dist/llm/router.js +0 -512
- package/dist/llm/router.js.map +0 -1
- package/dist/llm/tasks/ingest/arc-summary.d.ts +0 -8
- package/dist/llm/tasks/ingest/arc-summary.js +0 -26
- package/dist/llm/tasks/ingest/arc-summary.js.map +0 -1
- package/dist/llm/tasks/ingest/asset-audit.d.ts +0 -6
- package/dist/llm/tasks/ingest/asset-audit.js +0 -158
- package/dist/llm/tasks/ingest/asset-audit.js.map +0 -1
- package/dist/llm/tasks/ingest/asset-curate.d.ts +0 -13
- package/dist/llm/tasks/ingest/asset-curate.js +0 -45
- package/dist/llm/tasks/ingest/asset-curate.js.map +0 -1
- package/dist/llm/tasks/ingest/asset-extract.d.ts +0 -12
- package/dist/llm/tasks/ingest/asset-extract.js +0 -51
- package/dist/llm/tasks/ingest/asset-extract.js.map +0 -1
- package/dist/llm/tasks/ingest/asset-govern.d.ts +0 -22
- package/dist/llm/tasks/ingest/asset-govern.js +0 -143
- package/dist/llm/tasks/ingest/asset-govern.js.map +0 -1
- package/dist/llm/tasks/ingest/body-start.d.ts +0 -10
- package/dist/llm/tasks/ingest/body-start.js +0 -41
- package/dist/llm/tasks/ingest/body-start.js.map +0 -1
- package/dist/llm/tasks/ingest/episode-assets.d.ts +0 -29
- package/dist/llm/tasks/ingest/episode-assets.js +0 -282
- package/dist/llm/tasks/ingest/episode-assets.js.map +0 -1
- package/dist/llm/tasks/ingest/mention-resolve.d.ts +0 -9
- package/dist/llm/tasks/ingest/mention-resolve.js +0 -39
- package/dist/llm/tasks/ingest/mention-resolve.js.map +0 -1
- package/dist/llm/tasks/ingest/name-fix.d.ts +0 -9
- package/dist/llm/tasks/ingest/name-fix.js +0 -56
- package/dist/llm/tasks/ingest/name-fix.js.map +0 -1
- package/dist/llm/tasks/ingest/state-reconcile.d.ts +0 -8
- package/dist/llm/tasks/ingest/state-reconcile.js +0 -44
- package/dist/llm/tasks/ingest/state-reconcile.js.map +0 -1
- package/dist/llm/tasks/ingest/text-normalize.d.ts +0 -10
- package/dist/llm/tasks/ingest/text-normalize.js +0 -122
- package/dist/llm/tasks/ingest/text-normalize.js.map +0 -1
- package/dist/llm/tasks/ingest/video-serial.d.ts +0 -14
- package/dist/llm/tasks/ingest/video-serial.js +0 -391
- package/dist/llm/tasks/ingest/video-serial.js.map +0 -1
- package/dist/llm/tasks/schemas.d.ts +0 -9
- package/dist/llm/tasks/schemas.js +0 -466
- package/dist/llm/tasks/schemas.js.map +0 -1
- package/dist/llm/types.d.ts +0 -178
- package/dist/llm/types.js +0 -44
- package/dist/llm/types.js.map +0 -1
- package/dist/output.d.ts +0 -3
- package/dist/output.js +0 -94
- package/dist/output.js.map +0 -1
- package/dist/package-root.d.ts +0 -2
- package/dist/package-root.js +0 -38
- package/dist/package-root.js.map +0 -1
- package/dist/review-agent.js.map +0 -7
- package/dist/usecases/changelog.d.ts +0 -9
- package/dist/usecases/changelog.js +0 -134
- package/dist/usecases/changelog.js.map +0 -1
- package/dist/usecases/doctor.d.ts +0 -2
- package/dist/usecases/doctor.js +0 -231
- package/dist/usecases/doctor.js.map +0 -1
- package/dist/usecases/ingest/body-start.d.ts +0 -8
- package/dist/usecases/ingest/body-start.js +0 -36
- package/dist/usecases/ingest/body-start.js.map +0 -1
- package/dist/usecases/ingest/command.d.ts +0 -5
- package/dist/usecases/ingest/command.js +0 -183
- package/dist/usecases/ingest/command.js.map +0 -1
- package/dist/usecases/ingest/failure.d.ts +0 -26
- package/dist/usecases/ingest/failure.js +0 -151
- package/dist/usecases/ingest/failure.js.map +0 -1
- package/dist/usecases/ingest/fanout.d.ts +0 -10
- package/dist/usecases/ingest/fanout.js +0 -23
- package/dist/usecases/ingest/fanout.js.map +0 -1
- package/dist/usecases/ingest/final-asset-audit.d.ts +0 -39
- package/dist/usecases/ingest/final-asset-audit.js +0 -88
- package/dist/usecases/ingest/final-asset-audit.js.map +0 -1
- package/dist/usecases/ingest/generate-video-state-evidence.d.ts +0 -23
- package/dist/usecases/ingest/generate-video-state-evidence.js +0 -124
- package/dist/usecases/ingest/generate-video-state-evidence.js.map +0 -1
- package/dist/usecases/ingest/pass4-mention-resolve.d.ts +0 -11
- package/dist/usecases/ingest/pass4-mention-resolve.js +0 -52
- package/dist/usecases/ingest/pass4-mention-resolve.js.map +0 -1
- package/dist/usecases/ingest/pass5-extract.d.ts +0 -7
- package/dist/usecases/ingest/pass5-extract.js +0 -51
- package/dist/usecases/ingest/pass5-extract.js.map +0 -1
- package/dist/usecases/ingest/pass5-govern.d.ts +0 -13
- package/dist/usecases/ingest/pass5-govern.js +0 -157
- package/dist/usecases/ingest/pass5-govern.js.map +0 -1
- package/dist/usecases/ingest/pipeline.d.ts +0 -28
- package/dist/usecases/ingest/pipeline.js +0 -335
- package/dist/usecases/ingest/pipeline.js.map +0 -1
- package/dist/usecases/ingest/publish-command.d.ts +0 -1
- package/dist/usecases/ingest/publish-command.js +0 -4
- package/dist/usecases/ingest/publish-command.js.map +0 -1
- package/dist/usecases/ingest/serial-govern.d.ts +0 -40
- package/dist/usecases/ingest/serial-govern.js +0 -488
- package/dist/usecases/ingest/serial-govern.js.map +0 -1
- package/dist/usecases/ingest/skip-video-episode.d.ts +0 -4
- package/dist/usecases/ingest/skip-video-episode.js +0 -120
- package/dist/usecases/ingest/skip-video-episode.js.map +0 -1
- package/dist/usecases/ingest/status.d.ts +0 -61
- package/dist/usecases/ingest/status.js +0 -347
- package/dist/usecases/ingest/status.js.map +0 -1
- package/dist/usecases/ingest/timings.d.ts +0 -51
- package/dist/usecases/ingest/timings.js +0 -68
- package/dist/usecases/ingest/timings.js.map +0 -1
- package/dist/usecases/ingest/usage-report.d.ts +0 -125
- package/dist/usecases/ingest/usage-report.js +0 -248
- package/dist/usecases/ingest/usage-report.js.map +0 -1
- package/dist/usecases/ingest/video-pipeline.d.ts +0 -81
- package/dist/usecases/ingest/video-pipeline.js +0 -547
- package/dist/usecases/ingest/video-pipeline.js.map +0 -1
- package/dist/usecases/ingest/video-skip-state.d.ts +0 -29
- package/dist/usecases/ingest/video-skip-state.js +0 -148
- package/dist/usecases/ingest/video-skip-state.js.map +0 -1
- package/dist/usecases/ingest/view-command.d.ts +0 -4
- package/dist/usecases/ingest/view-command.js +0 -67
- package/dist/usecases/ingest/view-command.js.map +0 -1
- package/dist/usecases/ingest/view-server.d.ts +0 -29
- package/dist/usecases/ingest/view-server.js +0 -364
- package/dist/usecases/ingest/view-server.js.map +0 -1
- package/dist/usecases/script/action-span.d.ts +0 -10
- package/dist/usecases/script/action-span.js +0 -42
- package/dist/usecases/script/action-span.js.map +0 -1
- package/dist/usecases/script/actions.d.ts +0 -3
- package/dist/usecases/script/actions.js +0 -184
- package/dist/usecases/script/actions.js.map +0 -1
- package/dist/usecases/script/actor.d.ts +0 -3
- package/dist/usecases/script/actor.js +0 -26
- package/dist/usecases/script/actor.js.map +0 -1
- package/dist/usecases/script/actors.d.ts +0 -3
- package/dist/usecases/script/actors.js +0 -25
- package/dist/usecases/script/actors.js.map +0 -1
- package/dist/usecases/script/add-actor.d.ts +0 -3
- package/dist/usecases/script/add-actor.js +0 -13
- package/dist/usecases/script/add-actor.js.map +0 -1
- package/dist/usecases/script/add-episode.d.ts +0 -3
- package/dist/usecases/script/add-episode.js +0 -9
- package/dist/usecases/script/add-episode.js.map +0 -1
- package/dist/usecases/script/add-location.d.ts +0 -3
- package/dist/usecases/script/add-location.js +0 -11
- package/dist/usecases/script/add-location.js.map +0 -1
- package/dist/usecases/script/add-prop.d.ts +0 -3
- package/dist/usecases/script/add-prop.js +0 -11
- package/dist/usecases/script/add-prop.js.map +0 -1
- package/dist/usecases/script/alias.d.ts +0 -3
- package/dist/usecases/script/alias.js +0 -39
- package/dist/usecases/script/alias.js.map +0 -1
- package/dist/usecases/script/assets.d.ts +0 -3
- package/dist/usecases/script/assets.js +0 -46
- package/dist/usecases/script/assets.js.map +0 -1
- package/dist/usecases/script/audit-assets.d.ts +0 -4
- package/dist/usecases/script/audit-assets.js +0 -37
- package/dist/usecases/script/audit-assets.js.map +0 -1
- package/dist/usecases/script/command-constraints.d.ts +0 -38
- package/dist/usecases/script/command-constraints.js +0 -143
- package/dist/usecases/script/command-constraints.js.map +0 -1
- package/dist/usecases/script/compose-creative-draft.d.ts +0 -3
- package/dist/usecases/script/compose-creative-draft.js +0 -106
- package/dist/usecases/script/compose-creative-draft.js.map +0 -1
- package/dist/usecases/script/context.d.ts +0 -3
- package/dist/usecases/script/context.js +0 -52
- package/dist/usecases/script/context.js.map +0 -1
- package/dist/usecases/script/create.d.ts +0 -3
- package/dist/usecases/script/create.js +0 -27
- package/dist/usecases/script/create.js.map +0 -1
- package/dist/usecases/script/delete.d.ts +0 -3
- package/dist/usecases/script/delete.js +0 -88
- package/dist/usecases/script/delete.js.map +0 -1
- package/dist/usecases/script/describe.d.ts +0 -3
- package/dist/usecases/script/describe.js +0 -32
- package/dist/usecases/script/describe.js.map +0 -1
- package/dist/usecases/script/dialogue.d.ts +0 -3
- package/dist/usecases/script/dialogue.js +0 -30
- package/dist/usecases/script/dialogue.js.map +0 -1
- package/dist/usecases/script/dispatch.d.ts +0 -3
- package/dist/usecases/script/dispatch.js +0 -10
- package/dist/usecases/script/dispatch.js.map +0 -1
- package/dist/usecases/script/do.d.ts +0 -3
- package/dist/usecases/script/do.js +0 -186
- package/dist/usecases/script/do.js.map +0 -1
- package/dist/usecases/script/emotion.d.ts +0 -3
- package/dist/usecases/script/emotion.js +0 -24
- package/dist/usecases/script/emotion.js.map +0 -1
- package/dist/usecases/script/episodes.d.ts +0 -3
- package/dist/usecases/script/episodes.js +0 -62
- package/dist/usecases/script/episodes.js.map +0 -1
- package/dist/usecases/script/export-authoring.d.ts +0 -4
- package/dist/usecases/script/export-authoring.js +0 -326
- package/dist/usecases/script/export-authoring.js.map +0 -1
- package/dist/usecases/script/extend.d.ts +0 -3
- package/dist/usecases/script/extend.js +0 -94
- package/dist/usecases/script/extend.js.map +0 -1
- package/dist/usecases/script/ids.d.ts +0 -3
- package/dist/usecases/script/ids.js +0 -148
- package/dist/usecases/script/ids.js.map +0 -1
- package/dist/usecases/script/importance.d.ts +0 -3
- package/dist/usecases/script/importance.js +0 -16
- package/dist/usecases/script/importance.js.map +0 -1
- package/dist/usecases/script/insert.d.ts +0 -3
- package/dist/usecases/script/insert.js +0 -127
- package/dist/usecases/script/insert.js.map +0 -1
- package/dist/usecases/script/issues.d.ts +0 -3
- package/dist/usecases/script/issues.js +0 -35
- package/dist/usecases/script/issues.js.map +0 -1
- package/dist/usecases/script/lib.d.ts +0 -152
- package/dist/usecases/script/lib.js +0 -1654
- package/dist/usecases/script/lib.js.map +0 -1
- package/dist/usecases/script/locations.d.ts +0 -3
- package/dist/usecases/script/locations.js +0 -25
- package/dist/usecases/script/locations.js.map +0 -1
- package/dist/usecases/script/merge.d.ts +0 -3
- package/dist/usecases/script/merge.js +0 -43
- package/dist/usecases/script/merge.js.map +0 -1
- package/dist/usecases/script/migrate.d.ts +0 -3
- package/dist/usecases/script/migrate.js +0 -210
- package/dist/usecases/script/migrate.js.map +0 -1
- package/dist/usecases/script/move.d.ts +0 -3
- package/dist/usecases/script/move.js +0 -50
- package/dist/usecases/script/move.js.map +0 -1
- package/dist/usecases/script/parenthetical.d.ts +0 -3
- package/dist/usecases/script/parenthetical.js +0 -52
- package/dist/usecases/script/parenthetical.js.map +0 -1
- package/dist/usecases/script/props.d.ts +0 -3
- package/dist/usecases/script/props.js +0 -25
- package/dist/usecases/script/props.js.map +0 -1
- package/dist/usecases/script/refs.d.ts +0 -3
- package/dist/usecases/script/refs.js +0 -111
- package/dist/usecases/script/refs.js.map +0 -1
- package/dist/usecases/script/rename.d.ts +0 -3
- package/dist/usecases/script/rename.js +0 -35
- package/dist/usecases/script/rename.js.map +0 -1
- package/dist/usecases/script/replace.d.ts +0 -3
- package/dist/usecases/script/replace.js +0 -33
- package/dist/usecases/script/replace.js.map +0 -1
- package/dist/usecases/script/review.d.ts +0 -3
- package/dist/usecases/script/review.js +0 -187
- package/dist/usecases/script/review.js.map +0 -1
- package/dist/usecases/script/role.d.ts +0 -3
- package/dist/usecases/script/role.js +0 -16
- package/dist/usecases/script/role.js.map +0 -1
- package/dist/usecases/script/scenes.d.ts +0 -3
- package/dist/usecases/script/scenes.js +0 -66
- package/dist/usecases/script/scenes.js.map +0 -1
- package/dist/usecases/script/script-patch.d.ts +0 -3
- package/dist/usecases/script/script-patch.js +0 -321
- package/dist/usecases/script/script-patch.js.map +0 -1
- package/dist/usecases/script/script-validate.d.ts +0 -3
- package/dist/usecases/script/script-validate.js +0 -27
- package/dist/usecases/script/script-validate.js.map +0 -1
- package/dist/usecases/script/session.d.ts +0 -62
- package/dist/usecases/script/session.js +0 -567
- package/dist/usecases/script/session.js.map +0 -1
- package/dist/usecases/script/split.d.ts +0 -3
- package/dist/usecases/script/split.js +0 -41
- package/dist/usecases/script/split.js.map +0 -1
- package/dist/usecases/script/state-add.d.ts +0 -3
- package/dist/usecases/script/state-add.js +0 -22
- package/dist/usecases/script/state-add.js.map +0 -1
- package/dist/usecases/script/state-delete.d.ts +0 -3
- package/dist/usecases/script/state-delete.js +0 -22
- package/dist/usecases/script/state-delete.js.map +0 -1
- package/dist/usecases/script/state-rename.d.ts +0 -3
- package/dist/usecases/script/state-rename.js +0 -16
- package/dist/usecases/script/state-rename.js.map +0 -1
- package/dist/usecases/script/states.d.ts +0 -3
- package/dist/usecases/script/states.js +0 -197
- package/dist/usecases/script/states.js.map +0 -1
- package/dist/usecases/script/summary.d.ts +0 -3
- package/dist/usecases/script/summary.js +0 -72
- package/dist/usecases/script/summary.js.map +0 -1
- package/dist/usecases/script/synopsis-generate.d.ts +0 -115
- package/dist/usecases/script/synopsis-generate.js +0 -776
- package/dist/usecases/script/synopsis-generate.js.map +0 -1
- package/dist/usecases/script/synopsis.d.ts +0 -3
- package/dist/usecases/script/synopsis.js +0 -45
- package/dist/usecases/script/synopsis.js.map +0 -1
- package/dist/usecases/script/timestamp-filter.d.ts +0 -4
- package/dist/usecases/script/timestamp-filter.js +0 -55
- package/dist/usecases/script/timestamp-filter.js.map +0 -1
- package/dist/usecases/script/timestamp.d.ts +0 -3
- package/dist/usecases/script/timestamp.js +0 -11
- package/dist/usecases/script/timestamp.js.map +0 -1
- package/dist/usecases/script/transition.d.ts +0 -3
- package/dist/usecases/script/transition.js +0 -23
- package/dist/usecases/script/transition.js.map +0 -1
- package/dist/usecases/script/type.d.ts +0 -3
- package/dist/usecases/script/type.js +0 -23
- package/dist/usecases/script/type.js.map +0 -1
- package/dist/usecases/script/v3/mutations.d.ts +0 -2
- package/dist/usecases/script/v3/mutations.js +0 -5
- package/dist/usecases/script/v3/mutations.js.map +0 -1
- package/dist/usecases/script/v4/mutations.d.ts +0 -2
- package/dist/usecases/script/v4/mutations.js +0 -6
- package/dist/usecases/script/v4/mutations.js.map +0 -1
- package/dist/usecases/script/v4/queries.d.ts +0 -15
- package/dist/usecases/script/v4/queries.js +0 -196
- package/dist/usecases/script/v4/queries.js.map +0 -1
- package/dist/usecases/script/working-copy.d.ts +0 -5
- package/dist/usecases/script/working-copy.js +0 -399
- package/dist/usecases/script/working-copy.js.map +0 -1
- package/dist/usecases/script/worldview.d.ts +0 -3
- package/dist/usecases/script/worldview.js +0 -17
- package/dist/usecases/script/worldview.js.map +0 -1
- package/dist/usecases/script/write-authoring.d.ts +0 -3
- package/dist/usecases/script/write-authoring.js +0 -263
- package/dist/usecases/script/write-authoring.js.map +0 -1
- package/dist/usecases/update.d.ts +0 -13
- package/dist/usecases/update.js +0 -128
- package/dist/usecases/update.js.map +0 -1
package/dist/llm/registry.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
function spec(id, mode, maxOutputTokens) {
|
|
2
|
-
return { id, mode, version: "1", maxOutputTokens, defaultProfile: "default" };
|
|
3
|
-
}
|
|
4
|
-
export const LLM_TASK_REGISTRY = {
|
|
5
|
-
"direct.episode-titles": spec("direct.episode-titles", "tool", 4096),
|
|
6
|
-
"direct.batch-extract": spec("direct.batch-extract", "text", 16000),
|
|
7
|
-
"direct.episode-synopsis": spec("direct.episode-synopsis", "tool", 2048),
|
|
8
|
-
"direct.synopsis-reduction": spec("direct.synopsis-reduction", "tool", 4096),
|
|
9
|
-
"direct.script-synopsis": spec("direct.script-synopsis", "tool", 2048),
|
|
10
|
-
"direct.asset-grouping": spec("direct.asset-grouping", "text", 8000),
|
|
11
|
-
"direct.asset-curation": spec("direct.asset-curation", "text", 20000),
|
|
12
|
-
"direct.asset-curation-audit": spec("direct.asset-curation-audit", "text", 20000),
|
|
13
|
-
"direct.location-canonicalization": spec("direct.location-canonicalization", "text", 20000),
|
|
14
|
-
"direct.state-curation": spec("direct.state-curation", "text", 20000),
|
|
15
|
-
"direct.state-binding": spec("direct.state-binding", "tool", 16000),
|
|
16
|
-
"metadata.global": spec("metadata.global", "text", 16000),
|
|
17
|
-
"metadata.descriptions": spec("metadata.descriptions", "text", 16000),
|
|
18
|
-
"synopsis.chunk": spec("synopsis.chunk", "text", 4096),
|
|
19
|
-
"synopsis.episode": spec("synopsis.episode", "text", 4096),
|
|
20
|
-
// Aggregation output is short, but reasoning models can consume several
|
|
21
|
-
// thousand hidden tokens before emitting it. Use the long-text budget so
|
|
22
|
-
// valid arc and whole-script summaries are not cut off mid-response.
|
|
23
|
-
"synopsis.arc": spec("synopsis.arc", "text", 16000),
|
|
24
|
-
"synopsis.script-overview": spec("synopsis.script-overview", "text", 16000),
|
|
25
|
-
// Locate where the actual screenplay body begins: a cheap text classifier
|
|
26
|
-
// scanned over 50-line windows, emitting just `起点: <行号>` / `起点: 无`. Text
|
|
27
|
-
// (not tool) mode so it runs on the cheap deepseek-flash profile, which does
|
|
28
|
-
// not support function calling. The reply is tiny, but reasoning models spend
|
|
29
|
-
// hidden tokens first — too small a budget truncates (finish_reason=length) and
|
|
30
|
-
// the whole call throws. A big cap costs nothing extra (the call stops when the
|
|
31
|
-
// model is done); it only prevents truncation, so match normalize's headroom.
|
|
32
|
-
"ingest.body-start": spec("ingest.body-start", "text", 16000),
|
|
33
|
-
// Compress a folded run of ~10 episodes' aged synopses into one arc paragraph.
|
|
34
|
-
// Fires rarely (only when the synopsis exceeds budget); output is a short
|
|
35
|
-
// paragraph, so a modest budget suffices (headroom for a reasoning model).
|
|
36
|
-
"ingest.arc-summary": spec("ingest.arc-summary", "text", 4096),
|
|
37
|
-
"ingest.text-normalize": spec("ingest.text-normalize", "text", 32000),
|
|
38
|
-
// Serial per-WINDOW asset/state annotation: model reads the running context + a
|
|
39
|
-
// token-bounded window of 1+ episodes (~10k body tokens), returns a structured
|
|
40
|
-
// Delta (SERIAL_DELTA_SCHEMA) covering all their scenes via native tool-calling —
|
|
41
|
-
// canonical names + aliases as separate fields, so no markdown delimiter can
|
|
42
|
-
// mangle a name. Output scales with the window's scene count → large cap so a
|
|
43
|
-
// dense window never truncates (a big cap costs nothing when small). Tool mode:
|
|
44
|
-
// the serial profile (ingest-normalize) must be a function-calling model.
|
|
45
|
-
"ingest.episode-assets": spec("ingest.episode-assets", "tool", 32000),
|
|
46
|
-
// Repair pass: names that appear in the body but resolved to nothing in the
|
|
47
|
-
// final registry (a missed merge). The model says merge-into-existing or new.
|
|
48
|
-
"ingest.name-fix": spec("ingest.name-fix", "tool", 16000),
|
|
49
|
-
"ingest.mention-resolve": spec("ingest.mention-resolve", "text", 8000),
|
|
50
|
-
"ingest.asset-extract": spec("ingest.asset-extract", "text", 8000),
|
|
51
|
-
"ingest.asset-curate": spec("ingest.asset-curate", "text", 32000),
|
|
52
|
-
"ingest.asset-recall": spec("ingest.asset-recall", "text", 65536),
|
|
53
|
-
"ingest.asset-refine": spec("ingest.asset-refine", "text", 32000),
|
|
54
|
-
"ingest.state-reconcile": spec("ingest.state-reconcile", "text", 32000),
|
|
55
|
-
// Final whole-script asset consistency audit. It reads a compact global
|
|
56
|
-
// roster and returns structured findings; no automatic merge is applied.
|
|
57
|
-
"ingest.asset-audit": spec("ingest.asset-audit", "tool", 32000),
|
|
58
|
-
"ingest.speaker-audit": spec("ingest.speaker-audit", "tool", 16000),
|
|
59
|
-
// Video understanding (Gemini, §10.2). One serial pass per episode: watches the
|
|
60
|
-
// video with the running cross-episode context and emits the episode content +
|
|
61
|
-
// a registry delta in one structured JSON response. Large output budget (§10.5
|
|
62
|
-
// verified 65536 for a full episode's scenes).
|
|
63
|
-
"ingest.video-serial": spec("ingest.video-serial", "video", 65536),
|
|
64
|
-
};
|
|
65
|
-
export const LLM_TASK_IDS = Object.keys(LLM_TASK_REGISTRY).filter(isLlmTaskId);
|
|
66
|
-
export function isLlmTaskId(value) {
|
|
67
|
-
return Object.hasOwn(LLM_TASK_REGISTRY, value);
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=registry.js.map
|
package/dist/llm/registry.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/llm/registry.ts"],"names":[],"mappings":"AAUA,SAAS,IAAI,CAAC,EAAa,EAAE,IAAiB,EAAE,eAAuB;IACrE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC;AAChF,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,EAAE,IAAI,CAAC;IACpE,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,EAAE,MAAM,EAAE,KAAK,CAAC;IACnE,yBAAyB,EAAE,IAAI,CAAC,yBAAyB,EAAE,MAAM,EAAE,IAAI,CAAC;IACxE,2BAA2B,EAAE,IAAI,CAAC,2BAA2B,EAAE,MAAM,EAAE,IAAI,CAAC;IAC5E,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,EAAE,MAAM,EAAE,IAAI,CAAC;IACtE,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,EAAE,IAAI,CAAC;IACpE,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,EAAE,KAAK,CAAC;IACrE,6BAA6B,EAAE,IAAI,CAAC,6BAA6B,EAAE,MAAM,EAAE,KAAK,CAAC;IACjF,kCAAkC,EAAE,IAAI,CAAC,kCAAkC,EAAE,MAAM,EAAE,KAAK,CAAC;IAC3F,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,EAAE,KAAK,CAAC;IACrE,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,EAAE,MAAM,EAAE,KAAK,CAAC;IACnE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,EAAE,KAAK,CAAC;IACzD,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,EAAE,KAAK,CAAC;IACrE,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE,IAAI,CAAC;IACtD,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,EAAE,IAAI,CAAC;IAC1D,wEAAwE;IACxE,yEAAyE;IACzE,qEAAqE;IACrE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC;IACnD,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,EAAE,MAAM,EAAE,KAAK,CAAC;IAC3E,0EAA0E;IAC1E,yEAAyE;IACzE,6EAA6E;IAC7E,8EAA8E;IAC9E,gFAAgF;IAChF,gFAAgF;IAChF,8EAA8E;IAC9E,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,MAAM,EAAE,KAAK,CAAC;IAC7D,+EAA+E;IAC/E,0EAA0E;IAC1E,2EAA2E;IAC3E,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,EAAE,IAAI,CAAC;IAC9D,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,EAAE,KAAK,CAAC;IACrE,gFAAgF;IAChF,+EAA+E;IAC/E,kFAAkF;IAClF,6EAA6E;IAC7E,8EAA8E;IAC9E,gFAAgF;IAChF,0EAA0E;IAC1E,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EAAE,MAAM,EAAE,KAAK,CAAC;IACrE,4EAA4E;IAC5E,8EAA8E;IAC9E,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,EAAE,KAAK,CAAC;IACzD,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,EAAE,MAAM,EAAE,IAAI,CAAC;IACtE,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,EAAE,MAAM,EAAE,IAAI,CAAC;IAClE,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,EAAE,KAAK,CAAC;IACjE,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,EAAE,KAAK,CAAC;IACjE,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,EAAE,KAAK,CAAC;IACjE,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,EAAE,MAAM,EAAE,KAAK,CAAC;IACvE,wEAAwE;IACxE,yEAAyE;IACzE,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,EAAE,KAAK,CAAC;IAC/D,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,EAAE,MAAM,EAAE,KAAK,CAAC;IACnE,gFAAgF;IAChF,+EAA+E;IAC/E,+EAA+E;IAC/E,+CAA+C;IAC/C,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,EAAE,OAAO,EAAE,KAAK,CAAC;CAC1B,CAAC;AAE3C,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAE/E,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC"}
|
package/dist/llm/router.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { type DoubaoRunRequest } from "../infra/llm/doubao-model.js";
|
|
2
|
-
import { type LlmModelConfig, type LlmProviderConfig, type ResolvedLlmConfig } from "./config.js";
|
|
3
|
-
import type { LlmAdapter, LlmExecutorOptions, LlmRouteInfo, LlmRouteUsage, LlmTaskExecutor, LlmTaskId, LlmUsageEvent, TaskVideoPort, TextGenerationRequest, TextGenerationResponse, ToolGenerationRequest, ToolGenerationResponse, VideoUnderstandingPort, VideoGenerationResponse } from "./types.js";
|
|
4
|
-
export interface ResolvedRoute {
|
|
5
|
-
info: LlmRouteInfo;
|
|
6
|
-
providerConfig: LlmProviderConfig;
|
|
7
|
-
modelConfig: LlmModelConfig;
|
|
8
|
-
}
|
|
9
|
-
export interface DoubaoVideoRunner {
|
|
10
|
-
run(request: DoubaoRunRequest): Promise<VideoGenerationResponse>;
|
|
11
|
-
}
|
|
12
|
-
export declare class ModelRouter implements LlmTaskExecutor {
|
|
13
|
-
private readonly config;
|
|
14
|
-
private readonly options;
|
|
15
|
-
private readonly adapters;
|
|
16
|
-
private readonly videoAdapters;
|
|
17
|
-
private readonly doubaoAdapters;
|
|
18
|
-
private readonly resolvedRoutes;
|
|
19
|
-
private readonly usageLog;
|
|
20
|
-
constructor(config: ResolvedLlmConfig, options?: LlmExecutorOptions);
|
|
21
|
-
get configSource(): "builtin" | "file";
|
|
22
|
-
private resolve;
|
|
23
|
-
route(task: LlmTaskId): LlmRouteInfo;
|
|
24
|
-
routes(): LlmRouteInfo[];
|
|
25
|
-
private emptyUsage;
|
|
26
|
-
recordReuse(task: LlmTaskId): void;
|
|
27
|
-
usage(): LlmRouteUsage[];
|
|
28
|
-
usageEvents(): LlmUsageEvent[];
|
|
29
|
-
private recordEvent;
|
|
30
|
-
private tracked;
|
|
31
|
-
private resolveDoubao;
|
|
32
|
-
private doubaoRoute;
|
|
33
|
-
private adapter;
|
|
34
|
-
protected videoAdapter(route: ResolvedRoute): VideoUnderstandingPort;
|
|
35
|
-
private videoCredential;
|
|
36
|
-
videoPort(task: LlmTaskId): TaskVideoPort;
|
|
37
|
-
private generateDoubaoVideo;
|
|
38
|
-
protected doubaoAdapter(route?: ResolvedRoute): DoubaoVideoRunner | null;
|
|
39
|
-
protected doubaoTextAdapter(): LlmAdapter | null;
|
|
40
|
-
private arkAdapter;
|
|
41
|
-
protected doubaoModel(): string;
|
|
42
|
-
private withTextFallback;
|
|
43
|
-
generateText(task: LlmTaskId, request: Omit<TextGenerationRequest, "maxOutputTokens">): Promise<TextGenerationResponse>;
|
|
44
|
-
generateTool(task: LlmTaskId, request: Omit<ToolGenerationRequest, "maxOutputTokens">): Promise<ToolGenerationResponse>;
|
|
45
|
-
}
|
|
46
|
-
export declare function createLlmExecutor(explicitConfigPath?: string, options?: LlmExecutorOptions): ModelRouter;
|
package/dist/llm/router.js
DELETED
|
@@ -1,512 +0,0 @@
|
|
|
1
|
-
import * as crypto from "node:crypto";
|
|
2
|
-
import { CliError, EXIT_INPUT, EXIT_RUNTIME } from "../common.js";
|
|
3
|
-
import { aggregateFailures, classificationOf, contextOf, createOperationalFailure, formatFailure } from "../failures.js";
|
|
4
|
-
import { AnthropicModel } from "../infra/llm/anthropic-model.js";
|
|
5
|
-
import { DoubaoModel, } from "../infra/llm/doubao-model.js";
|
|
6
|
-
import { GeminiVideoModel } from "../infra/llm/gemini-video-model.js";
|
|
7
|
-
import { OpenAiCompatibleModel } from "../infra/llm/openai-compatible-model.js";
|
|
8
|
-
import { loadLlmConfig, normalizeProviderBaseUrl, } from "./config.js";
|
|
9
|
-
import { LLM_TASK_IDS, LLM_TASK_REGISTRY } from "./registry.js";
|
|
10
|
-
import { LlmTransportError } from "./types.js";
|
|
11
|
-
// Ark endpoint shared by Gemini recovery and explicitly selected Doubao video.
|
|
12
|
-
const DOUBAO_FALLBACK = {
|
|
13
|
-
model: "ep-20260721150136-98dj9",
|
|
14
|
-
modelEnv: "ARK_MODEL",
|
|
15
|
-
baseUrl: "https://ark.cn-beijing.volces.com/api/v3",
|
|
16
|
-
apiKeyEnv: "ARK_API_KEY",
|
|
17
|
-
timeoutMs: 600_000,
|
|
18
|
-
maxAttempts: 3,
|
|
19
|
-
};
|
|
20
|
-
const GEMINI_FLASH_MODELS = ["gemini-3.8-flash", "gemini-3.7-flash", "gemini-3.6-flash"];
|
|
21
|
-
function normalizeBaseUrl(value) {
|
|
22
|
-
return value?.trim().replace(/\/+$/, "") ?? "anthropic-sdk-default";
|
|
23
|
-
}
|
|
24
|
-
function routeFingerprint(task, provider, model) {
|
|
25
|
-
const spec = LLM_TASK_REGISTRY[task];
|
|
26
|
-
const material = JSON.stringify({
|
|
27
|
-
task,
|
|
28
|
-
taskVersion: spec.version,
|
|
29
|
-
protocol: provider.protocol,
|
|
30
|
-
baseUrl: normalizeBaseUrl(provider.baseUrl),
|
|
31
|
-
model: model.model,
|
|
32
|
-
thinkingBudgetTokens: model.thinkingBudgetTokens ?? null,
|
|
33
|
-
});
|
|
34
|
-
return crypto.createHash("sha256").update(material).digest("hex");
|
|
35
|
-
}
|
|
36
|
-
function configRuntimeError(message, required, received) {
|
|
37
|
-
return new CliError(message, {
|
|
38
|
-
exitCode: EXIT_INPUT,
|
|
39
|
-
errorCode: "LLM_CONFIG_INVALID",
|
|
40
|
-
hint: "Fix the selected LLM configuration and run `scriptctl doctor`.",
|
|
41
|
-
data: { expected: required, actual: received },
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
function credentialError(provider) {
|
|
45
|
-
return new CliError("The selected LLM provider credential is not configured.", {
|
|
46
|
-
exitCode: EXIT_RUNTIME,
|
|
47
|
-
errorCode: "LLM_CREDENTIAL_MISSING",
|
|
48
|
-
hint: "Configure the credential and rerun `scriptctl doctor`.",
|
|
49
|
-
data: { expected: ["credential environment variable referenced by the selected provider"], actual: [`provider: ${provider}`, "credential: missing"] },
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
function routedFailure(error, route) {
|
|
53
|
-
return createOperationalFailure(classificationOf(error.failure), {
|
|
54
|
-
...contextOf(error.failure), provider: route.provider, model: route.model,
|
|
55
|
-
retryable: error.failure.retryable, message: error.message,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function exhaustedFailure(error, failures) {
|
|
59
|
-
if (failures.length === 1)
|
|
60
|
-
return error;
|
|
61
|
-
const aggregate = aggregateFailures(failures, "All configured model routes failed.");
|
|
62
|
-
return new LlmTransportError(error.code, aggregate.message, {
|
|
63
|
-
retryable: aggregate.retryable, classification: classificationOf(aggregate),
|
|
64
|
-
context: contextOf(aggregate), modelFailures: failures, details: failures.map(formatFailure),
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
function isGeminiRoute(route) {
|
|
68
|
-
return route.protocol === "google-gemini" || /(^|\/)gemini-/i.test(route.model);
|
|
69
|
-
}
|
|
70
|
-
function geminiRoutes(primary) {
|
|
71
|
-
const prefix = primary.info.model.slice(0, primary.info.model.lastIndexOf("/") + 1);
|
|
72
|
-
const models = new Set([primary.info.model, ...GEMINI_FLASH_MODELS.map((model) => prefix + model)]);
|
|
73
|
-
return [...models].map((model) => {
|
|
74
|
-
if (model === primary.info.model)
|
|
75
|
-
return primary;
|
|
76
|
-
const modelConfig = { ...primary.modelConfig, model };
|
|
77
|
-
return {
|
|
78
|
-
...primary, modelConfig,
|
|
79
|
-
info: { ...primary.info, model, fingerprint: routeFingerprint(primary.info.task, primary.providerConfig, modelConfig) },
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
function canFallback(error, signal) {
|
|
84
|
-
return !signal?.aborted && error instanceof LlmTransportError && error.code !== "cancelled";
|
|
85
|
-
}
|
|
86
|
-
export class ModelRouter {
|
|
87
|
-
config;
|
|
88
|
-
options;
|
|
89
|
-
adapters = new Map();
|
|
90
|
-
videoAdapters = new Map();
|
|
91
|
-
doubaoAdapters = new Map();
|
|
92
|
-
resolvedRoutes = new Map();
|
|
93
|
-
usageLog = [];
|
|
94
|
-
constructor(config, options = {}) {
|
|
95
|
-
this.config = config;
|
|
96
|
-
this.options = options;
|
|
97
|
-
}
|
|
98
|
-
get configSource() {
|
|
99
|
-
return this.config.source;
|
|
100
|
-
}
|
|
101
|
-
resolve(task) {
|
|
102
|
-
const cached = this.resolvedRoutes.get(task);
|
|
103
|
-
if (cached)
|
|
104
|
-
return cached;
|
|
105
|
-
const spec = LLM_TASK_REGISTRY[task];
|
|
106
|
-
if (spec.mode === "video" && this.options.videoProvider?.provider === "doubao") {
|
|
107
|
-
const resolved = this.resolveDoubao(task, true);
|
|
108
|
-
this.resolvedRoutes.set(task, resolved);
|
|
109
|
-
return resolved;
|
|
110
|
-
}
|
|
111
|
-
const profile = this.config.tasks[task] ?? spec.defaultProfile;
|
|
112
|
-
const modelConfig = this.config.models[profile];
|
|
113
|
-
if (!modelConfig)
|
|
114
|
-
throw configRuntimeError("The task route references a missing model profile.", [profile], [`task: ${task}`]);
|
|
115
|
-
const providerConfig = this.config.providers[modelConfig.provider];
|
|
116
|
-
if (!providerConfig) {
|
|
117
|
-
throw configRuntimeError("The model profile references a missing provider.", [modelConfig.provider], [`profile: ${profile}`]);
|
|
118
|
-
}
|
|
119
|
-
if (providerConfig.protocol === "openai-compatible" && !providerConfig.baseUrl) {
|
|
120
|
-
throw configRuntimeError("OpenAI-compatible providers require an explicit endpoint — set the provider's baseUrl, or PROJECT_LITELLM_GATEWAY_BASE_URL for the built-in gateway.", ["provider.baseUrl"], [`provider: ${modelConfig.provider}`]);
|
|
121
|
-
}
|
|
122
|
-
if (modelConfig.thinkingBudgetTokens !== undefined && spec.mode === "tool") {
|
|
123
|
-
throw configRuntimeError("Anthropic thinking cannot be combined with a forced tool call.", ["a text task or a profile without thinking"], [`task: ${task}`, `profile: ${profile}`]);
|
|
124
|
-
}
|
|
125
|
-
if (modelConfig.thinkingBudgetTokens !== undefined && modelConfig.thinkingBudgetTokens >= spec.maxOutputTokens) {
|
|
126
|
-
throw configRuntimeError("The thinking token budget must be smaller than the task output budget.", [`thinking budget < ${spec.maxOutputTokens}`], [`task: ${task}`, `thinking budget: ${modelConfig.thinkingBudgetTokens}`]);
|
|
127
|
-
}
|
|
128
|
-
const videoOverrides = spec.mode === "video" ? this.options.videoProvider : undefined;
|
|
129
|
-
const overriddenProvider = videoOverrides?.baseUrl
|
|
130
|
-
? { ...providerConfig, baseUrl: normalizeProviderBaseUrl(videoOverrides.baseUrl, "--provider-base-url") }
|
|
131
|
-
: providerConfig;
|
|
132
|
-
const overriddenModel = videoOverrides?.model
|
|
133
|
-
? { ...modelConfig, model: videoOverrides.model.trim() }
|
|
134
|
-
: modelConfig;
|
|
135
|
-
if (videoOverrides?.model !== undefined && !overriddenModel.model) {
|
|
136
|
-
throw configRuntimeError("The video provider model cannot be empty.", ["non-empty --provider-model"], ["model: empty"]);
|
|
137
|
-
}
|
|
138
|
-
const resolved = {
|
|
139
|
-
info: {
|
|
140
|
-
task,
|
|
141
|
-
profile,
|
|
142
|
-
provider: modelConfig.provider,
|
|
143
|
-
protocol: overriddenProvider.protocol,
|
|
144
|
-
baseUrl: overriddenProvider.baseUrl,
|
|
145
|
-
model: overriddenModel.model,
|
|
146
|
-
fingerprint: routeFingerprint(task, overriddenProvider, overriddenModel),
|
|
147
|
-
},
|
|
148
|
-
providerConfig: overriddenProvider,
|
|
149
|
-
modelConfig: overriddenModel,
|
|
150
|
-
};
|
|
151
|
-
this.resolvedRoutes.set(task, resolved);
|
|
152
|
-
return resolved;
|
|
153
|
-
}
|
|
154
|
-
route(task) {
|
|
155
|
-
return this.resolve(task).info;
|
|
156
|
-
}
|
|
157
|
-
routes() {
|
|
158
|
-
return LLM_TASK_IDS.map((task) => this.route(task));
|
|
159
|
-
}
|
|
160
|
-
emptyUsage() {
|
|
161
|
-
return {
|
|
162
|
-
calls: 0,
|
|
163
|
-
succeeded: 0,
|
|
164
|
-
failed: 0,
|
|
165
|
-
reused: 0,
|
|
166
|
-
attempts: 0,
|
|
167
|
-
durationMs: 0,
|
|
168
|
-
inputTokens: 0,
|
|
169
|
-
outputTokens: 0,
|
|
170
|
-
cachedInputTokens: 0,
|
|
171
|
-
cacheCreationTokens: 0,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
recordReuse(task) {
|
|
175
|
-
const at = new Date().toISOString();
|
|
176
|
-
this.recordEvent(this.route(task), "reused", at, at, 0, {});
|
|
177
|
-
}
|
|
178
|
-
usage() {
|
|
179
|
-
const aggregate = new Map();
|
|
180
|
-
for (const event of this.usageLog) {
|
|
181
|
-
const key = `${event.task}\u0000${event.provider}\u0000${event.protocol}\u0000${event.model}\u0000${event.fingerprint}`;
|
|
182
|
-
const usage = aggregate.get(key) ?? {
|
|
183
|
-
task: event.task,
|
|
184
|
-
profile: event.profile,
|
|
185
|
-
provider: event.provider,
|
|
186
|
-
protocol: event.protocol,
|
|
187
|
-
baseUrl: event.baseUrl,
|
|
188
|
-
model: event.model,
|
|
189
|
-
fingerprint: event.fingerprint,
|
|
190
|
-
...this.emptyUsage(),
|
|
191
|
-
};
|
|
192
|
-
if (event.status === "reused")
|
|
193
|
-
usage.reused += 1;
|
|
194
|
-
else {
|
|
195
|
-
usage.calls += 1;
|
|
196
|
-
usage[event.status] += 1;
|
|
197
|
-
usage.attempts += event.attempts;
|
|
198
|
-
usage.durationMs += event.durationMs;
|
|
199
|
-
usage.inputTokens += event.inputTokens;
|
|
200
|
-
usage.outputTokens += event.outputTokens;
|
|
201
|
-
usage.cachedInputTokens += event.cachedInputTokens;
|
|
202
|
-
usage.cacheCreationTokens += event.cacheCreationTokens;
|
|
203
|
-
}
|
|
204
|
-
aggregate.set(key, usage);
|
|
205
|
-
}
|
|
206
|
-
return [...aggregate.values()];
|
|
207
|
-
}
|
|
208
|
-
usageEvents() {
|
|
209
|
-
return this.usageLog.map((event) => ({ ...event }));
|
|
210
|
-
}
|
|
211
|
-
recordEvent(route, status, startedAt, endedAt, durationMs, usage, attempts = 0, errorCode) {
|
|
212
|
-
this.usageLog.push({
|
|
213
|
-
...route,
|
|
214
|
-
sequence: this.usageLog.length + 1,
|
|
215
|
-
status,
|
|
216
|
-
attempts,
|
|
217
|
-
startedAt,
|
|
218
|
-
endedAt,
|
|
219
|
-
durationMs,
|
|
220
|
-
inputTokens: usage.inputTokens ?? 0,
|
|
221
|
-
outputTokens: usage.outputTokens ?? 0,
|
|
222
|
-
cachedInputTokens: usage.cachedInputTokens ?? 0,
|
|
223
|
-
cacheCreationTokens: usage.cacheCreationTokens ?? 0,
|
|
224
|
-
...(errorCode ? { errorCode } : {}),
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
async tracked(route, operation) {
|
|
228
|
-
const startedMs = Date.now();
|
|
229
|
-
const startedAt = new Date(startedMs).toISOString();
|
|
230
|
-
try {
|
|
231
|
-
const response = await operation();
|
|
232
|
-
const endedMs = Date.now();
|
|
233
|
-
this.recordEvent(route, "succeeded", startedAt, new Date(endedMs).toISOString(), endedMs - startedMs, response.usage ?? {}, response.attempts);
|
|
234
|
-
return response;
|
|
235
|
-
}
|
|
236
|
-
catch (error) {
|
|
237
|
-
const endedMs = Date.now();
|
|
238
|
-
const transport = error instanceof LlmTransportError ? error : null;
|
|
239
|
-
this.recordEvent(route, "failed", startedAt, new Date(endedMs).toISOString(), endedMs - startedMs, transport?.usage ?? {}, transport?.attempts ?? 1, transport?.code);
|
|
240
|
-
throw error;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
resolveDoubao(task, explicit) {
|
|
244
|
-
const overrides = explicit ? this.options.videoProvider : undefined;
|
|
245
|
-
const modelName = explicit
|
|
246
|
-
? (overrides?.model ?? process.env["ARK_MODEL"] ?? "").trim()
|
|
247
|
-
: this.doubaoModel();
|
|
248
|
-
if (!modelName) {
|
|
249
|
-
throw configRuntimeError("Doubao requires --provider-model or ARK_MODEL.", ["--provider-model <id> or ARK_MODEL"], ["model: empty"]);
|
|
250
|
-
}
|
|
251
|
-
const providerConfig = {
|
|
252
|
-
protocol: "openai-compatible",
|
|
253
|
-
baseUrl: overrides?.baseUrl
|
|
254
|
-
? normalizeProviderBaseUrl(overrides.baseUrl, "--provider-base-url")
|
|
255
|
-
: DOUBAO_FALLBACK.baseUrl,
|
|
256
|
-
apiKeyEnv: DOUBAO_FALLBACK.apiKeyEnv,
|
|
257
|
-
timeoutMs: DOUBAO_FALLBACK.timeoutMs,
|
|
258
|
-
maxAttempts: DOUBAO_FALLBACK.maxAttempts,
|
|
259
|
-
};
|
|
260
|
-
const modelConfig = { provider: "doubao", model: modelName };
|
|
261
|
-
return {
|
|
262
|
-
info: {
|
|
263
|
-
task,
|
|
264
|
-
profile: explicit ? "doubao" : "doubao-fallback",
|
|
265
|
-
provider: "doubao",
|
|
266
|
-
protocol: providerConfig.protocol,
|
|
267
|
-
baseUrl: providerConfig.baseUrl,
|
|
268
|
-
model: modelName,
|
|
269
|
-
fingerprint: routeFingerprint(task, providerConfig, modelConfig),
|
|
270
|
-
},
|
|
271
|
-
providerConfig,
|
|
272
|
-
modelConfig,
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
doubaoRoute(task) {
|
|
276
|
-
return this.resolveDoubao(task, false).info;
|
|
277
|
-
}
|
|
278
|
-
adapter(route) {
|
|
279
|
-
const key = `${route.info.provider}\u0000${route.info.model}\u0000${route.modelConfig.thinkingBudgetTokens ?? ""}`;
|
|
280
|
-
const cached = this.adapters.get(key);
|
|
281
|
-
if (cached)
|
|
282
|
-
return cached;
|
|
283
|
-
const apiKey = (process.env[route.providerConfig.apiKeyEnv] ?? "").trim();
|
|
284
|
-
if (!apiKey)
|
|
285
|
-
throw credentialError(route.info.provider);
|
|
286
|
-
const adapter = route.providerConfig.protocol === "anthropic"
|
|
287
|
-
? new AnthropicModel(route.providerConfig, route.modelConfig, apiKey)
|
|
288
|
-
: new OpenAiCompatibleModel(route.providerConfig, route.modelConfig, apiKey);
|
|
289
|
-
this.adapters.set(key, adapter);
|
|
290
|
-
return adapter;
|
|
291
|
-
}
|
|
292
|
-
videoAdapter(route) {
|
|
293
|
-
if (route.providerConfig.protocol !== "google-gemini") {
|
|
294
|
-
throw configRuntimeError("Video tasks require a google-gemini provider.", ["provider.protocol: google-gemini"], [`provider: ${route.info.provider}`, `protocol: ${route.providerConfig.protocol}`]);
|
|
295
|
-
}
|
|
296
|
-
const modelName = route.info.model;
|
|
297
|
-
const key = `${route.info.provider} ${route.providerConfig.baseUrl ?? "official"} ${modelName}`;
|
|
298
|
-
const cached = this.videoAdapters.get(key);
|
|
299
|
-
if (cached)
|
|
300
|
-
return cached;
|
|
301
|
-
const apiKey = this.videoCredential(route);
|
|
302
|
-
if (!apiKey)
|
|
303
|
-
throw credentialError(route.info.provider);
|
|
304
|
-
const adapter = new GeminiVideoModel(route.providerConfig, route.modelConfig, apiKey);
|
|
305
|
-
this.videoAdapters.set(key, adapter);
|
|
306
|
-
return adapter;
|
|
307
|
-
}
|
|
308
|
-
videoCredential(route) {
|
|
309
|
-
const override = this.options.videoProvider?.apiKey;
|
|
310
|
-
const apiKey = override?.kind === "literal"
|
|
311
|
-
? override.value.trim()
|
|
312
|
-
: override?.kind === "env"
|
|
313
|
-
? (process.env[override.name] ?? "").trim()
|
|
314
|
-
: (process.env[route.providerConfig.apiKeyEnv] ?? "").trim();
|
|
315
|
-
if (!apiKey)
|
|
316
|
-
throw credentialError(route.info.provider);
|
|
317
|
-
return apiKey;
|
|
318
|
-
}
|
|
319
|
-
videoPort(task) {
|
|
320
|
-
const spec = LLM_TASK_REGISTRY[task];
|
|
321
|
-
if (spec.mode !== "video")
|
|
322
|
-
throw configRuntimeError("The task does not support video generation.", ["video task"], [`task: ${task}`]);
|
|
323
|
-
const route = this.resolve(task);
|
|
324
|
-
if (this.options.videoProvider?.provider === "doubao") {
|
|
325
|
-
const adapter = this.doubaoAdapter(route);
|
|
326
|
-
if (!adapter)
|
|
327
|
-
throw credentialError("doubao");
|
|
328
|
-
return {
|
|
329
|
-
prepare: async (localPath, mimeType, mode, signal) => {
|
|
330
|
-
if (mode !== "file-api") {
|
|
331
|
-
throw configRuntimeError("Doubao requires file-api upload mode.", ["file-api"], [mode]);
|
|
332
|
-
}
|
|
333
|
-
signal?.throwIfAborted();
|
|
334
|
-
return { kind: "local", path: localPath, mimeType };
|
|
335
|
-
},
|
|
336
|
-
generate: (request) => {
|
|
337
|
-
if (request.media.kind !== "local") {
|
|
338
|
-
throw configRuntimeError("Doubao requires locally prepared video.", ["local media"], [request.media.kind]);
|
|
339
|
-
}
|
|
340
|
-
request.signal?.throwIfAborted();
|
|
341
|
-
const { path: localPath, mimeType: localMime } = request.media;
|
|
342
|
-
return this.tracked(route.info, () => adapter.run({
|
|
343
|
-
localPath,
|
|
344
|
-
localMime,
|
|
345
|
-
user: request.user,
|
|
346
|
-
fps: request.fps,
|
|
347
|
-
maxOutputTokens: spec.maxOutputTokens,
|
|
348
|
-
...(request.system ? { system: request.system } : {}),
|
|
349
|
-
...(request.responseJsonSchema ? { responseJsonSchema: request.responseJsonSchema } : {}),
|
|
350
|
-
...(request.signal ? { signal: request.signal } : {}),
|
|
351
|
-
}));
|
|
352
|
-
},
|
|
353
|
-
release: async () => { },
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
if (route.providerConfig.protocol !== "google-gemini") {
|
|
357
|
-
throw configRuntimeError("Video tasks require a google-gemini provider.", ["provider.protocol: google-gemini"], [`provider: ${route.info.provider}`, `protocol: ${route.providerConfig.protocol}`]);
|
|
358
|
-
}
|
|
359
|
-
const adapter = this.videoAdapter(route);
|
|
360
|
-
return {
|
|
361
|
-
prepare: async (localPath, mimeType, mode, signal) => {
|
|
362
|
-
const started = Date.now();
|
|
363
|
-
try {
|
|
364
|
-
return await adapter.prepare(localPath, mimeType, mode, signal);
|
|
365
|
-
}
|
|
366
|
-
catch (error) {
|
|
367
|
-
if (!canFallback(error, signal) || !this.doubaoAdapter())
|
|
368
|
-
throw error;
|
|
369
|
-
this.recordEvent(route.info, "failed", new Date(started).toISOString(), new Date().toISOString(), Date.now() - started, error.usage, error.attempts, error.code);
|
|
370
|
-
return { kind: "local-fallback", path: localPath, mimeType, primaryFailure: routedFailure(error, route.info) };
|
|
371
|
-
}
|
|
372
|
-
},
|
|
373
|
-
release: (media, signal) => media.kind === "local-fallback" ? Promise.resolve() : adapter.release(media, signal),
|
|
374
|
-
generate: async (request) => {
|
|
375
|
-
request.signal?.throwIfAborted();
|
|
376
|
-
if (request.media.kind === "local-fallback") {
|
|
377
|
-
return this.generateDoubaoVideo(task, request, [request.media.primaryFailure]);
|
|
378
|
-
}
|
|
379
|
-
const routes = geminiRoutes(route);
|
|
380
|
-
const failures = [];
|
|
381
|
-
for (const [index, candidate] of routes.entries()) {
|
|
382
|
-
request.signal?.throwIfAborted();
|
|
383
|
-
try {
|
|
384
|
-
return await this.tracked(candidate.info, () => this.videoAdapter(candidate).generate({
|
|
385
|
-
...request, maxOutputTokens: spec.maxOutputTokens,
|
|
386
|
-
}));
|
|
387
|
-
}
|
|
388
|
-
catch (error) {
|
|
389
|
-
if (!canFallback(error, request.signal))
|
|
390
|
-
throw error;
|
|
391
|
-
const failure = routedFailure(error, candidate.info);
|
|
392
|
-
failures.push(failure);
|
|
393
|
-
const next = routes[index + 1];
|
|
394
|
-
if (next) {
|
|
395
|
-
process.stderr.write(`↪️ ${candidate.info.model} 请求失败,切换到 ${next.info.model} (${formatFailure(failure)})\n`);
|
|
396
|
-
continue;
|
|
397
|
-
}
|
|
398
|
-
if (!this.doubaoAdapter() || !request.localPath)
|
|
399
|
-
throw exhaustedFailure(error, failures);
|
|
400
|
-
return this.generateDoubaoVideo(task, request, failures);
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
throw new Error("Gemini model routes cannot be empty.");
|
|
404
|
-
},
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
async generateDoubaoVideo(task, request, failures) {
|
|
408
|
-
const adapter = this.doubaoAdapter();
|
|
409
|
-
if (!adapter)
|
|
410
|
-
throw credentialError("doubao");
|
|
411
|
-
const localPath = request.media.kind === "local-fallback" ? request.media.path : request.localPath;
|
|
412
|
-
if (!localPath)
|
|
413
|
-
throw configRuntimeError("Doubao video fallback requires the local video.", ["localPath"], ["localPath: missing"]);
|
|
414
|
-
const localMime = request.localMime ?? (request.media.kind === "file-api" ? request.media.file.mimeType : request.media.mimeType);
|
|
415
|
-
const route = this.doubaoRoute(task);
|
|
416
|
-
process.stderr.write(`↪️ Gemini 路由已耗尽,回退到豆包 ${route.model}\n`);
|
|
417
|
-
try {
|
|
418
|
-
return await this.tracked(route, () => adapter.run({
|
|
419
|
-
localPath, localMime, user: request.user, fps: request.fps,
|
|
420
|
-
maxOutputTokens: LLM_TASK_REGISTRY[task].maxOutputTokens,
|
|
421
|
-
...(request.system ? { system: request.system } : {}),
|
|
422
|
-
...(request.responseJsonSchema ? { responseJsonSchema: request.responseJsonSchema } : {}),
|
|
423
|
-
...(request.signal ? { signal: request.signal } : {}),
|
|
424
|
-
}));
|
|
425
|
-
}
|
|
426
|
-
catch (error) {
|
|
427
|
-
if (!canFallback(error, request.signal))
|
|
428
|
-
throw error;
|
|
429
|
-
throw exhaustedFailure(error, [...failures, routedFailure(error, route)]);
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
// Resolve the default fallback or explicitly selected Doubao video.
|
|
433
|
-
// Overridable in tests to inject a fake Ark client.
|
|
434
|
-
doubaoAdapter(route) {
|
|
435
|
-
return this.arkAdapter(route);
|
|
436
|
-
}
|
|
437
|
-
doubaoTextAdapter() {
|
|
438
|
-
return this.arkAdapter();
|
|
439
|
-
}
|
|
440
|
-
arkAdapter(route) {
|
|
441
|
-
const apiKey = route ? this.videoCredential(route) : (process.env[DOUBAO_FALLBACK.apiKeyEnv] ?? "").trim();
|
|
442
|
-
if (!apiKey)
|
|
443
|
-
return null;
|
|
444
|
-
const model = route?.info.model ?? this.doubaoModel();
|
|
445
|
-
const baseUrl = route?.providerConfig.baseUrl ?? DOUBAO_FALLBACK.baseUrl;
|
|
446
|
-
const key = `doubao ${baseUrl} ${model}`;
|
|
447
|
-
const cached = this.doubaoAdapters.get(key);
|
|
448
|
-
if (cached)
|
|
449
|
-
return cached;
|
|
450
|
-
const adapter = new DoubaoModel(model, DOUBAO_FALLBACK.timeoutMs, DOUBAO_FALLBACK.maxAttempts, apiKey, baseUrl);
|
|
451
|
-
this.doubaoAdapters.set(key, adapter);
|
|
452
|
-
return adapter;
|
|
453
|
-
}
|
|
454
|
-
// Ark endpoint id / model name, ARK_MODEL overriding the account-specific default.
|
|
455
|
-
doubaoModel() {
|
|
456
|
-
return (process.env[DOUBAO_FALLBACK.modelEnv] ?? "").trim() || DOUBAO_FALLBACK.model;
|
|
457
|
-
}
|
|
458
|
-
async withTextFallback(task, signal, generate) {
|
|
459
|
-
const route = this.resolve(task);
|
|
460
|
-
const gemini = isGeminiRoute(route.info);
|
|
461
|
-
const routes = gemini ? geminiRoutes(route) : [route];
|
|
462
|
-
const failures = [];
|
|
463
|
-
for (const [index, candidate] of routes.entries()) {
|
|
464
|
-
signal?.throwIfAborted();
|
|
465
|
-
const adapter = this.adapter(candidate);
|
|
466
|
-
try {
|
|
467
|
-
return await this.tracked(candidate.info, () => generate(adapter));
|
|
468
|
-
}
|
|
469
|
-
catch (error) {
|
|
470
|
-
if (!canFallback(error, signal) || (!gemini && error.code !== "content_filtered"))
|
|
471
|
-
throw error;
|
|
472
|
-
const failure = routedFailure(error, candidate.info);
|
|
473
|
-
failures.push(failure);
|
|
474
|
-
const next = routes[index + 1];
|
|
475
|
-
if (next) {
|
|
476
|
-
process.stderr.write(`↪️ ${candidate.info.model} 请求失败,切换到 ${next.info.model} (${formatFailure(failure)})\n`);
|
|
477
|
-
continue;
|
|
478
|
-
}
|
|
479
|
-
const doubao = this.doubaoTextAdapter();
|
|
480
|
-
if (!doubao)
|
|
481
|
-
throw exhaustedFailure(error, failures);
|
|
482
|
-
const fallback = this.doubaoRoute(task);
|
|
483
|
-
process.stderr.write(`↪️ 主模型路由已耗尽,回退到豆包 ${fallback.model}\n`);
|
|
484
|
-
try {
|
|
485
|
-
return await this.tracked(fallback, () => generate(doubao));
|
|
486
|
-
}
|
|
487
|
-
catch (fallbackError) {
|
|
488
|
-
if (!canFallback(fallbackError, signal))
|
|
489
|
-
throw fallbackError;
|
|
490
|
-
throw exhaustedFailure(fallbackError, [...failures, routedFailure(fallbackError, fallback)]);
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
throw new Error("Text model routes cannot be empty.");
|
|
495
|
-
}
|
|
496
|
-
async generateText(task, request) {
|
|
497
|
-
const spec = LLM_TASK_REGISTRY[task];
|
|
498
|
-
if (spec.mode !== "text")
|
|
499
|
-
throw configRuntimeError("The task does not support text generation.", ["text task"], [`task: ${task}`]);
|
|
500
|
-
return this.withTextFallback(task, request.signal, (adapter) => adapter.generateText({ ...request, maxOutputTokens: spec.maxOutputTokens }));
|
|
501
|
-
}
|
|
502
|
-
async generateTool(task, request) {
|
|
503
|
-
const spec = LLM_TASK_REGISTRY[task];
|
|
504
|
-
if (spec.mode !== "tool")
|
|
505
|
-
throw configRuntimeError("The task does not support tool generation.", ["tool task"], [`task: ${task}`]);
|
|
506
|
-
return this.withTextFallback(task, request.signal, (adapter) => adapter.generateTool({ ...request, maxOutputTokens: spec.maxOutputTokens }));
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
export function createLlmExecutor(explicitConfigPath, options) {
|
|
510
|
-
return new ModelRouter(loadLlmConfig(explicitConfigPath), options);
|
|
511
|
-
}
|
|
512
|
-
//# sourceMappingURL=router.js.map
|