akari-video 0.1.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/LICENSE +21 -0
- package/README.md +81 -0
- package/bin/akari.mjs +14 -0
- package/package.json +42 -0
- package/src/cli.mjs +140 -0
- package/src/messages.mjs +100 -0
- package/src/path-lookup.mjs +47 -0
- package/src/project-state.mjs +25 -0
- package/src/repo-assets.mjs +59 -0
- package/src/task-labels.mjs +30 -0
- package/src/update-check.mjs +189 -0
- package/vendor/packages/project-scaffold/package.json +11 -0
- package/vendor/packages/project-scaffold/src/index.mjs +523 -0
- package/vendor/packages/project-scaffold/test/create-project.test.mjs +81 -0
- package/vendor/packages/project-scaffold/test/skill-adapter-link.test.mjs +204 -0
- package/vendor/packages/schemas/analysis.schema.json +475 -0
- package/vendor/packages/schemas/asset-meta.schema.json +225 -0
- package/vendor/packages/schemas/avatar-rendition.schema.json +65 -0
- package/vendor/packages/schemas/avatar.schema.json +178 -0
- package/vendor/packages/schemas/bin/validate-asset.mjs +597 -0
- package/vendor/packages/schemas/bin/validate-avatar.mjs +486 -0
- package/vendor/packages/schemas/bin/validate-captions.mjs +316 -0
- package/vendor/packages/schemas/bin/validate-connections.mjs +295 -0
- package/vendor/packages/schemas/bin/validate-edit.mjs +766 -0
- package/vendor/packages/schemas/bin/validate-intake.mjs +185 -0
- package/vendor/packages/schemas/bin/validate-interpretation.mjs +515 -0
- package/vendor/packages/schemas/bin/validate-plan-comments.mjs +170 -0
- package/vendor/packages/schemas/bin/validate-plan.mjs +365 -0
- package/vendor/packages/schemas/bin/validate-recipe.mjs +267 -0
- package/vendor/packages/schemas/bin/validate-research-plan.mjs +510 -0
- package/vendor/packages/schemas/bin/validate-review.mjs +427 -0
- package/vendor/packages/schemas/captions.schema.json +141 -0
- package/vendor/packages/schemas/connections.schema.json +153 -0
- package/vendor/packages/schemas/edit.schema.json +437 -0
- package/vendor/packages/schemas/examples/analysis-person-matte-valid/analysis.json +18 -0
- package/vendor/packages/schemas/examples/captions-text-style-background-mode-invalid/captions.json +18 -0
- package/vendor/packages/schemas/examples/captions-text-style-color-non-hex-invalid/captions.json +14 -0
- package/vendor/packages/schemas/examples/captions-text-style-default-only-valid/captions.json +27 -0
- package/vendor/packages/schemas/examples/captions-text-style-omitted-valid/captions.json +11 -0
- package/vendor/packages/schemas/examples/captions-text-style-opacity-out-of-range-invalid/captions.json +8 -0
- package/vendor/packages/schemas/examples/captions-text-style-record-override-valid/captions.json +27 -0
- package/vendor/packages/schemas/examples/captions-text-style-size-non-positive-invalid/captions.json +14 -0
- package/vendor/packages/schemas/examples/captions-text-style-zone-invalid/captions.json +16 -0
- package/vendor/packages/schemas/examples/connections-v0-invalid-auth/connections.json +32 -0
- package/vendor/packages/schemas/examples/connections-v0-memory-valid/connections.json +42 -0
- package/vendor/packages/schemas/examples/edit-beats-duplicate-id/edit.json +11 -0
- package/vendor/packages/schemas/examples/edit-beats-invalid-id/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-beats-missing-kind/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-beats-strength-out-of-range/edit.json +11 -0
- package/vendor/packages/schemas/examples/edit-beats-v0-src-present/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-beats-v0-valid/edit.json +29 -0
- package/vendor/packages/schemas/examples/edit-beats-v1-src-missing-reference/edit.json +14 -0
- package/vendor/packages/schemas/examples/edit-beats-v1-valid/edit.json +37 -0
- package/vendor/packages/schemas/examples/edit-bgm-ducking-invalid/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-bgm-fade-invalid/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-bgm-fade-valid/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-bgm-in-invalid/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-bgm-in-valid/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-bgm-missing-path/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-bgm-null-valid/edit.json +11 -0
- package/vendor/packages/schemas/examples/edit-bgm-sfx-gain-out-of-range/edit.json +11 -0
- package/vendor/packages/schemas/examples/edit-bgm-sfx-valid/edit.json +23 -0
- package/vendor/packages/schemas/examples/edit-chroma-key-invalid/edit.json +7 -0
- package/vendor/packages/schemas/examples/edit-cuts-at-negative-invalid/edit.json +7 -0
- package/vendor/packages/schemas/examples/edit-cuts-at-track-valid/edit.json +20 -0
- package/vendor/packages/schemas/examples/edit-cuts-opacity-out-of-range-invalid/edit.json +16 -0
- package/vendor/packages/schemas/examples/edit-cuts-track-invalid/edit.json +7 -0
- package/vendor/packages/schemas/examples/edit-cuts-transform-full-valid/edit.json +17 -0
- package/vendor/packages/schemas/examples/edit-cuts-transform-omitted-valid/edit.json +9 -0
- package/vendor/packages/schemas/examples/edit-cuts-transform-partial-valid/edit.json +16 -0
- package/vendor/packages/schemas/examples/edit-cuts-transform-rotate-invalid/edit.json +16 -0
- package/vendor/packages/schemas/examples/edit-cuts-transform-scale-invalid/edit.json +16 -0
- package/vendor/packages/schemas/examples/edit-cuts-transform-unknown-key-invalid/edit.json +16 -0
- package/vendor/packages/schemas/examples/edit-direction-intensity-negative/edit.json +8 -0
- package/vendor/packages/schemas/examples/edit-direction-intensity-not-integer/edit.json +8 -0
- package/vendor/packages/schemas/examples/edit-direction-intensity-out-of-range/edit.json +8 -0
- package/vendor/packages/schemas/examples/edit-direction-missing-preset/edit.json +8 -0
- package/vendor/packages/schemas/examples/edit-direction-overrides-array/edit.json +8 -0
- package/vendor/packages/schemas/examples/edit-direction-preset-only/edit.json +8 -0
- package/vendor/packages/schemas/examples/edit-direction-valid/edit.json +8 -0
- package/vendor/packages/schemas/examples/edit-emphasis-words-empty-word/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-emphasis-words-invalid-id/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-emphasis-words-missing-emotion/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-emphasis-words-range-invalid/edit.json +11 -0
- package/vendor/packages/schemas/examples/edit-emphasis-words-v0-src-present/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-emphasis-words-v0-valid/edit.json +32 -0
- package/vendor/packages/schemas/examples/edit-emphasis-words-v1-valid/edit.json +39 -0
- package/vendor/packages/schemas/examples/edit-layers-invalid-bad-blend/edit.json +17 -0
- package/vendor/packages/schemas/examples/edit-layers-invalid-chroma-key-on-baked/edit.json +17 -0
- package/vendor/packages/schemas/examples/edit-layers-invalid-duplicate-id/edit.json +11 -0
- package/vendor/packages/schemas/examples/edit-layers-track-invalid/edit.json +8 -0
- package/vendor/packages/schemas/examples/edit-layers-valid/edit.json +31 -0
- package/vendor/packages/schemas/examples/edit-look-invalid/edit.json +7 -0
- package/vendor/packages/schemas/examples/edit-master-invalid/edit.json +8 -0
- package/vendor/packages/schemas/examples/edit-narration-gain-out-of-range/edit.json +18 -0
- package/vendor/packages/schemas/examples/edit-narration-invalid-id/edit.json +17 -0
- package/vendor/packages/schemas/examples/edit-narration-missing-provenance/edit.json +16 -0
- package/vendor/packages/schemas/examples/edit-narration-valid/edit.json +36 -0
- package/vendor/packages/schemas/examples/edit-narration-voicevox-missing-credit/edit.json +20 -0
- package/vendor/packages/schemas/examples/edit-render-basics-valid/edit.json +22 -0
- package/vendor/packages/schemas/examples/edit-sfx-in-invalid/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-sfx-in-out-valid/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-sfx-out-invalid/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-sfx-out-type-invalid/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-sfx-t-invalid/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-sfx-track-invalid/edit.json +8 -0
- package/vendor/packages/schemas/examples/edit-speed-invalid/edit.json +7 -0
- package/vendor/packages/schemas/examples/edit-timeline-declared-valid/edit.json +14 -0
- package/vendor/packages/schemas/examples/edit-timeline-duplicate-id-invalid/edit.json +13 -0
- package/vendor/packages/schemas/examples/edit-timeline-interleaved-valid/edit.json +22 -0
- package/vendor/packages/schemas/examples/edit-timeline-omitted-valid/edit.json +7 -0
- package/vendor/packages/schemas/examples/edit-timeline-ref-invalid/edit.json +13 -0
- package/vendor/packages/schemas/examples/edit-tracks-section-invalid/edit.json +8 -0
- package/vendor/packages/schemas/examples/edit-tracks-section-valid/edit.json +13 -0
- package/vendor/packages/schemas/examples/edit-transition-invalid/edit.json +10 -0
- package/vendor/packages/schemas/examples/edit-v0-sample/edit.json +27 -0
- package/vendor/packages/schemas/examples/edit-v0-sample/overlays/cap-a.html +17 -0
- package/vendor/packages/schemas/examples/edit-v0-sample/overlays/cap-b.html +17 -0
- package/vendor/packages/schemas/examples/edit-v1-bgm-sfx-valid/edit.json +13 -0
- package/vendor/packages/schemas/examples/edit-v1-sample/edit.json +14 -0
- package/vendor/packages/schemas/examples/plan-comments-v0-sample/plan-comments.json +19 -0
- package/vendor/packages/schemas/examples/plan-v0-sample/plan.json +39 -0
- package/vendor/packages/schemas/examples/recipe-v0-sample/product-demo-quick-cuts.json +23 -0
- package/vendor/packages/schemas/examples/review-v1-sample/review.json +11 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-avatar-md-136-lines/AVATAR.md +159 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-avatar-md-136-lines/avatar.json +22 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-avatar-md-136-lines/renditions/2d-bustup/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-avatar-md-136-lines/renditions/2d-bustup/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-avatar-md-136-lines/renditions/2d-bustup/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-avatar-md-136-lines/renditions/2d-bustup/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-avatar-md-136-lines/renditions/2d-bustup/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-avatar-md-136-lines/renditions/2d-fullbody/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-avatar-md-136-lines/renditions/2d-fullbody/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-avatar-md-136-lines/renditions/2d-fullbody/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-avatar-md-136-lines/renditions/2d-fullbody/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-avatar-md-136-lines/renditions/2d-fullbody/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-default-role/AVATAR.md +30 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-default-role/avatar.json +22 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-default-role/renditions/2d-bustup/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-default-role/renditions/2d-bustup/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-default-role/renditions/2d-bustup/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-default-role/renditions/2d-bustup/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-default-role/renditions/2d-bustup/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-default-role/renditions/2d-fullbody/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-default-role/renditions/2d-fullbody/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-default-role/renditions/2d-fullbody/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-default-role/renditions/2d-fullbody/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-default-role/renditions/2d-fullbody/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-energy-out-of-range/AVATAR.md +30 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-energy-out-of-range/avatar.json +22 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-energy-out-of-range/renditions/2d-bustup/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-energy-out-of-range/renditions/2d-bustup/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-energy-out-of-range/renditions/2d-bustup/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-energy-out-of-range/renditions/2d-bustup/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-energy-out-of-range/renditions/2d-bustup/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-energy-out-of-range/renditions/2d-fullbody/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-energy-out-of-range/renditions/2d-fullbody/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-energy-out-of-range/renditions/2d-fullbody/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-energy-out-of-range/renditions/2d-fullbody/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-energy-out-of-range/renditions/2d-fullbody/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-asset/AVATAR.md +30 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-asset/avatar.json +22 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-asset/renditions/2d-bustup/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-asset/renditions/2d-bustup/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-asset/renditions/2d-bustup/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-asset/renditions/2d-bustup/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-asset/renditions/2d-fullbody/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-asset/renditions/2d-fullbody/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-asset/renditions/2d-fullbody/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-asset/renditions/2d-fullbody/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-asset/renditions/2d-fullbody/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-rights/AVATAR.md +30 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-rights/avatar.json +21 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-rights/renditions/2d-bustup/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-rights/renditions/2d-bustup/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-rights/renditions/2d-bustup/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-rights/renditions/2d-bustup/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-rights/renditions/2d-bustup/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-rights/renditions/2d-fullbody/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-rights/renditions/2d-fullbody/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-rights/renditions/2d-fullbody/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-rights/renditions/2d-fullbody/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-missing-rights/renditions/2d-fullbody/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-no-avatar-json/AVATAR.md +30 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-in-catalog/catalog/avatars/impostor/AVATAR.md +30 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-in-catalog/catalog/avatars/impostor/avatar.json +22 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-in-catalog/catalog/avatars/impostor/renditions/2d-bustup/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-in-catalog/catalog/avatars/impostor/renditions/2d-bustup/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-in-catalog/catalog/avatars/impostor/renditions/2d-bustup/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-in-catalog/catalog/avatars/impostor/renditions/2d-bustup/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-in-catalog/catalog/avatars/impostor/renditions/2d-bustup/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-in-catalog/catalog/avatars/impostor/renditions/2d-fullbody/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-in-catalog/catalog/avatars/impostor/renditions/2d-fullbody/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-in-catalog/catalog/avatars/impostor/renditions/2d-fullbody/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-in-catalog/catalog/avatars/impostor/renditions/2d-fullbody/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-in-catalog/catalog/avatars/impostor/renditions/2d-fullbody/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-sellable/AVATAR.md +30 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-sellable/avatar.json +22 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-sellable/renditions/2d-bustup/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-sellable/renditions/2d-bustup/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-sellable/renditions/2d-bustup/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-sellable/renditions/2d-bustup/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-sellable/renditions/2d-bustup/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-sellable/renditions/2d-fullbody/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-sellable/renditions/2d-fullbody/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-sellable/renditions/2d-fullbody/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-sellable/renditions/2d-fullbody/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/invalid-person-sellable/renditions/2d-fullbody/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/unsupported-version/AVATAR.md +30 -0
- package/vendor/packages/schemas/fixtures/avatar/unsupported-version/avatar.json +22 -0
- package/vendor/packages/schemas/fixtures/avatar/unsupported-version/renditions/2d-bustup/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/unsupported-version/renditions/2d-bustup/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/unsupported-version/renditions/2d-bustup/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/unsupported-version/renditions/2d-bustup/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/unsupported-version/renditions/2d-bustup/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/unsupported-version/renditions/2d-fullbody/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/unsupported-version/renditions/2d-fullbody/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/unsupported-version/renditions/2d-fullbody/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/unsupported-version/renditions/2d-fullbody/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/unsupported-version/renditions/2d-fullbody/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/valid/AVATAR.md +30 -0
- package/vendor/packages/schemas/fixtures/avatar/valid/avatar.json +22 -0
- package/vendor/packages/schemas/fixtures/avatar/valid/renditions/2d-bustup/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid/renditions/2d-bustup/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid/renditions/2d-bustup/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid/renditions/2d-bustup/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid/renditions/2d-bustup/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/valid/renditions/2d-fullbody/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid/renditions/2d-fullbody/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid/renditions/2d-fullbody/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid/renditions/2d-fullbody/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid/renditions/2d-fullbody/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/valid-unknown-fields/AVATAR.md +30 -0
- package/vendor/packages/schemas/fixtures/avatar/valid-unknown-fields/avatar.json +23 -0
- package/vendor/packages/schemas/fixtures/avatar/valid-unknown-fields/renditions/2d-bustup/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid-unknown-fields/renditions/2d-bustup/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid-unknown-fields/renditions/2d-bustup/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid-unknown-fields/renditions/2d-bustup/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid-unknown-fields/renditions/2d-bustup/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/valid-unknown-fields/renditions/2d-fullbody/happy.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid-unknown-fields/renditions/2d-fullbody/neutral-half.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid-unknown-fields/renditions/2d-fullbody/neutral-open.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid-unknown-fields/renditions/2d-fullbody/neutral.png +0 -0
- package/vendor/packages/schemas/fixtures/avatar/valid-unknown-fields/renditions/2d-fullbody/rendition.json +18 -0
- package/vendor/packages/schemas/fixtures/avatar/valid-voice-only/AVATAR.md +28 -0
- package/vendor/packages/schemas/fixtures/avatar/valid-voice-only/avatar.json +19 -0
- package/vendor/packages/schemas/fixtures/intake/invalid-duplicate-task/intake.json +8 -0
- package/vendor/packages/schemas/fixtures/intake/invalid-missing-submitted-at/intake.json +8 -0
- package/vendor/packages/schemas/fixtures/intake/invalid-target-exclusive/intake.json +8 -0
- package/vendor/packages/schemas/fixtures/intake/invalid-unknown-task/intake.json +8 -0
- package/vendor/packages/schemas/fixtures/intake/valid-draft/intake.json +8 -0
- package/vendor/packages/schemas/fixtures/intake/valid-submitted/intake.json +8 -0
- package/vendor/packages/schemas/fixtures/plan/invalid-bad-confidence-enum/plan.json +15 -0
- package/vendor/packages/schemas/fixtures/plan/invalid-constraint-bad-applies-to/plan.json +18 -0
- package/vendor/packages/schemas/fixtures/plan/invalid-dangling-media-path/plan.json +15 -0
- package/vendor/packages/schemas/fixtures/plan/invalid-duplicate-slot-id/plan.json +25 -0
- package/vendor/packages/schemas/fixtures/plan/invalid-missing-required-field/plan.json +14 -0
- package/vendor/packages/schemas/fixtures/plan/unsupported-version/plan.json +4 -0
- package/vendor/packages/schemas/fixtures/plan/valid/plan.json +40 -0
- package/vendor/packages/schemas/fixtures/plan/valid/scaffold/beat-01.png +1 -0
- package/vendor/packages/schemas/fixtures/plan/valid/scaffold/beat-01.wav +1 -0
- package/vendor/packages/schemas/fixtures/plan/valid/scaffold/broll.mp4 +1 -0
- package/vendor/packages/schemas/fixtures/plan/warns-confidence-gap/plan.json +28 -0
- package/vendor/packages/schemas/fixtures/plan-comments/invalid-bad-pass/plan-comments.json +6 -0
- package/vendor/packages/schemas/fixtures/plan-comments/invalid-bad-target-id-for-index-kind/plan-comments.json +13 -0
- package/vendor/packages/schemas/fixtures/plan-comments/invalid-bad-target-kind/plan-comments.json +13 -0
- package/vendor/packages/schemas/fixtures/plan-comments/invalid-comments-not-array/plan-comments.json +6 -0
- package/vendor/packages/schemas/fixtures/plan-comments/invalid-missing-comment-field/plan-comments.json +12 -0
- package/vendor/packages/schemas/fixtures/plan-comments/invalid-missing-version/plan-comments.json +5 -0
- package/vendor/packages/schemas/fixtures/plan-comments/unsupported-version/plan-comments.json +6 -0
- package/vendor/packages/schemas/fixtures/plan-comments/valid/plan-comments.json +19 -0
- package/vendor/packages/schemas/fixtures/plan-comments/valid-unknown-fields/plan-comments.json +15 -0
- package/vendor/packages/schemas/fixtures/recipe/invalid-bad-aspect/recipe.json +13 -0
- package/vendor/packages/schemas/fixtures/recipe/invalid-bad-confirmed-by/recipe.json +13 -0
- package/vendor/packages/schemas/fixtures/recipe/invalid-bad-name-casing/recipe.json +13 -0
- package/vendor/packages/schemas/fixtures/recipe/invalid-bad-workflow/recipe.json +13 -0
- package/vendor/packages/schemas/fixtures/recipe/invalid-duplicate-overlay-kind/recipe.json +13 -0
- package/vendor/packages/schemas/fixtures/recipe/invalid-empty-confirmed/recipe.json +9 -0
- package/vendor/packages/schemas/fixtures/recipe/invalid-empty-narration/recipe.json +13 -0
- package/vendor/packages/schemas/fixtures/recipe/invalid-missing-version/recipe.json +12 -0
- package/vendor/packages/schemas/fixtures/recipe/invalid-provenance-mismatch/recipe.json +15 -0
- package/vendor/packages/schemas/fixtures/recipe/invalid-source-project-path/recipe.json +13 -0
- package/vendor/packages/schemas/fixtures/recipe/unsupported-version/recipe.json +13 -0
- package/vendor/packages/schemas/fixtures/recipe/valid/recipe.json +15 -0
- package/vendor/packages/schemas/fixtures/recipe/valid-unknown-fields/recipe.json +16 -0
- package/vendor/packages/schemas/fixtures/review/invalid-malformed-canvas-target/review.json +6 -0
- package/vendor/packages/schemas/fixtures/review/invalid-malformed-doc-target/review.json +6 -0
- package/vendor/packages/schemas/fixtures/review/invalid-malformed-image-target/review.json +6 -0
- package/vendor/packages/schemas/fixtures/review/invalid-strokes-bad-space/review.json +6 -0
- package/vendor/packages/schemas/fixtures/review/invalid-strokes-canvas-rect-with-frame/review.json +6 -0
- package/vendor/packages/schemas/fixtures/review/invalid-strokes-image-rect-with-frame/review.json +6 -0
- package/vendor/packages/schemas/fixtures/review/invalid-video-null-sourcet/review.json +6 -0
- package/vendor/packages/schemas/fixtures/review/valid/review.json +8 -0
- package/vendor/packages/schemas/fixtures/review/valid-canvas-target/review.json +7 -0
- package/vendor/packages/schemas/fixtures/review/valid-input-session/review.json +6 -0
- package/vendor/packages/schemas/fixtures/review/valid-strokes/review.json +8 -0
- package/vendor/packages/schemas/intake.schema.json +117 -0
- package/vendor/packages/schemas/interpretation.schema.json +419 -0
- package/vendor/packages/schemas/package.json +18 -0
- package/vendor/packages/schemas/plan-comments.schema.json +52 -0
- package/vendor/packages/schemas/plan.schema.json +129 -0
- package/vendor/packages/schemas/recipe.schema.json +106 -0
- package/vendor/packages/schemas/research-plan.schema.json +230 -0
- package/vendor/packages/schemas/review.schema.json +227 -0
- package/vendor/packages/schemas/test/fixtures/asset/invalid-matched-by/audio/whoosh-transition/meta.json +31 -0
- package/vendor/packages/schemas/test/fixtures/asset/valid-catalog/audio/whoosh-transition/meta.json +31 -0
- package/vendor/packages/schemas/test/fixtures/asset/valid-library/telop/lower-third-clean/fragment.html +139 -0
- package/vendor/packages/schemas/test/fixtures/asset/valid-library/telop/lower-third-clean/meta.json +32 -0
- package/vendor/packages/schemas/test/fixtures/asset/valid-library/telop/lower-third-clean/preview.png +0 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-analyses-missing-ref/interpretation.json +131 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-analyses-ref-mismatch/interpretation.json +132 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-arc-empty-refs/interpretation.json +126 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-context-missing-interview/interpretation.json +126 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-context-null-intake/interpretation.json +133 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-dangling-arc-ref/interpretation.json +132 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-duplicate-asset-ref/interpretation.json +132 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-flag-bad-type/interpretation.json +132 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-flag-missing-evidence/interpretation.json +131 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-missing-required-field/interpretation.json +131 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-open-question-answer-present-when-open/interpretation.json +133 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-open-question-answered-without-answer/interpretation.json +131 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-relations-dangling-target/interpretation.json +132 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-relations-self-reference/interpretation.json +132 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-section-end-before-start/interpretation.json +132 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-section-mismatched-start-end/interpretation.json +131 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/invalid-unknown-root-field/interpretation.json +133 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/unsupported-version/interpretation.json +132 -0
- package/vendor/packages/schemas/test/fixtures/interpretation/valid/interpretation.json +132 -0
- package/vendor/packages/schemas/test/fixtures/research-plan/invalid-bad-category-enum/research-plan.json +128 -0
- package/vendor/packages/schemas/test/fixtures/research-plan/invalid-dangling-chapter-ref/research-plan.json +128 -0
- package/vendor/packages/schemas/test/fixtures/research-plan/invalid-dangling-shot-list-ref/research-plan.json +128 -0
- package/vendor/packages/schemas/test/fixtures/research-plan/invalid-decided-at-mismatch/research-plan.json +128 -0
- package/vendor/packages/schemas/test/fixtures/research-plan/invalid-duplicate-candidate-id/research-plan.json +128 -0
- package/vendor/packages/schemas/test/fixtures/research-plan/invalid-japan-sns-notes-empty/research-plan.json +128 -0
- package/vendor/packages/schemas/test/fixtures/research-plan/invalid-missing-required-field/research-plan.json +127 -0
- package/vendor/packages/schemas/test/fixtures/research-plan/invalid-selected-missing-candidate/research-plan.json +128 -0
- package/vendor/packages/schemas/test/fixtures/research-plan/invalid-structure-confirmed-mismatch/research-plan.json +128 -0
- package/vendor/packages/schemas/test/fixtures/research-plan/unsupported-version/research-plan.json +128 -0
- package/vendor/packages/schemas/test/fixtures/research-plan/valid/research-plan.json +79 -0
- package/vendor/packages/schemas/test/fixtures/research-plan/warns-empty-sources/research-plan.json +120 -0
- package/vendor/packages/schemas/test/validate-asset.test.mjs +38 -0
- package/vendor/packages/schemas/test/validate-avatar.test.mjs +109 -0
- package/vendor/packages/schemas/test/validate-captions.test.mjs +59 -0
- package/vendor/packages/schemas/test/validate-connections.test.mjs +31 -0
- package/vendor/packages/schemas/test/validate-edit.test.mjs +490 -0
- package/vendor/packages/schemas/test/validate-intake.test.mjs +66 -0
- package/vendor/packages/schemas/test/validate-interpretation.test.mjs +167 -0
- package/vendor/packages/schemas/test/validate-plan-comments.test.mjs +70 -0
- package/vendor/packages/schemas/test/validate-plan.test.mjs +67 -0
- package/vendor/packages/schemas/test/validate-recipe.test.mjs +107 -0
- package/vendor/packages/schemas/test/validate-research-plan.test.mjs +98 -0
- package/vendor/packages/schemas/test/validate-review.test.mjs +102 -0
- package/vendor/skills/.gitkeep +0 -0
- package/vendor/skills/address-review/SKILL.md +84 -0
- package/vendor/skills/address-review/bin/core/review-store.mjs +210 -0
- package/vendor/skills/address-review/bin/list.mjs +198 -0
- package/vendor/skills/address-review/bin/respond.mjs +89 -0
- package/vendor/skills/address-review/dev-fixtures/fixture-project/captions.json +22 -0
- package/vendor/skills/address-review/dev-fixtures/fixture-project/edit.json +12 -0
- package/vendor/skills/address-review/dev-fixtures/fixture-project/review.json +100 -0
- package/vendor/skills/address-review/test/review-store.test.mjs +201 -0
- package/vendor/skills/analyze-footage/SKILL.md +35 -0
- package/vendor/skills/analyze-footage/analysis-json.md +185 -0
- package/vendor/skills/analyze-footage/bin/person-matte/person-matte-helper.swift +343 -0
- package/vendor/skills/analyze-footage/bin/person-matte/person-matte.mjs +415 -0
- package/vendor/skills/analyze-footage/bin/speechanalyzer-helper.swift +138 -0
- package/vendor/skills/analyze-footage/bin/transcribe-cloud.mjs +486 -0
- package/vendor/skills/analyze-footage/bin/transcribe-sa.mjs +189 -0
- package/vendor/skills/analyze-footage/events-and-hooks.md +93 -0
- package/vendor/skills/analyze-footage/keyframes-and-review.md +130 -0
- package/vendor/skills/analyze-footage/media-and-transcript.md +219 -0
- package/vendor/skills/analyze-footage/person-matte.md +121 -0
- package/vendor/skills/analyze-footage/references/akari-data-contract.md +18 -0
- package/vendor/skills/analyze-footage/references/asset.meta.example.json +23 -0
- package/vendor/skills/analyze-footage/test/fixtures/scribe-punctuation-inflation.json +17 -0
- package/vendor/skills/analyze-footage/test/normalize-scribe.test.mjs +76 -0
- package/vendor/skills/analyze-footage/workflow.md +95 -0
- package/vendor/skills/analyze-project/SKILL.md +58 -0
- package/vendor/skills/analyze-project/collect.md +51 -0
- package/vendor/skills/analyze-project/decision-record.md +55 -0
- package/vendor/skills/analyze-project/interpretation.md +128 -0
- package/vendor/skills/analyze-project/interview.md +66 -0
- package/vendor/skills/analyze-project/references/interpretation-shape.md +42 -0
- package/vendor/skills/analyze-project/references/open-questions-examples.md +35 -0
- package/vendor/skills/analyze-project/validate-and-render.md +66 -0
- package/vendor/skills/bake-3d/SKILL.md +78 -0
- package/vendor/skills/compile-review-session/SKILL.md +78 -0
- package/vendor/skills/compile-review-session/bin/compile-review-session.mjs +799 -0
- package/vendor/skills/compile-review-session/bin/core/canvas-compiler.mjs +105 -0
- package/vendor/skills/compile-review-session/bin/core/compiler.mjs +221 -0
- package/vendor/skills/compile-review-session/bin/core/review-store.mjs +74 -0
- package/vendor/skills/compile-review-session/bin/core/time-mapping.mjs +370 -0
- package/vendor/skills/compile-review-session/bin/core/transcription.mjs +721 -0
- package/vendor/skills/compile-review-session/compilation-rules.md +98 -0
- package/vendor/skills/compile-review-session/dev-fixtures/README.md +24 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0001/audio.wav +0 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0001/edit.snapshot.json +12 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0001/events.jsonl +2 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0001/session.json +11 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0002/audio.wav +0 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0002/edit.snapshot.json +12 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0002/events.jsonl +5 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0002/session.json +11 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0003/audio.wav +0 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0003/edit.snapshot.json +12 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0003/events.jsonl +19 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0003/session.json +11 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0004/audio.wav +0 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0004/edit.snapshot.json +12 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0004/events.jsonl +2 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0004/session.json +11 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0005/session.json +1 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0006/audio.wav +0 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0006/events.jsonl +2 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0006/session.json +11 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0007/audio.wav +0 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0007/edit.snapshot.json +13 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0007/events.jsonl +9 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0007/session.json +11 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0008/audio.wav +0 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0008/edit.snapshot.json +12 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0008/events.jsonl +2 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0008/session.json +11 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review/sessions/s-0008/transcript.json +9 -0
- package/vendor/skills/compile-review-session/dev-fixtures/fixture-project/review.json +7 -0
- package/vendor/skills/compile-review-session/test/canvas-compiler.test.mjs +283 -0
- package/vendor/skills/compile-review-session/test/compiler.test.mjs +458 -0
- package/vendor/skills/create-project/SKILL.md +46 -0
- package/vendor/skills/create-project/bin/create-project.mjs +88 -0
- package/vendor/skills/edit-lint/SKILL.md +73 -0
- package/vendor/skills/edit-plan/SKILL.md +64 -0
- package/vendor/skills/edit-plan/approvals-and-generation.md +106 -0
- package/vendor/skills/edit-plan/avatar-resolution.md +241 -0
- package/vendor/skills/edit-plan/beat-sync.md +545 -0
- package/vendor/skills/edit-plan/beats.md +197 -0
- package/vendor/skills/edit-plan/emphasis-detection.md +366 -0
- package/vendor/skills/edit-plan/execution.md +157 -0
- package/vendor/skills/edit-plan/expression-selection.md +290 -0
- package/vendor/skills/edit-plan/plan-json.md +52 -0
- package/vendor/skills/edit-plan/recipe.md +74 -0
- package/vendor/skills/edit-plan/references/asset.decisions.example.json +12 -0
- package/vendor/skills/edit-plan/references/event.example.json +7 -0
- package/vendor/skills/edit-plan/report-guide.md +192 -0
- package/vendor/skills/edit-plan/workflow.md +108 -0
- package/vendor/skills/generate-narration/SKILL.md +40 -0
- package/vendor/skills/generate-narration/assets/reading-script-v1.md +18 -0
- package/vendor/skills/generate-narration/avatar-voice.md +54 -0
- package/vendor/skills/generate-narration/bin/generate-narration.mjs +572 -0
- package/vendor/skills/generate-narration/engines.md +78 -0
- package/vendor/skills/generate-narration/reading-text.md +36 -0
- package/vendor/skills/generate-narration/voice-profile-setup.md +77 -0
- package/vendor/skills/harvest-asset/SKILL.md +132 -0
- package/vendor/skills/manage-connections/SKILL.md +75 -0
- package/vendor/skills/manage-connections/bin/doctor.mjs +341 -0
- package/vendor/skills/overlay-authoring/3d.md +143 -0
- package/vendor/skills/overlay-authoring/SKILL.md +30 -0
- package/vendor/skills/overlay-authoring/motion.md +58 -0
- package/vendor/skills/overlay-authoring/table.md +41 -0
- package/vendor/skills/overlay-authoring/telop.md +69 -0
- package/vendor/skills/overlay-authoring/text-behind-person.md +224 -0
- package/vendor/skills/overlay-authoring/thumbnail.md +126 -0
- package/vendor/skills/render-cut/SKILL.md +66 -0
- package/vendor/skills/research-plan/SKILL.md +75 -0
- package/vendor/skills/research-plan/competitor.md +50 -0
- package/vendor/skills/research-plan/ideate.md +56 -0
- package/vendor/skills/research-plan/shotlist.md +46 -0
- package/vendor/skills/research-plan/storyboard.md +48 -0
- package/vendor/skills/research-plan/trends.md +33 -0
- package/vendor/skills/setup-audio-library/SKILL.md +93 -0
- package/vendor/skills/setup-audio-library/candidate-list.md +72 -0
- package/vendor/skills/setup-audio-library/drop-folder.md +72 -0
- package/vendor/skills/setup-audio-library/gallery.md +43 -0
- package/vendor/skills/setup-library/SKILL.md +33 -0
- package/vendor/skills/setup-library/fetch-and-validate.md +102 -0
- package/vendor/skills/setup-library/starter-pack.md +55 -0
- package/vendor/skills/setup-library/tools-check.md +83 -0
- package/vendor/skills/verify/SKILL.md +137 -0
- package/vendor/templates/project-default/.akari/cache/.gitkeep +0 -0
- package/vendor/templates/project-default/.akari/connections.json +233 -0
- package/vendor/templates/project-default/.akari/diffs/.gitkeep +1 -0
- package/vendor/templates/project-default/.akari/events/.gitkeep +1 -0
- package/vendor/templates/project-default/.akari/reports/.gitkeep +0 -0
- package/vendor/templates/project-default/.akari/sidecars/.gitkeep +1 -0
- package/vendor/templates/project-default/.akari/work/.gitkeep +0 -0
- package/vendor/templates/project-default/.akari/workflow.json +48 -0
- package/vendor/templates/project-default/.claude/settings.json +15 -0
- package/vendor/templates/project-default/.claude/skills/README.md +26 -0
- package/vendor/templates/project-default/AGENTS.md +49 -0
- package/vendor/templates/project-default/CLAUDE.md +35 -0
- package/vendor/templates/project-default/assets/.gitkeep +1 -0
- package/vendor/templates/project-default/exports/.gitkeep +1 -0
- package/vendor/templates/project-default/planning/.gitkeep +1 -0
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// person-matte.mjs — 人物マット(VP9 alpha WebM)を 1 本作るラッパー
|
|
4
|
+
//
|
|
5
|
+
// 3 プロセスを繋いだだけの薄い層である。
|
|
6
|
+
// ffmpeg(デコード: 回転補正・幅統一・fps 統一) → person-matte-helper(Vision で人物を抜く)
|
|
7
|
+
// → ffmpeg(エンコード: VP9 alpha WebM)
|
|
8
|
+
// 中間ファイル(PNG 連番など)を作らず、raw BGRA のまま繋ぐ。
|
|
9
|
+
//
|
|
10
|
+
// 契約: docs/contract-2026-07-23-analysis-person-matte.md
|
|
11
|
+
// 手順: ../../person-matte.md(人物演出を使う素材でだけ実行する任意工程)
|
|
12
|
+
//
|
|
13
|
+
// 使い方:
|
|
14
|
+
// node person-matte.mjs --check
|
|
15
|
+
// node person-matte.mjs --input <video> --out <matte.webm>
|
|
16
|
+
// [--quality fast|balanced|accurate] [--fps 24] [--decode-width 1280]
|
|
17
|
+
//
|
|
18
|
+
// 出力は stdout の 1 行 JSON。成功時 `ok: true` と実測値、失敗時 `ok: false` と `reason`。
|
|
19
|
+
// 外部 npm 依存ゼロ・ネットワーク禁止(edit-lint と同じ規律)。
|
|
20
|
+
|
|
21
|
+
import fs from "node:fs";
|
|
22
|
+
import os from "node:os";
|
|
23
|
+
import path from "node:path";
|
|
24
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
25
|
+
import { fileURLToPath } from "node:url";
|
|
26
|
+
|
|
27
|
+
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
|
28
|
+
const helperSource = path.join(scriptDir, "person-matte-helper.swift");
|
|
29
|
+
const defaultHelperBin = path.join(scriptDir, "person-matte-helper");
|
|
30
|
+
|
|
31
|
+
// スパイク実測(2026-07-23)で確定した既定値。入力解像度は Vision の速度にほぼ無関係
|
|
32
|
+
// (quality ごとに内部で固定リサイズされる)ため、デコード幅は 1280 で統一する。
|
|
33
|
+
const DEFAULT_DECODE_WIDTH = 1280;
|
|
34
|
+
const DEFAULT_FPS = 24;
|
|
35
|
+
const DEFAULT_QUALITY = "balanced";
|
|
36
|
+
const QUALITIES = ["fast", "balanced", "accurate"];
|
|
37
|
+
const TOOL_ID = "vision-person-segmentation";
|
|
38
|
+
|
|
39
|
+
function printJson(value) {
|
|
40
|
+
process.stdout.write(`${JSON.stringify(value)}\n`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function summarize(value, fallback) {
|
|
44
|
+
const text = String(value ?? "").replace(/\s+/g, " ").trim();
|
|
45
|
+
return text ? text.slice(0, 500) : fallback;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function spawnSyncSafe(command, args) {
|
|
49
|
+
try {
|
|
50
|
+
return spawnSync(command, args, { encoding: "utf8" });
|
|
51
|
+
} catch (error) {
|
|
52
|
+
return { error };
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function checkAvailability() {
|
|
57
|
+
if (os.platform() !== "darwin") {
|
|
58
|
+
return { available: false, reason: `macOS ではありません(${os.platform()})` };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const swift = spawnSyncSafe("swiftc", ["-version"]);
|
|
62
|
+
if (swift.error?.code === "ENOENT") {
|
|
63
|
+
return { available: false, reason: "swiftc が PATH 上にありません" };
|
|
64
|
+
}
|
|
65
|
+
if (swift.error || swift.status !== 0) {
|
|
66
|
+
return { available: false, reason: "swiftc を起動できません" };
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
for (const command of ["ffmpeg", "ffprobe"]) {
|
|
70
|
+
const probe = spawnSyncSafe(command, ["-version"]);
|
|
71
|
+
if (probe.error?.code === "ENOENT") {
|
|
72
|
+
return { available: false, reason: `${command} が PATH 上にありません` };
|
|
73
|
+
}
|
|
74
|
+
if (probe.error || probe.status !== 0) {
|
|
75
|
+
return { available: false, reason: `${command} を起動できません` };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// VP9 alpha WebM を書けるかは libvpx-vp9 の有無で決まる(ffmpeg 内蔵の vp9 エンコーダは別物)。
|
|
80
|
+
const encoders = spawnSyncSafe("ffmpeg", ["-hide_banner", "-encoders"]);
|
|
81
|
+
if (encoders.error || encoders.status !== 0) {
|
|
82
|
+
return { available: false, reason: "ffmpeg -encoders を取得できません" };
|
|
83
|
+
}
|
|
84
|
+
if (!String(encoders.stdout ?? "").includes("libvpx-vp9")) {
|
|
85
|
+
return { available: false, reason: "ffmpeg に libvpx-vp9 エンコーダがありません" };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return { available: true };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function parseArguments(argv) {
|
|
92
|
+
const result = {
|
|
93
|
+
check: false,
|
|
94
|
+
input: null,
|
|
95
|
+
out: null,
|
|
96
|
+
quality: DEFAULT_QUALITY,
|
|
97
|
+
fps: DEFAULT_FPS,
|
|
98
|
+
decodeWidth: DEFAULT_DECODE_WIDTH,
|
|
99
|
+
helperBin: defaultHelperBin,
|
|
100
|
+
};
|
|
101
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
102
|
+
const argument = argv[index];
|
|
103
|
+
if (argument === "--check") {
|
|
104
|
+
result.check = true;
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const value = argv[index + 1];
|
|
108
|
+
if (!value || value.startsWith("--")) throw new Error(`${argument} の値がありません`);
|
|
109
|
+
index += 1;
|
|
110
|
+
switch (argument) {
|
|
111
|
+
case "--input":
|
|
112
|
+
result.input = path.resolve(value);
|
|
113
|
+
break;
|
|
114
|
+
case "--out":
|
|
115
|
+
result.out = path.resolve(value);
|
|
116
|
+
break;
|
|
117
|
+
case "--helper-bin":
|
|
118
|
+
result.helperBin = path.resolve(value);
|
|
119
|
+
break;
|
|
120
|
+
case "--quality":
|
|
121
|
+
result.quality = value;
|
|
122
|
+
break;
|
|
123
|
+
case "--fps":
|
|
124
|
+
result.fps = Number(value);
|
|
125
|
+
break;
|
|
126
|
+
case "--decode-width":
|
|
127
|
+
result.decodeWidth = Number(value);
|
|
128
|
+
break;
|
|
129
|
+
default:
|
|
130
|
+
throw new Error(`不明な引数です: ${argument}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (!QUALITIES.includes(result.quality)) {
|
|
134
|
+
throw new Error(`--quality は ${QUALITIES.join(" / ")} のいずれかです`);
|
|
135
|
+
}
|
|
136
|
+
if (!Number.isFinite(result.fps) || result.fps <= 0 || result.fps > 240) {
|
|
137
|
+
throw new Error("--fps は 0 より大きく 240 以下の数値です");
|
|
138
|
+
}
|
|
139
|
+
if (!Number.isFinite(result.decodeWidth) || result.decodeWidth < 16) {
|
|
140
|
+
throw new Error("--decode-width は 16 以上の数値です");
|
|
141
|
+
}
|
|
142
|
+
return result;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function needsBuild(helperBin) {
|
|
146
|
+
const sourceStat = fs.statSync(helperSource);
|
|
147
|
+
try {
|
|
148
|
+
return fs.statSync(helperBin).mtimeMs < sourceStat.mtimeMs;
|
|
149
|
+
} catch (error) {
|
|
150
|
+
if (error?.code === "ENOENT") return true;
|
|
151
|
+
throw error;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function buildHelper(helperBin) {
|
|
156
|
+
if (!needsBuild(helperBin)) return null;
|
|
157
|
+
const result = spawnSyncSafe("swiftc", ["-O", "-parse-as-library", helperSource, "-o", helperBin]);
|
|
158
|
+
if (result.error || result.status !== 0) {
|
|
159
|
+
return summarize(
|
|
160
|
+
result.stderr,
|
|
161
|
+
result.error?.code === "ENOENT" ? "swiftc が PATH 上にありません" : "終了コードが 0 ではありません",
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function ffprobeJson(args) {
|
|
168
|
+
const result = spawnSyncSafe("ffprobe", ["-v", "error", ...args, "-of", "json"]);
|
|
169
|
+
if (result.error || result.status !== 0) {
|
|
170
|
+
throw new Error(summarize(result.stderr, "ffprobe に失敗しました"));
|
|
171
|
+
}
|
|
172
|
+
try {
|
|
173
|
+
return JSON.parse(String(result.stdout ?? ""));
|
|
174
|
+
} catch {
|
|
175
|
+
throw new Error("ffprobe の出力が JSON ではありません");
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/// 素材の表示上の寸法(回転を反映した幅・高さ)と尺を得る。
|
|
180
|
+
function probeSource(input) {
|
|
181
|
+
const probed = ffprobeJson([
|
|
182
|
+
"-select_streams",
|
|
183
|
+
"v:0",
|
|
184
|
+
"-show_entries",
|
|
185
|
+
"stream=width,height,r_frame_rate,duration:stream_side_data=rotation:format=duration",
|
|
186
|
+
input,
|
|
187
|
+
]);
|
|
188
|
+
const stream = probed?.streams?.[0];
|
|
189
|
+
if (!stream) throw new Error("映像ストリームが見つかりません");
|
|
190
|
+
const width = Number(stream.width);
|
|
191
|
+
const height = Number(stream.height);
|
|
192
|
+
if (!Number.isInteger(width) || !Number.isInteger(height) || width <= 0 || height <= 0) {
|
|
193
|
+
throw new Error("映像ストリームの寸法を取得できません");
|
|
194
|
+
}
|
|
195
|
+
// ffmpeg はデコード時に回転を自動補正するため、90 度系の回転がある素材では
|
|
196
|
+
// フィルタへ入る時点で幅と高さが入れ替わっている。
|
|
197
|
+
const rotation = Number(
|
|
198
|
+
(Array.isArray(stream.side_data_list) ? stream.side_data_list : []).find((entry) =>
|
|
199
|
+
Number.isFinite(Number(entry?.rotation)),
|
|
200
|
+
)?.rotation ?? 0,
|
|
201
|
+
);
|
|
202
|
+
const quarterTurns = Math.abs(Math.round(rotation / 90)) % 2;
|
|
203
|
+
const duration = Number(stream.duration ?? probed?.format?.duration ?? Number.NaN);
|
|
204
|
+
return {
|
|
205
|
+
width: quarterTurns === 1 ? height : width,
|
|
206
|
+
height: quarterTurns === 1 ? width : height,
|
|
207
|
+
rotation,
|
|
208
|
+
duration: Number.isFinite(duration) ? duration : null,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/// 偶数へ丸めた出力寸法。入力より大きくは伸ばさない(Vision の品質は入力解像度に依存しない)。
|
|
213
|
+
function outputSize(source, decodeWidth) {
|
|
214
|
+
const width = Math.max(16, Math.floor(Math.min(decodeWidth, source.width) / 2) * 2);
|
|
215
|
+
const height = Math.max(16, Math.floor((source.height / source.width) * width / 2) * 2);
|
|
216
|
+
return { width, height };
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function stage(name, command, args, stdio) {
|
|
220
|
+
const child = spawn(command, args, { stdio });
|
|
221
|
+
const chunks = [];
|
|
222
|
+
child.stderr?.on("data", (chunk) => chunks.push(chunk));
|
|
223
|
+
const exited = new Promise((resolve) => {
|
|
224
|
+
child.once("error", (error) => resolve({ name, code: null, error }));
|
|
225
|
+
child.once("close", (code, signal) => resolve({ name, code, signal }));
|
|
226
|
+
});
|
|
227
|
+
return { name, child, exited, stderr: () => Buffer.concat(chunks).toString("utf8") };
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
async function generate(options) {
|
|
231
|
+
const source = probeSource(options.input);
|
|
232
|
+
const size = outputSize(source, options.decodeWidth);
|
|
233
|
+
const metricsPath = path.join(
|
|
234
|
+
os.tmpdir(),
|
|
235
|
+
`person-matte-metrics-${process.pid}-${Date.now()}.json`,
|
|
236
|
+
);
|
|
237
|
+
fs.mkdirSync(path.dirname(options.out), { recursive: true });
|
|
238
|
+
|
|
239
|
+
const decoder = stage(
|
|
240
|
+
"decode",
|
|
241
|
+
"ffmpeg",
|
|
242
|
+
[
|
|
243
|
+
"-hide_banner", "-nostdin", "-loglevel", "error",
|
|
244
|
+
"-i", options.input,
|
|
245
|
+
"-map", "0:v:0",
|
|
246
|
+
"-vf", `scale=${size.width}:${size.height}:flags=bicubic`,
|
|
247
|
+
"-r", String(options.fps),
|
|
248
|
+
"-f", "rawvideo", "-pix_fmt", "bgra", "-",
|
|
249
|
+
],
|
|
250
|
+
["ignore", "pipe", "pipe"],
|
|
251
|
+
);
|
|
252
|
+
const helper = stage(
|
|
253
|
+
"segment",
|
|
254
|
+
options.helperBin,
|
|
255
|
+
[
|
|
256
|
+
"--width", String(size.width),
|
|
257
|
+
"--height", String(size.height),
|
|
258
|
+
"--quality", options.quality,
|
|
259
|
+
"--metrics", metricsPath,
|
|
260
|
+
],
|
|
261
|
+
["pipe", "pipe", "pipe"],
|
|
262
|
+
);
|
|
263
|
+
const encoder = stage(
|
|
264
|
+
"encode",
|
|
265
|
+
"ffmpeg",
|
|
266
|
+
[
|
|
267
|
+
"-hide_banner", "-loglevel", "error",
|
|
268
|
+
"-f", "rawvideo", "-pix_fmt", "bgra",
|
|
269
|
+
"-s", `${size.width}x${size.height}`,
|
|
270
|
+
"-r", String(options.fps),
|
|
271
|
+
"-i", "-",
|
|
272
|
+
"-an",
|
|
273
|
+
// VP9 alpha WebM。yuva420p が alpha_mode=1 のコンテナを作る唯一の経路であり、
|
|
274
|
+
// -auto-alt-ref 0 は alpha 付き libvpx-vp9 で必要(alt-ref フレームと併用できない)。
|
|
275
|
+
// この工程が全体の壁時計時間を支配するため row-mt で並列化する(実測 143s → 75s)。
|
|
276
|
+
"-c:v", "libvpx-vp9", "-pix_fmt", "yuva420p",
|
|
277
|
+
"-b:v", "0", "-crf", "30", "-auto-alt-ref", "0",
|
|
278
|
+
"-row-mt", "1", "-threads", "4",
|
|
279
|
+
"-y", options.out,
|
|
280
|
+
],
|
|
281
|
+
["pipe", "ignore", "pipe"],
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
// 途中の段が先に落ちたときの EPIPE で Node ごと落ちないようにする。
|
|
285
|
+
for (const stream of [decoder.child.stdout, helper.child.stdin, helper.child.stdout, encoder.child.stdin]) {
|
|
286
|
+
stream?.on("error", () => {});
|
|
287
|
+
}
|
|
288
|
+
decoder.child.stdout?.pipe(helper.child.stdin);
|
|
289
|
+
helper.child.stdout?.pipe(encoder.child.stdin);
|
|
290
|
+
|
|
291
|
+
const startedAt = Date.now();
|
|
292
|
+
const results = await Promise.all([decoder.exited, helper.exited, encoder.exited]);
|
|
293
|
+
const elapsedSeconds = (Date.now() - startedAt) / 1000;
|
|
294
|
+
|
|
295
|
+
const stderrOf = { decode: decoder.stderr(), segment: helper.stderr(), encode: encoder.stderr() };
|
|
296
|
+
for (const result of results) {
|
|
297
|
+
if (result.error?.code === "ENOENT") {
|
|
298
|
+
throw new Error(`${result.name} を起動できません(${result.error.path ?? "不明なコマンド"})`);
|
|
299
|
+
}
|
|
300
|
+
if (result.error || result.code !== 0) {
|
|
301
|
+
throw new Error(
|
|
302
|
+
`${result.name} が失敗しました: ${summarize(stderrOf[result.name] || result.error?.message, `終了コード ${result.code}`)}`,
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
let metrics = null;
|
|
308
|
+
try {
|
|
309
|
+
metrics = JSON.parse(fs.readFileSync(metricsPath, "utf8"));
|
|
310
|
+
fs.rmSync(metricsPath, { force: true });
|
|
311
|
+
} catch {
|
|
312
|
+
throw new Error("ヘルパーの実測値を読み取れません");
|
|
313
|
+
}
|
|
314
|
+
if (!metrics || metrics.frames <= 0) {
|
|
315
|
+
throw new Error("フレームを 1 枚も処理していません");
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const verified = verifyOutput(options.out);
|
|
319
|
+
return {
|
|
320
|
+
ok: true,
|
|
321
|
+
path: options.out,
|
|
322
|
+
// analysis.json へ貼る形。path は analysis.json のディレクトリ基準へ書き換えること。
|
|
323
|
+
person_matte: {
|
|
324
|
+
path: options.out,
|
|
325
|
+
fps: options.fps,
|
|
326
|
+
quality: options.quality,
|
|
327
|
+
generated_at: new Date().toISOString(),
|
|
328
|
+
tool: TOOL_ID,
|
|
329
|
+
},
|
|
330
|
+
source: { path: options.input, ...source },
|
|
331
|
+
width: size.width,
|
|
332
|
+
height: size.height,
|
|
333
|
+
frames: metrics.frames,
|
|
334
|
+
bytes: fs.statSync(options.out).size,
|
|
335
|
+
elapsed_seconds: elapsedSeconds,
|
|
336
|
+
realtime_ratio: source.duration ? elapsedSeconds / source.duration : null,
|
|
337
|
+
vision_ms_per_frame: metrics.vision_ms_per_frame,
|
|
338
|
+
mask_size: { width: metrics.mask_width, height: metrics.mask_height },
|
|
339
|
+
alpha_transparent_ratio: metrics.alpha_transparent_ratio,
|
|
340
|
+
alpha_partial_ratio: metrics.alpha_partial_ratio,
|
|
341
|
+
probe: verified,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/// 書き出した WebM が本当に VP9 かつアルファ付きかを ffprobe で確かめる。
|
|
346
|
+
/// ffmpeg 自身は VP9 の alpha レイヤをデコードできない(pix_fmt は yuv420p と報告される)ので、
|
|
347
|
+
/// アルファの有無はコンテナの alpha_mode タグで判定する。
|
|
348
|
+
function verifyOutput(out) {
|
|
349
|
+
const probed = ffprobeJson([
|
|
350
|
+
"-select_streams",
|
|
351
|
+
"v:0",
|
|
352
|
+
"-show_entries",
|
|
353
|
+
"stream=codec_name,width,height,r_frame_rate,nb_frames:stream_tags=alpha_mode:format=duration",
|
|
354
|
+
out,
|
|
355
|
+
]);
|
|
356
|
+
const stream = probed?.streams?.[0];
|
|
357
|
+
if (!stream) throw new Error("書き出した WebM に映像ストリームがありません");
|
|
358
|
+
if (stream.codec_name !== "vp9") {
|
|
359
|
+
throw new Error(`書き出した WebM の codec が vp9 ではありません(${stream.codec_name})`);
|
|
360
|
+
}
|
|
361
|
+
if (String(stream.tags?.alpha_mode ?? "") !== "1") {
|
|
362
|
+
throw new Error("書き出した WebM に alpha_mode=1 がありません(アルファが落ちています)");
|
|
363
|
+
}
|
|
364
|
+
return {
|
|
365
|
+
codec_name: stream.codec_name,
|
|
366
|
+
alpha_mode: String(stream.tags.alpha_mode),
|
|
367
|
+
width: Number(stream.width),
|
|
368
|
+
height: Number(stream.height),
|
|
369
|
+
r_frame_rate: stream.r_frame_rate,
|
|
370
|
+
nb_frames: stream.nb_frames ? Number(stream.nb_frames) : null,
|
|
371
|
+
duration: probed?.format?.duration ? Number(probed.format.duration) : null,
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
async function main() {
|
|
376
|
+
let options;
|
|
377
|
+
try {
|
|
378
|
+
options = parseArguments(process.argv.slice(2));
|
|
379
|
+
} catch (error) {
|
|
380
|
+
printJson({ ok: false, reason: summarize(error?.message, "引数が不正です") });
|
|
381
|
+
process.exitCode = 2;
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
const availability = checkAvailability();
|
|
386
|
+
if (options.check) {
|
|
387
|
+
printJson(availability);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
if (!options.input || !options.out) {
|
|
391
|
+
printJson({ ok: false, reason: "--input と --out が必要です" });
|
|
392
|
+
process.exitCode = 2;
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
if (!availability.available) {
|
|
396
|
+
printJson({ ok: false, ...availability });
|
|
397
|
+
process.exitCode = 1;
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
try {
|
|
402
|
+
const buildError = buildHelper(options.helperBin);
|
|
403
|
+
if (buildError) {
|
|
404
|
+
printJson({ ok: false, reason: `swiftc build failed: ${buildError}` });
|
|
405
|
+
process.exitCode = 1;
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
printJson(await generate(options));
|
|
409
|
+
} catch (error) {
|
|
410
|
+
printJson({ ok: false, reason: summarize(error?.message, "人物マットの生成に失敗しました") });
|
|
411
|
+
process.exitCode = 1;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
await main();
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import AVFoundation
|
|
2
|
+
import CoreMedia
|
|
3
|
+
import Foundation
|
|
4
|
+
import Speech
|
|
5
|
+
|
|
6
|
+
struct Word: Codable {
|
|
7
|
+
let text: String
|
|
8
|
+
let start: Double
|
|
9
|
+
let end: Double
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
struct Segment: Codable {
|
|
13
|
+
let text: String
|
|
14
|
+
let start: Double
|
|
15
|
+
let end: Double
|
|
16
|
+
let words: [Word]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
struct Output: Codable {
|
|
20
|
+
let engine: String
|
|
21
|
+
let locale: String
|
|
22
|
+
let input: String
|
|
23
|
+
let assetStatusBefore: String
|
|
24
|
+
let assetStatusAfter: String
|
|
25
|
+
let assetInstallationSeconds: Double
|
|
26
|
+
let transcript: String
|
|
27
|
+
let segments: [Segment]
|
|
28
|
+
let words: [Word]
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
func statusName(_ status: AssetInventory.Status) -> String {
|
|
32
|
+
switch status {
|
|
33
|
+
case .unsupported: return "unsupported"
|
|
34
|
+
case .supported: return "supported"
|
|
35
|
+
case .downloading: return "downloading"
|
|
36
|
+
case .installed: return "installed"
|
|
37
|
+
@unknown default: return "unknown"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
func seconds(_ time: CMTime) -> Double {
|
|
42
|
+
let value = CMTimeGetSeconds(time)
|
|
43
|
+
return value.isFinite ? value : 0
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@main
|
|
47
|
+
struct SpeechAnalyzerHelper {
|
|
48
|
+
static func main() async {
|
|
49
|
+
do {
|
|
50
|
+
guard #available(macOS 26.0, *) else {
|
|
51
|
+
throw NSError(domain: "SpeechAnalyzerHelper", code: 1,
|
|
52
|
+
userInfo: [NSLocalizedDescriptionKey: "macOS 26 or later is required"])
|
|
53
|
+
}
|
|
54
|
+
guard CommandLine.arguments.count == 2 else {
|
|
55
|
+
throw NSError(domain: "SpeechAnalyzerHelper", code: 2,
|
|
56
|
+
userInfo: [NSLocalizedDescriptionKey: "usage: speechanalyzer-helper INPUT_AUDIO"])
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let inputPath = CommandLine.arguments[1]
|
|
60
|
+
let locale = Locale(identifier: "ja-JP")
|
|
61
|
+
guard SpeechTranscriber.isAvailable else {
|
|
62
|
+
throw NSError(domain: "SpeechAnalyzerHelper", code: 3,
|
|
63
|
+
userInfo: [NSLocalizedDescriptionKey: "SpeechTranscriber is unavailable"])
|
|
64
|
+
}
|
|
65
|
+
let supportedLocale = await SpeechTranscriber.supportedLocale(equivalentTo: locale) ?? locale
|
|
66
|
+
|
|
67
|
+
let transcriber = SpeechTranscriber(
|
|
68
|
+
locale: supportedLocale,
|
|
69
|
+
transcriptionOptions: [],
|
|
70
|
+
reportingOptions: [],
|
|
71
|
+
attributeOptions: [.audioTimeRange]
|
|
72
|
+
)
|
|
73
|
+
let modules: [any SpeechModule] = [transcriber]
|
|
74
|
+
let statusBefore = await AssetInventory.status(forModules: modules)
|
|
75
|
+
let installStart = ContinuousClock.now
|
|
76
|
+
if statusBefore != .installed {
|
|
77
|
+
guard let request = try await AssetInventory.assetInstallationRequest(supporting: modules) else {
|
|
78
|
+
throw NSError(domain: "SpeechAnalyzerHelper", code: 5,
|
|
79
|
+
userInfo: [NSLocalizedDescriptionKey: "Speech model installation request unavailable"])
|
|
80
|
+
}
|
|
81
|
+
try await request.downloadAndInstall()
|
|
82
|
+
}
|
|
83
|
+
let installDuration = ContinuousClock.now - installStart
|
|
84
|
+
let installationSeconds = Double(installDuration.components.seconds)
|
|
85
|
+
+ Double(installDuration.components.attoseconds) / 1_000_000_000_000_000_000
|
|
86
|
+
let statusAfter = await AssetInventory.status(forModules: modules)
|
|
87
|
+
|
|
88
|
+
let audioFile = try AVAudioFile(forReading: URL(fileURLWithPath: inputPath))
|
|
89
|
+
let analyzer = SpeechAnalyzer(modules: modules)
|
|
90
|
+
var segments: [Segment] = []
|
|
91
|
+
|
|
92
|
+
async let analysis: Void = {
|
|
93
|
+
try await analyzer.start(inputAudioFile: audioFile, finishAfterFile: true)
|
|
94
|
+
}()
|
|
95
|
+
|
|
96
|
+
for try await result in transcriber.results {
|
|
97
|
+
guard result.isFinal else { continue }
|
|
98
|
+
var words: [Word] = []
|
|
99
|
+
for run in result.text.runs {
|
|
100
|
+
guard let timeRange = run.audioTimeRange else { continue }
|
|
101
|
+
let text = String(result.text[run.range].characters)
|
|
102
|
+
guard !text.isEmpty else { continue }
|
|
103
|
+
let start = seconds(timeRange.start)
|
|
104
|
+
let end = seconds(CMTimeRangeGetEnd(timeRange))
|
|
105
|
+
guard end > start else { continue }
|
|
106
|
+
words.append(Word(text: text, start: start, end: end))
|
|
107
|
+
}
|
|
108
|
+
let text = String(result.text.characters)
|
|
109
|
+
let start = seconds(result.range.start)
|
|
110
|
+
let end = seconds(CMTimeRangeGetEnd(result.range))
|
|
111
|
+
segments.append(Segment(text: text, start: start, end: end, words: words))
|
|
112
|
+
}
|
|
113
|
+
try await analysis
|
|
114
|
+
|
|
115
|
+
segments.sort { $0.start < $1.start }
|
|
116
|
+
let allWords = segments.flatMap(\.words).sorted { $0.start < $1.start }
|
|
117
|
+
let transcript = segments.map(\.text).joined(separator: "\n")
|
|
118
|
+
let output = Output(
|
|
119
|
+
engine: "macOS SpeechAnalyzer/SpeechTranscriber",
|
|
120
|
+
locale: supportedLocale.identifier,
|
|
121
|
+
input: URL(fileURLWithPath: inputPath).lastPathComponent,
|
|
122
|
+
assetStatusBefore: statusName(statusBefore),
|
|
123
|
+
assetStatusAfter: statusName(statusAfter),
|
|
124
|
+
assetInstallationSeconds: installationSeconds,
|
|
125
|
+
transcript: transcript,
|
|
126
|
+
segments: segments,
|
|
127
|
+
words: allWords
|
|
128
|
+
)
|
|
129
|
+
let encoder = JSONEncoder()
|
|
130
|
+
encoder.outputFormatting = [.prettyPrinted, .sortedKeys, .withoutEscapingSlashes]
|
|
131
|
+
FileHandle.standardOutput.write(try encoder.encode(output))
|
|
132
|
+
FileHandle.standardOutput.write(Data("\n".utf8))
|
|
133
|
+
} catch {
|
|
134
|
+
FileHandle.standardError.write(Data("SpeechAnalyzerHelper error: \(error)\n".utf8))
|
|
135
|
+
Foundation.exit(1)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|