{"_id":"@animastor/ai-analysis","name":"@animastor/ai-analysis","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@animastor/ai-analysis","version":"0.1.0","description":"AI Analysis — semantic analysis layer: structure, character, location, scene, unit analysis and voice authoring. Uses @animastor/ai-agent for the execution mechanism; owns prompts, contracts, and domain-specific analysis logic.","main":"src/index.js","exports":{".":"./src/index.js","./context":"./src/context.js","./tasks/structure-analyzer":"./src/tasks/structure-analyzer/index.js","./tasks/character-analyzer":"./src/tasks/character-analyzer/index.js","./tasks/structure-detector-deterministic":"./src/tasks/structure-detector-deterministic.js"},"scripts":{"test":"mocha test/*.test.js"},"engines":{"node":">=18"},"license":"MIT","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/Animastor/animastor.git","directory":"packages/animastor-ai-analysis"},"bugs":{"url":"https://github.com/Animastor/animastor/issues"},"dependencies":{"@animastor/ai-agent":"^0.1.0","@animastor/vbook-runtime":"^0.1.0"},"devDependencies":{"chai":"^6.2.2","mocha":"^11.7.5"},"_id":"@animastor/ai-analysis@0.1.0","gitHead":"4048c447d881859b9a145ba4455cb6c8349749b6","homepage":"https://github.com/Animastor/animastor#readme","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-X1zHOOd6bdgqOMpznP2ZTegetkosINcjseGsSP9o5Y3c0j4ZKhxpjLHbAVUI67d5CRwOiWU5UDroJE4zDLJu9w==","shasum":"2014b4eb1931064f789e7916867a165b8afe39e9","tarball":"https://registry.npmjs.org/@animastor/ai-analysis/-/ai-analysis-0.1.0.tgz","fileCount":14,"unpackedSize":97030,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC43oEP40FNSzX4SFOAyeH4y86JdFadh2gKJWO5zX/uPwIhAJnXhRXT3IkPxVQ9NrcYt2SYYgTaJ6GYZVfO5SDyoOvc"}]},"_npmUser":{"name":"animastor","email":"admin@animastor.in"},"directories":{},"maintainers":[{"name":"animastor","email":"admin@animastor.in"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ai-analysis_0.1.0_1788926011340_0.3310060519546929"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-09T03:53:31.177Z","0.1.0":"2026-09-09T03:53:31.476Z","modified":"2026-09-09T03:53:31.692Z"},"maintainers":[{"name":"animastor","email":"admin@animastor.in"}],"description":"AI Analysis — semantic analysis layer: structure, character, location, scene, unit analysis and voice authoring. Uses @animastor/ai-agent for the execution mechanism; owns prompts, contracts, and domain-specific analysis logic.","homepage":"https://github.com/Animastor/animastor#readme","repository":{"type":"git","url":"git+https://github.com/Animastor/animastor.git","directory":"packages/animastor-ai-analysis"},"bugs":{"url":"https://github.com/Animastor/animastor/issues"},"license":"MIT","readme":"# @animastor/ai-analysis\n\nSemantic analysis layer for the Animastor book pipeline — structure, character, location, scene, unit analysis and voice authoring.\n\nUses `@animastor/ai-agent` for the execution mechanism; owns prompts, contracts, and domain-specific analysis logic.\n\n## What this is\n\nThis package provides all AI analysis tasks:\n\n| Task | Feature | Description |\n|---|---|---|\n| `analyzeBookStructure` | F1/F6 | Structure/chapter analysis with deterministic fallback |\n| `extractCharacters` | F2 | Character extraction from text |\n| `generateVoices` | F7 | Voice description authoring for characters |\n| `extractLocations` | F3 | Location extraction from text |\n| `createScenes` | F4 | Scene analysis and splitting |\n| `createUnits` | F5 | Unit decomposition from scenes |\n\nPlus shared utilities:\n- `buildLocationsContext` — prompt-context builder for location data\n- `assertHostPorts` — re-exported from `@animastor/ai-agent` for convenience\n\n## Installation\n\n```bash\nnpm install @animastor/ai-analysis\n```\n\nRequires Node.js >= 18. Depends on `@animastor/ai-agent` and `@animastor/vbook-runtime`.\n\n## Usage\n\n```js\nconst {\n    analyzeBookStructure,\n    extractCharacters,\n    extractLocations,\n    createScenes,\n    createUnits,\n    generateVoices,\n} = require('@animastor/ai-analysis');\n\n// All tasks follow the execute() lifecycle from @animastor/ai-agent.\n// They require host-injected ports (callAI, session management, etc.)\nconst structure = await analyzeBookStructure(input, ports);\nconst characters = await extractCharacters(input, ports);\n```\n\n## Subpath exports\n\n| Import path | Module |\n|---|---|\n| `@animastor/ai-analysis` | Main barrel (all tasks + utilities) |\n| `@animastor/ai-analysis/context` | `buildLocationsContext` prompt-context builder |\n| `@animastor/ai-analysis/tasks/structure-analyzer` | Structure analysis task + AI merge |\n| `@animastor/ai-analysis/tasks/character-analyzer` | Character extraction + voice authoring |\n| `@animastor/ai-analysis/tasks/structure-detector-deterministic` | Deterministic structure detector (fallback) |\n\n## Dependency direction\n\n```\n@animastor/ai-agent          (pure mechanism)\n        ↑\n@animastor/ai-analysis       (semantic tasks)\n        ↑\nbackend / host               (composition + persistence)\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-d57d9ffc8002f4474fc28c4f319b86c3"}