@hexagen-monaco/sync 0.4.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 +33 -0
- package/README.md +181 -0
- package/dist/application/index.d.ts +3 -0
- package/dist/application/index.d.ts.map +1 -0
- package/dist/application/ports/index.d.ts +2 -0
- package/dist/application/ports/index.d.ts.map +1 -0
- package/dist/application/ports/out/architecture-graph-provider.port.d.ts +6 -0
- package/dist/application/ports/out/architecture-graph-provider.port.d.ts.map +1 -0
- package/dist/application/ports/out/file-system.port.d.ts +22 -0
- package/dist/application/ports/out/file-system.port.d.ts.map +1 -0
- package/dist/application/ports/out/generator-config.port.d.ts +51 -0
- package/dist/application/ports/out/generator-config.port.d.ts.map +1 -0
- package/dist/application/ports/out/index.d.ts +9 -0
- package/dist/application/ports/out/index.d.ts.map +1 -0
- package/dist/application/ports/out/linter-report-provider.port.d.ts +6 -0
- package/dist/application/ports/out/linter-report-provider.port.d.ts.map +1 -0
- package/dist/application/ports/out/ownership-registry.port.d.ts +35 -0
- package/dist/application/ports/out/ownership-registry.port.d.ts.map +1 -0
- package/dist/application/ports/out/project-configuration-read.port.d.ts +9 -0
- package/dist/application/ports/out/project-configuration-read.port.d.ts.map +1 -0
- package/dist/application/ports/out/symbol-reference-provider.port.d.ts +10 -0
- package/dist/application/ports/out/symbol-reference-provider.port.d.ts.map +1 -0
- package/dist/application/ports/out/workspace-file-provider.port.d.ts +14 -0
- package/dist/application/ports/out/workspace-file-provider.port.d.ts.map +1 -0
- package/dist/application/use-cases/get-architecture-graph.use-case.d.ts +8 -0
- package/dist/application/use-cases/get-architecture-graph.use-case.d.ts.map +1 -0
- package/dist/application/use-cases/get-linter-report.use-case.d.ts +8 -0
- package/dist/application/use-cases/get-linter-report.use-case.d.ts.map +1 -0
- package/dist/application/use-cases/get-manifest-resource.use-case.d.ts +8 -0
- package/dist/application/use-cases/get-manifest-resource.use-case.d.ts.map +1 -0
- package/dist/application/use-cases/index.d.ts +4 -0
- package/dist/application/use-cases/index.d.ts.map +1 -0
- package/dist/application/use-cases/refactoring-impact.use-case.d.ts +29 -0
- package/dist/application/use-cases/refactoring-impact.use-case.d.ts.map +1 -0
- package/dist/application/use-cases/stub-generation.use-case.d.ts +23 -0
- package/dist/application/use-cases/stub-generation.use-case.d.ts.map +1 -0
- package/dist/arch-linter-bin.d.ts +20 -0
- package/dist/arch-linter-bin.d.ts.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +12149 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add/index.d.ts +8 -0
- package/dist/commands/add/index.d.ts.map +1 -0
- package/dist/commands/add/validate.d.ts +2 -0
- package/dist/commands/add/validate.d.ts.map +1 -0
- package/dist/commands/arch/add.d.ts +3 -0
- package/dist/commands/arch/add.d.ts.map +1 -0
- package/dist/commands/arch/context/command.d.ts +4 -0
- package/dist/commands/arch/context/command.d.ts.map +1 -0
- package/dist/commands/arch/context/persistence.d.ts +22 -0
- package/dist/commands/arch/context/persistence.d.ts.map +1 -0
- package/dist/commands/arch/context/wizard.d.ts +7 -0
- package/dist/commands/arch/context/wizard.d.ts.map +1 -0
- package/dist/commands/arch/diff.d.ts +3 -0
- package/dist/commands/arch/diff.d.ts.map +1 -0
- package/dist/commands/arch/edit.d.ts +9 -0
- package/dist/commands/arch/edit.d.ts.map +1 -0
- package/dist/commands/arch/index.d.ts +3 -0
- package/dist/commands/arch/index.d.ts.map +1 -0
- package/dist/commands/arch/list.d.ts +2 -0
- package/dist/commands/arch/list.d.ts.map +1 -0
- package/dist/commands/arch/port/persistence.d.ts +28 -0
- package/dist/commands/arch/port/persistence.d.ts.map +1 -0
- package/dist/commands/arch/port.d.ts +4 -0
- package/dist/commands/arch/port.d.ts.map +1 -0
- package/dist/commands/arch/refactor-rename-entity.d.ts +3 -0
- package/dist/commands/arch/refactor-rename-entity.d.ts.map +1 -0
- package/dist/commands/arch/refactor-rename-port.d.ts +3 -0
- package/dist/commands/arch/refactor-rename-port.d.ts.map +1 -0
- package/dist/commands/arch/refactor-rename-use-case.d.ts +3 -0
- package/dist/commands/arch/refactor-rename-use-case.d.ts.map +1 -0
- package/dist/commands/arch/refactor-shared.d.ts +11 -0
- package/dist/commands/arch/refactor-shared.d.ts.map +1 -0
- package/dist/commands/arch/refactor.d.ts +3 -0
- package/dist/commands/arch/refactor.d.ts.map +1 -0
- package/dist/commands/arch/remove/context.d.ts +7 -0
- package/dist/commands/arch/remove/context.d.ts.map +1 -0
- package/dist/commands/arch/remove/port.d.ts +7 -0
- package/dist/commands/arch/remove/port.d.ts.map +1 -0
- package/dist/commands/arch/remove.d.ts +3 -0
- package/dist/commands/arch/remove.d.ts.map +1 -0
- package/dist/commands/arch/validate.d.ts +2 -0
- package/dist/commands/arch/validate.d.ts.map +1 -0
- package/dist/commands/manifest/index.d.ts +3 -0
- package/dist/commands/manifest/index.d.ts.map +1 -0
- package/dist/commands/manifest/split-utils.d.ts +8 -0
- package/dist/commands/manifest/split-utils.d.ts.map +1 -0
- package/dist/commands/manifest/split.d.ts +3 -0
- package/dist/commands/manifest/split.d.ts.map +1 -0
- package/dist/commands/shared/confirm.d.ts +5 -0
- package/dist/commands/shared/confirm.d.ts.map +1 -0
- package/dist/commands/shared/error-formatter.d.ts +7 -0
- package/dist/commands/shared/error-formatter.d.ts.map +1 -0
- package/dist/commands/shared/index.d.ts +15 -0
- package/dist/commands/shared/index.d.ts.map +1 -0
- package/dist/commands/shared/project-root.d.ts +3 -0
- package/dist/commands/shared/project-root.d.ts.map +1 -0
- package/dist/commands/shared/prompt-service.d.ts +15 -0
- package/dist/commands/shared/prompt-service.d.ts.map +1 -0
- package/dist/commands/shared/spinner.d.ts +13 -0
- package/dist/commands/shared/spinner.d.ts.map +1 -0
- package/dist/commands/shared/template-engine-path.d.ts +12 -0
- package/dist/commands/shared/template-engine-path.d.ts.map +1 -0
- package/dist/commands/shared/validation.d.ts +15 -0
- package/dist/commands/shared/validation.d.ts.map +1 -0
- package/dist/commands/shared/yaml-service.d.ts +23 -0
- package/dist/commands/shared/yaml-service.d.ts.map +1 -0
- package/dist/commands/templates/index.d.ts +3 -0
- package/dist/commands/templates/index.d.ts.map +1 -0
- package/dist/commands/templates/info.d.ts +2 -0
- package/dist/commands/templates/info.d.ts.map +1 -0
- package/dist/commands/templates/list.d.ts +2 -0
- package/dist/commands/templates/list.d.ts.map +1 -0
- package/dist/config/barrel-exclusions.d.ts +10 -0
- package/dist/config/barrel-exclusions.d.ts.map +1 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/domain/index.d.ts +5 -0
- package/dist/domain/index.d.ts.map +1 -0
- package/dist/domain/result.d.ts +4 -0
- package/dist/domain/result.d.ts.map +1 -0
- package/dist/domain/services/architectural-boundary-checker.d.ts +18 -0
- package/dist/domain/services/architectural-boundary-checker.d.ts.map +1 -0
- package/dist/domain/services/emission-plan-builder.d.ts +17 -0
- package/dist/domain/services/emission-plan-builder.d.ts.map +1 -0
- package/dist/domain/services/impact-analysis.types.d.ts +24 -0
- package/dist/domain/services/impact-analysis.types.d.ts.map +1 -0
- package/dist/domain/services/impact-request-validator.d.ts +14 -0
- package/dist/domain/services/impact-request-validator.d.ts.map +1 -0
- package/dist/domain/services/index.d.ts +7 -0
- package/dist/domain/services/index.d.ts.map +1 -0
- package/dist/domain/services/layer-classifier.d.ts +4 -0
- package/dist/domain/services/layer-classifier.d.ts.map +1 -0
- package/dist/domain/services/stub-template-resolver.d.ts +16 -0
- package/dist/domain/services/stub-template-resolver.d.ts.map +1 -0
- package/dist/domain/session.d.ts +6 -0
- package/dist/domain/session.d.ts.map +1 -0
- package/dist/domain/stub-templates.d.ts +8 -0
- package/dist/domain/stub-templates.d.ts.map +1 -0
- package/dist/domain/types.d.ts +4 -0
- package/dist/domain/types.d.ts.map +1 -0
- package/dist/fs-utils.d.ts +28 -0
- package/dist/fs-utils.d.ts.map +1 -0
- package/dist/generators/apps-framework-templates.d.ts +4 -0
- package/dist/generators/apps-framework-templates.d.ts.map +1 -0
- package/dist/generators/apps.d.ts +5 -0
- package/dist/generators/apps.d.ts.map +1 -0
- package/dist/generators/architecture-file-templates.d.ts +9 -0
- package/dist/generators/architecture-file-templates.d.ts.map +1 -0
- package/dist/generators/architecture-files.d.ts +5 -0
- package/dist/generators/architecture-files.d.ts.map +1 -0
- package/dist/generators/barrels/index.d.ts +6 -0
- package/dist/generators/barrels/index.d.ts.map +1 -0
- package/dist/generators/barrels/recursive.d.ts +44 -0
- package/dist/generators/barrels/recursive.d.ts.map +1 -0
- package/dist/generators/barrels/utils.d.ts +56 -0
- package/dist/generators/barrels/utils.d.ts.map +1 -0
- package/dist/generators/barrels.d.ts +31 -0
- package/dist/generators/barrels.d.ts.map +1 -0
- package/dist/generators/eslint.d.ts +47 -0
- package/dist/generators/eslint.d.ts.map +1 -0
- package/dist/generators/layer-folders.d.ts +16 -0
- package/dist/generators/layer-folders.d.ts.map +1 -0
- package/dist/generators/migration-assistant.d.ts +7 -0
- package/dist/generators/migration-assistant.d.ts.map +1 -0
- package/dist/generators/migration-audit.d.ts +28 -0
- package/dist/generators/migration-audit.d.ts.map +1 -0
- package/dist/generators/migration-stubs.d.ts +7 -0
- package/dist/generators/migration-stubs.d.ts.map +1 -0
- package/dist/generators/package-json.d.ts +11 -0
- package/dist/generators/package-json.d.ts.map +1 -0
- package/dist/generators/port-analyzer.d.ts +56 -0
- package/dist/generators/port-analyzer.d.ts.map +1 -0
- package/dist/generators/reap.d.ts +11 -0
- package/dist/generators/reap.d.ts.map +1 -0
- package/dist/generators/root-file-templates.d.ts +8 -0
- package/dist/generators/root-file-templates.d.ts.map +1 -0
- package/dist/generators/root-files.d.ts +5 -0
- package/dist/generators/root-files.d.ts.map +1 -0
- package/dist/generators/stubs/index.d.ts +4 -0
- package/dist/generators/stubs/index.d.ts.map +1 -0
- package/dist/generators/stubs/stub-templates.d.ts +3 -0
- package/dist/generators/stubs/stub-templates.d.ts.map +1 -0
- package/dist/generators/stubs.d.ts +5 -0
- package/dist/generators/stubs.d.ts.map +1 -0
- package/dist/generators/test-generator.d.ts +7 -0
- package/dist/generators/test-generator.d.ts.map +1 -0
- package/dist/generators/test-templates/data-builder.d.ts +2 -0
- package/dist/generators/test-templates/data-builder.d.ts.map +1 -0
- package/dist/generators/test-templates/enhanced-test-double.d.ts +2 -0
- package/dist/generators/test-templates/enhanced-test-double.d.ts.map +1 -0
- package/dist/generators/test-templates/index.d.ts +5 -0
- package/dist/generators/test-templates/index.d.ts.map +1 -0
- package/dist/generators/test-templates/integration-test.d.ts +2 -0
- package/dist/generators/test-templates/integration-test.d.ts.map +1 -0
- package/dist/generators/test-templates/unit-test.d.ts +2 -0
- package/dist/generators/test-templates/unit-test.d.ts.map +1 -0
- package/dist/generators/tsconfig.d.ts +16 -0
- package/dist/generators/tsconfig.d.ts.map +1 -0
- package/dist/generators/validators/index.d.ts +11 -0
- package/dist/generators/validators/index.d.ts.map +1 -0
- package/dist/generators/validators/validate-dependencies.d.ts +7 -0
- package/dist/generators/validators/validate-dependencies.d.ts.map +1 -0
- package/dist/generators/validators/validate-manifest-sync.d.ts +5 -0
- package/dist/generators/validators/validate-manifest-sync.d.ts.map +1 -0
- package/dist/generators/validators/validate-port-adapter.d.ts +5 -0
- package/dist/generators/validators/validate-port-adapter.d.ts.map +1 -0
- package/dist/generators/validators/validation-types.d.ts +20 -0
- package/dist/generators/validators/validation-types.d.ts.map +1 -0
- package/dist/generators/validators.d.ts +7 -0
- package/dist/generators/validators.d.ts.map +1 -0
- package/dist/generators/wiring.d.ts +20 -0
- package/dist/generators/wiring.d.ts.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8070 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/adapters/atomic-file-system.adapter.d.ts +13 -0
- package/dist/infrastructure/adapters/atomic-file-system.adapter.d.ts.map +1 -0
- package/dist/infrastructure/adapters/file-system-workspace.adapter.d.ts +12 -0
- package/dist/infrastructure/adapters/file-system-workspace.adapter.d.ts.map +1 -0
- package/dist/infrastructure/adapters/in-memory-config-double.d.ts +30 -0
- package/dist/infrastructure/adapters/in-memory-config-double.d.ts.map +1 -0
- package/dist/infrastructure/adapters/index.d.ts +5 -0
- package/dist/infrastructure/adapters/index.d.ts.map +1 -0
- package/dist/infrastructure/adapters/yaml-config.adapter.d.ts +38 -0
- package/dist/infrastructure/adapters/yaml-config.adapter.d.ts.map +1 -0
- package/dist/infrastructure/index.d.ts +2 -0
- package/dist/infrastructure/index.d.ts.map +1 -0
- package/dist/linter.d.ts +7 -0
- package/dist/linter.d.ts.map +1 -0
- package/dist/loaders/index.d.ts +2 -0
- package/dist/loaders/index.d.ts.map +1 -0
- package/dist/loaders/manifest-merge-loader.d.ts +3 -0
- package/dist/loaders/manifest-merge-loader.d.ts.map +1 -0
- package/dist/lock.d.ts +14 -0
- package/dist/lock.d.ts.map +1 -0
- package/dist/manifest-service.d.ts +10 -0
- package/dist/manifest-service.d.ts.map +1 -0
- package/dist/migration-report.d.ts +12 -0
- package/dist/migration-report.d.ts.map +1 -0
- package/dist/preflight.d.ts +7 -0
- package/dist/preflight.d.ts.map +1 -0
- package/dist/refactoring/git-operations.d.ts +9 -0
- package/dist/refactoring/git-operations.d.ts.map +1 -0
- package/dist/refactoring/impact-analyzer.d.ts +23 -0
- package/dist/refactoring/impact-analyzer.d.ts.map +1 -0
- package/dist/refactoring/index.d.ts +6 -0
- package/dist/refactoring/index.d.ts.map +1 -0
- package/dist/refactoring/refactoring-engine.d.ts +40 -0
- package/dist/refactoring/refactoring-engine.d.ts.map +1 -0
- package/dist/refactoring/refactoring-patterns/base-pattern.d.ts +37 -0
- package/dist/refactoring/refactoring-patterns/base-pattern.d.ts.map +1 -0
- package/dist/refactoring/refactoring-patterns/index.d.ts +5 -0
- package/dist/refactoring/refactoring-patterns/index.d.ts.map +1 -0
- package/dist/refactoring/refactoring-patterns/refactoring-utils.d.ts +8 -0
- package/dist/refactoring/refactoring-patterns/refactoring-utils.d.ts.map +1 -0
- package/dist/refactoring/refactoring-patterns/rename-entity.pattern.d.ts +19 -0
- package/dist/refactoring/refactoring-patterns/rename-entity.pattern.d.ts.map +1 -0
- package/dist/refactoring/refactoring-patterns/rename-port.pattern.d.ts +42 -0
- package/dist/refactoring/refactoring-patterns/rename-port.pattern.d.ts.map +1 -0
- package/dist/refactoring/refactoring-patterns/rename-use-case.pattern.d.ts +40 -0
- package/dist/refactoring/refactoring-patterns/rename-use-case.pattern.d.ts.map +1 -0
- package/dist/refactoring/safe-refactoring-orchestrator.d.ts +24 -0
- package/dist/refactoring/safe-refactoring-orchestrator.d.ts.map +1 -0
- package/dist/refactoring/validation-suite.d.ts +20 -0
- package/dist/refactoring/validation-suite.d.ts.map +1 -0
- package/dist/results.d.ts +16 -0
- package/dist/results.d.ts.map +1 -0
- package/dist/sync-engine-helpers.d.ts +15 -0
- package/dist/sync-engine-helpers.d.ts.map +1 -0
- package/dist/sync-engine-init.d.ts +12 -0
- package/dist/sync-engine-init.d.ts.map +1 -0
- package/dist/sync-engine.d.ts +21 -0
- package/dist/sync-engine.d.ts.map +1 -0
- package/dist/template-engine.d.ts +3 -0
- package/dist/template-engine.d.ts.map +1 -0
- package/dist/templates/__example__/files/example-output.txt +9 -0
- package/dist/templates/__example__/manifest.json +44 -0
- package/dist/templates/adobe-creative-production/README.md +89 -0
- package/dist/templates/adobe-creative-production/files/.env.adobe-creative-production.example +6 -0
- package/dist/templates/adobe-creative-production/files/src/domain/ports/out/creative-production.port.ts +62 -0
- package/dist/templates/adobe-creative-production/files/src/infrastructure/adobe/creative-production/creative-production.adapter.ts +144 -0
- package/dist/templates/adobe-creative-production/manifest.json +25 -0
- package/dist/templates/adobe-express/README.md +85 -0
- package/dist/templates/adobe-express/files/.env.adobe-express.example +7 -0
- package/dist/templates/adobe-express/files/src/domain/ports/out/express.port.ts +47 -0
- package/dist/templates/adobe-express/files/src/infrastructure/adobe/express/express.adapter.ts +155 -0
- package/dist/templates/adobe-express/manifest.json +32 -0
- package/dist/templates/adobe-firefly-composite/README.md +75 -0
- package/dist/templates/adobe-firefly-composite/files/.env.adobe-composite.example +5 -0
- package/dist/templates/adobe-firefly-composite/files/src/domain/ports/out/composite.port.ts +39 -0
- package/dist/templates/adobe-firefly-composite/files/src/infrastructure/adobe/composite/composite.adapter.ts +102 -0
- package/dist/templates/adobe-firefly-composite/manifest.json +32 -0
- package/dist/templates/adobe-firefly-content-tagging/README.md +70 -0
- package/dist/templates/adobe-firefly-content-tagging/files/.env.adobe-content-tagging.example +4 -0
- package/dist/templates/adobe-firefly-content-tagging/files/src/domain/ports/out/content-tagging.port.ts +28 -0
- package/dist/templates/adobe-firefly-content-tagging/files/src/infrastructure/adobe/content-tagging/content-tagging.adapter.ts +120 -0
- package/dist/templates/adobe-firefly-content-tagging/manifest.json +31 -0
- package/dist/templates/adobe-firefly-core/README.md +147 -0
- package/dist/templates/adobe-firefly-core/files/.env.adobe.example +15 -0
- package/dist/templates/adobe-firefly-core/files/src/domain/ports/out/firefly-auth.port.ts +11 -0
- package/dist/templates/adobe-firefly-core/files/src/domain/ports/out/firefly-job.port.ts +50 -0
- package/dist/templates/adobe-firefly-core/files/src/domain/ports/out/firefly-storage.port.ts +20 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/auth/ims-token-provider.adapter.ts +112 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/auth/smoke-token.ts +17 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/errors/firefly-errors.ts +91 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/http/firefly-client.ts +135 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/index.ts +46 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/jobs/job-poller.ts +52 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/jobs/job-port.ts +149 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/jobs/job-result.ts +113 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/jobs/webhook-verifier.ts +67 -0
- package/dist/templates/adobe-firefly-core/files/src/infrastructure/adobe/storage/passthrough-storage.adapter.ts +36 -0
- package/dist/templates/adobe-firefly-core/manifest.json +86 -0
- package/dist/templates/adobe-firefly-custom-models/README.md +96 -0
- package/dist/templates/adobe-firefly-custom-models/files/.env.adobe-custom-models.example +6 -0
- package/dist/templates/adobe-firefly-custom-models/files/src/domain/ports/out/custom-model.port.ts +77 -0
- package/dist/templates/adobe-firefly-custom-models/files/src/infrastructure/adobe/custom-models/firefly-custom-model.adapter.ts +199 -0
- package/dist/templates/adobe-firefly-custom-models/manifest.json +33 -0
- package/dist/templates/adobe-firefly-generate/README.md +86 -0
- package/dist/templates/adobe-firefly-generate/files/.env.adobe-generate.example +5 -0
- package/dist/templates/adobe-firefly-generate/files/src/domain/ports/out/image-generation.port.ts +61 -0
- package/dist/templates/adobe-firefly-generate/files/src/infrastructure/adobe/generate/firefly-generate.adapter.ts +167 -0
- package/dist/templates/adobe-firefly-generate/manifest.json +45 -0
- package/dist/templates/adobe-firefly-media/README.md +99 -0
- package/dist/templates/adobe-firefly-media/files/.env.adobe-media.example +8 -0
- package/dist/templates/adobe-firefly-media/files/src/domain/ports/out/media-generation.port.ts +80 -0
- package/dist/templates/adobe-firefly-media/files/src/infrastructure/adobe/media/firefly-media.adapter.ts +161 -0
- package/dist/templates/adobe-firefly-media/manifest.json +32 -0
- package/dist/templates/adobe-firefly-storage-azure/README.md +88 -0
- package/dist/templates/adobe-firefly-storage-azure/files/.env.adobe-storage-azure.example +9 -0
- package/dist/templates/adobe-firefly-storage-azure/files/src/infrastructure/adobe/storage/azure-blob-presign.adapter.ts +171 -0
- package/dist/templates/adobe-firefly-storage-azure/files/src/infrastructure/adobe/storage/azure-register.ts +15 -0
- package/dist/templates/adobe-firefly-storage-azure/manifest.json +37 -0
- package/dist/templates/adobe-firefly-storage-gcs/README.md +85 -0
- package/dist/templates/adobe-firefly-storage-gcs/files/.env.adobe-storage-gcs.example +8 -0
- package/dist/templates/adobe-firefly-storage-gcs/files/src/infrastructure/adobe/storage/gcs-presign.adapter.ts +100 -0
- package/dist/templates/adobe-firefly-storage-gcs/files/src/infrastructure/adobe/storage/gcs-register.ts +15 -0
- package/dist/templates/adobe-firefly-storage-gcs/manifest.json +33 -0
- package/dist/templates/adobe-firefly-storage-s3/README.md +76 -0
- package/dist/templates/adobe-firefly-storage-s3/files/.env.adobe-storage-s3.example +8 -0
- package/dist/templates/adobe-firefly-storage-s3/files/src/infrastructure/adobe/storage/s3-presign.adapter.ts +109 -0
- package/dist/templates/adobe-firefly-storage-s3/files/src/infrastructure/adobe/storage/s3-register.ts +15 -0
- package/dist/templates/adobe-firefly-storage-s3/manifest.json +31 -0
- package/dist/templates/adobe-firefly-upscale/README.md +68 -0
- package/dist/templates/adobe-firefly-upscale/files/.env.adobe-upscale.example +3 -0
- package/dist/templates/adobe-firefly-upscale/files/src/domain/ports/out/upscale.port.ts +25 -0
- package/dist/templates/adobe-firefly-upscale/files/src/infrastructure/adobe/upscale/upscale.adapter.ts +85 -0
- package/dist/templates/adobe-firefly-upscale/manifest.json +30 -0
- package/dist/templates/adobe-illustrator/README.md +80 -0
- package/dist/templates/adobe-illustrator/files/.env.adobe-illustrator.example +7 -0
- package/dist/templates/adobe-illustrator/files/src/domain/ports/out/illustrator.port.ts +51 -0
- package/dist/templates/adobe-illustrator/files/src/infrastructure/adobe/illustrator/illustrator.adapter.ts +167 -0
- package/dist/templates/adobe-illustrator/manifest.json +38 -0
- package/dist/templates/adobe-ims-spa/README.md +99 -0
- package/dist/templates/adobe-ims-spa/files/.env.adobe-ims.example +12 -0
- package/dist/templates/adobe-ims-spa/files/app/api/auth/callback/route.ts +84 -0
- package/dist/templates/adobe-ims-spa/files/app/api/auth/login/route.ts +30 -0
- package/dist/templates/adobe-ims-spa/files/app/api/auth/logout/route.ts +24 -0
- package/dist/templates/adobe-ims-spa/files/app/api/auth/me/route.ts +18 -0
- package/dist/templates/adobe-ims-spa/files/middleware.ts +74 -0
- package/dist/templates/adobe-ims-spa/files/src/domain/ports/out/ims-auth.port.ts +24 -0
- package/dist/templates/adobe-ims-spa/files/src/infrastructure/auth/adobe-ims/adobe-ims-auth.adapter.ts +71 -0
- package/dist/templates/adobe-ims-spa/files/src/infrastructure/auth/adobe-ims/config.ts +34 -0
- package/dist/templates/adobe-ims-spa/files/src/infrastructure/auth/adobe-ims/ims-client.ts +85 -0
- package/dist/templates/adobe-ims-spa/files/src/infrastructure/auth/adobe-ims/pkce.ts +37 -0
- package/dist/templates/adobe-ims-spa/files/src/infrastructure/auth/adobe-ims/token-store.ts +54 -0
- package/dist/templates/adobe-ims-spa/files/src/infrastructure/auth/adobe-ims/user-profile-mapper.ts +12 -0
- package/dist/templates/adobe-ims-spa/files/src/lib/auth/get-current-user.ts +56 -0
- package/dist/templates/adobe-ims-spa/files/src/lib/auth/require-auth.ts +11 -0
- package/dist/templates/adobe-ims-spa/manifest.json +88 -0
- package/dist/templates/adobe-indesign/README.md +76 -0
- package/dist/templates/adobe-indesign/files/.env.adobe-indesign.example +7 -0
- package/dist/templates/adobe-indesign/files/src/domain/ports/out/indesign.port.ts +43 -0
- package/dist/templates/adobe-indesign/files/src/infrastructure/adobe/indesign/indesign.adapter.ts +160 -0
- package/dist/templates/adobe-indesign/manifest.json +38 -0
- package/dist/templates/adobe-lightroom/README.md +81 -0
- package/dist/templates/adobe-lightroom/files/.env.adobe-lightroom.example +7 -0
- package/dist/templates/adobe-lightroom/files/src/domain/ports/out/lightroom.port.ts +36 -0
- package/dist/templates/adobe-lightroom/files/src/infrastructure/adobe/lightroom/lightroom.adapter.ts +145 -0
- package/dist/templates/adobe-lightroom/manifest.json +39 -0
- package/dist/templates/adobe-photoshop/README.md +87 -0
- package/dist/templates/adobe-photoshop/files/.env.adobe-photoshop.example +7 -0
- package/dist/templates/adobe-photoshop/files/src/domain/ports/out/photoshop-automation.port.ts +60 -0
- package/dist/templates/adobe-photoshop/files/src/infrastructure/adobe/photoshop/photoshop-automation.adapter.ts +180 -0
- package/dist/templates/adobe-photoshop/manifest.json +45 -0
- package/dist/templates/adobe-substance-3d/README.md +88 -0
- package/dist/templates/adobe-substance-3d/files/.env.adobe-substance-3d.example +12 -0
- package/dist/templates/adobe-substance-3d/files/src/domain/ports/out/substance-3d.port.ts +45 -0
- package/dist/templates/adobe-substance-3d/files/src/infrastructure/adobe/substance-3d/substance-3d.adapter.ts +177 -0
- package/dist/templates/adobe-substance-3d/manifest.json +39 -0
- package/dist/templates/agents-md/README.md +55 -0
- package/dist/templates/agents-md/files/.agents/architecture.md +42 -0
- package/dist/templates/agents-md/files/.agents/git.md +30 -0
- package/dist/templates/agents-md/files/.agents/session-log.md +37 -0
- package/dist/templates/agents-md/files/.agents/tech-stack.md +34 -0
- package/dist/templates/agents-md/files/.agents/testing.md +30 -0
- package/dist/templates/agents-md/files/AGENTS.md +97 -0
- package/dist/templates/agents-md/manifest.json +49 -0
- package/dist/templates/auth-mock/README.md +57 -0
- package/dist/templates/auth-mock/files/.env.auth.example +9 -0
- package/dist/templates/auth-mock/files/middleware.ts +28 -0
- package/dist/templates/auth-mock/manifest.json +23 -0
- package/dist/templates/bedrock-agentcore-runtime/README.md +68 -0
- package/dist/templates/bedrock-agentcore-runtime/files/.env.agentcore.example +19 -0
- package/dist/templates/bedrock-agentcore-runtime/files/.github/workflows/deploy-agentcore.yml +100 -0
- package/dist/templates/bedrock-agentcore-runtime/files/Dockerfile.agentcore +33 -0
- package/dist/templates/bedrock-agentcore-runtime/files/agentcore/agentcore.json +16 -0
- package/dist/templates/bedrock-agentcore-runtime/files/agentcore/aws-targets.json +7 -0
- package/dist/templates/bedrock-agentcore-runtime/files/iam/agentcore-runtime-role.policy.json +49 -0
- package/dist/templates/bedrock-agentcore-runtime/files/infra/agentcore-stack.ts +90 -0
- package/dist/templates/bedrock-agentcore-runtime/files/src/infrastructure/agentcore/http/invocations.handler.ts +152 -0
- package/dist/templates/bedrock-agentcore-runtime/files/src/infrastructure/agentcore/http/ping.handler.ts +13 -0
- package/dist/templates/bedrock-agentcore-runtime/files/src/infrastructure/agentcore/http/server.ts +134 -0
- package/dist/templates/bedrock-agentcore-runtime/files/src/infrastructure/agentcore/runtime/payload.ts +63 -0
- package/dist/templates/bedrock-agentcore-runtime/files/src/infrastructure/agentcore/runtime/session.ts +58 -0
- package/dist/templates/bedrock-agentcore-runtime/manifest.json +89 -0
- package/dist/templates/bedrock-agentcore-services/README.md +65 -0
- package/dist/templates/bedrock-agentcore-services/files/.env.agentcore-services.example +20 -0
- package/dist/templates/bedrock-agentcore-services/files/agentcore/agentcore-services.json +14 -0
- package/dist/templates/bedrock-agentcore-services/files/src/domain/ports/out/agent-identity.port.ts +26 -0
- package/dist/templates/bedrock-agentcore-services/files/src/domain/ports/out/agent-memory.port.ts +30 -0
- package/dist/templates/bedrock-agentcore-services/files/src/domain/ports/out/tool-gateway.port.ts +27 -0
- package/dist/templates/bedrock-agentcore-services/files/src/infrastructure/agentcore/gateway/agentcore-gateway.adapter.ts +103 -0
- package/dist/templates/bedrock-agentcore-services/files/src/infrastructure/agentcore/gateway/mcp-tool-mapper.ts +44 -0
- package/dist/templates/bedrock-agentcore-services/files/src/infrastructure/agentcore/identity/agentcore-identity.adapter.ts +82 -0
- package/dist/templates/bedrock-agentcore-services/files/src/infrastructure/agentcore/identity/idp-bridge.ts +74 -0
- package/dist/templates/bedrock-agentcore-services/files/src/infrastructure/agentcore/memory/agentcore-memory.adapter.ts +82 -0
- package/dist/templates/bedrock-agentcore-services/files/src/infrastructure/agentcore/memory/memory-config.ts +45 -0
- package/dist/templates/bedrock-agentcore-services/manifest.json +97 -0
- package/dist/templates/better-auth/README.md +60 -0
- package/dist/templates/better-auth/files/.env.better-auth.example +20 -0
- package/dist/templates/better-auth/files/app/api/auth/[...all]/route.ts +5 -0
- package/dist/templates/better-auth/files/src/db/index.ts +10 -0
- package/dist/templates/better-auth/files/src/db/migrations/0001_better_auth.sql +49 -0
- package/dist/templates/better-auth/files/src/db/schema/better-auth.ts +57 -0
- package/dist/templates/better-auth/files/src/lib/auth-client.ts +13 -0
- package/dist/templates/better-auth/files/src/lib/auth.ts +72 -0
- package/dist/templates/better-auth/manifest.json +71 -0
- package/dist/templates/bullmq/README.md +61 -0
- package/dist/templates/bullmq/files/.env.bullmq.example +34 -0
- package/dist/templates/bullmq/files/app/admin/queues/[[...slug]]/route.ts +103 -0
- package/dist/templates/bullmq/files/scripts/start-worker.ts +55 -0
- package/dist/templates/bullmq/files/server/startup/start-workers.ts +171 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/connection.ts +105 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/fallback/sync-executor.ts +96 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/index.ts +30 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/jobs/ai-generation.job.ts +53 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/jobs/email.job.ts +42 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/jobs/export.job.ts +49 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/jobs/image-processing.job.ts +48 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/jobs/webhook.job.ts +139 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/parse-int-env.ts +28 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/queues.ts +153 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/scheduler/job-scheduler.ts +70 -0
- package/dist/templates/bullmq/files/src/infrastructure/queue/workers.ts +101 -0
- package/dist/templates/bullmq/manifest.json +120 -0
- package/dist/templates/ci-github-actions/README.md +62 -0
- package/dist/templates/ci-github-actions/files/.github/dependabot.yml +20 -0
- package/dist/templates/ci-github-actions/files/.github/workflows/ci.yml +103 -0
- package/dist/templates/ci-github-actions/files/.github/workflows/deploy-fly.yml +30 -0
- package/dist/templates/ci-github-actions/files/.github/workflows/deploy-railway.yml +32 -0
- package/dist/templates/ci-github-actions/files/.github/workflows/deploy-vercel.yml +39 -0
- package/dist/templates/ci-github-actions/files/.github/workflows/deploy-vps.yml +34 -0
- package/dist/templates/ci-github-actions/files/.github/workflows/preview.yml +58 -0
- package/dist/templates/ci-github-actions/files/fly.toml +23 -0
- package/dist/templates/ci-github-actions/manifest.json +100 -0
- package/dist/templates/clerk/README.md +59 -0
- package/dist/templates/clerk/files/.env.clerk.example +11 -0
- package/dist/templates/clerk/files/app/(protected)/layout.tsx +18 -0
- package/dist/templates/clerk/files/app/api/protected-example/route.ts +17 -0
- package/dist/templates/clerk/files/middleware.ts +25 -0
- package/dist/templates/clerk/files/src/lib/auth.ts +12 -0
- package/dist/templates/clerk/files/src/lib/role-guard.tsx +32 -0
- package/dist/templates/clerk/manifest.json +67 -0
- package/dist/templates/design-system/README.md +60 -0
- package/dist/templates/design-system/files/.storybook/main.ts +9 -0
- package/dist/templates/design-system/files/.storybook/preview.ts +13 -0
- package/dist/templates/design-system/files/DESIGN.md +76 -0
- package/dist/templates/design-system/files/src/components/ui/button.stories.tsx +17 -0
- package/dist/templates/design-system/files/src/components/ui/button.tsx +61 -0
- package/dist/templates/design-system/files/src/components/ui/card.tsx +40 -0
- package/dist/templates/design-system/files/src/components/ui/index.ts +6 -0
- package/dist/templates/design-system/files/src/components/ui/input.tsx +29 -0
- package/dist/templates/design-system/files/src/lib/cn.ts +13 -0
- package/dist/templates/design-system/files/src/styles/globals.css +37 -0
- package/dist/templates/design-system/files/src/styles/theme.ts +56 -0
- package/dist/templates/design-system/files/src/styles/tokens.css +73 -0
- package/dist/templates/design-system/files/tailwind.config.ts +58 -0
- package/dist/templates/design-system/manifest.json +81 -0
- package/dist/templates/docker/README.md +62 -0
- package/dist/templates/docker/files/.dockerignore +34 -0
- package/dist/templates/docker/files/.github/workflows/docker-build.yml +74 -0
- package/dist/templates/docker/files/Dockerfile +57 -0
- package/dist/templates/docker/files/docker-compose.ci.yml +22 -0
- package/dist/templates/docker/files/docker-compose.override.yml +20 -0
- package/dist/templates/docker/files/docker-compose.yml +109 -0
- package/dist/templates/docker/manifest.json +59 -0
- package/dist/templates/env-setup/README.md +70 -0
- package/dist/templates/env-setup/files/.env.example +28 -0
- package/dist/templates/env-setup/files/.gitignore.hexagen +16 -0
- package/dist/templates/env-setup/files/SETUP.md +70 -0
- package/dist/templates/env-setup/files/scripts/check-env.ts +95 -0
- package/dist/templates/env-setup/files/src/config/env.client.ts +18 -0
- package/dist/templates/env-setup/files/src/config/env.server.ts +49 -0
- package/dist/templates/env-setup/files/src/config/env.ts +14 -0
- package/dist/templates/env-setup/files/src/config/load-env.ts +40 -0
- package/dist/templates/env-setup/manifest.json +55 -0
- package/dist/templates/error-handling/README.md +72 -0
- package/dist/templates/error-handling/files/.env.sentry.example +8 -0
- package/dist/templates/error-handling/files/app/components/ErrorBoundary.tsx +49 -0
- package/dist/templates/error-handling/files/app/components/ErrorFallback.tsx +35 -0
- package/dist/templates/error-handling/files/server/middleware/error-handler.ts +131 -0
- package/dist/templates/error-handling/files/src/application/errors/application.error.ts +33 -0
- package/dist/templates/error-handling/files/src/domain/errors/authorization.error.ts +20 -0
- package/dist/templates/error-handling/files/src/domain/errors/domain.error.ts +23 -0
- package/dist/templates/error-handling/files/src/domain/errors/not-found.error.ts +11 -0
- package/dist/templates/error-handling/files/src/domain/errors/validation.error.ts +17 -0
- package/dist/templates/error-handling/files/src/infrastructure/errors/external-service.error.ts +24 -0
- package/dist/templates/error-handling/files/src/infrastructure/errors/infrastructure.error.ts +22 -0
- package/dist/templates/error-handling/files/src/infrastructure/errors/llm-errors.ts +57 -0
- package/dist/templates/error-handling/files/src/shared/errors/error-codes.ts +29 -0
- package/dist/templates/error-handling/files/src/shared/result.ts +38 -0
- package/dist/templates/error-handling/manifest.json +63 -0
- package/dist/templates/eslint-no-console/README.md +78 -0
- package/dist/templates/eslint-no-console/files/eslint.no-console.mjs +35 -0
- package/dist/templates/eslint-no-console/manifest.json +28 -0
- package/dist/templates/github-oauth/README.md +61 -0
- package/dist/templates/github-oauth/files/.env.github-oauth.example +13 -0
- package/dist/templates/github-oauth/files/app/api/auth/callback/github/route.ts +105 -0
- package/dist/templates/github-oauth/files/app/api/auth/login/github/route.ts +33 -0
- package/dist/templates/github-oauth/files/app/api/auth/logout/github/route.ts +8 -0
- package/dist/templates/github-oauth/files/app/api/auth/me/route.ts +10 -0
- package/dist/templates/github-oauth/files/middleware.ts +59 -0
- package/dist/templates/github-oauth/files/src/infrastructure/auth/github/config.ts +34 -0
- package/dist/templates/github-oauth/files/src/infrastructure/auth/github/github-auth.adapter.ts +12 -0
- package/dist/templates/github-oauth/files/src/infrastructure/auth/github/github-client.ts +95 -0
- package/dist/templates/github-oauth/files/src/infrastructure/auth/github/github-user.ts +8 -0
- package/dist/templates/github-oauth/files/src/infrastructure/auth/github/session-store.ts +56 -0
- package/dist/templates/github-oauth/files/src/infrastructure/auth/github/user-profile-mapper.ts +24 -0
- package/dist/templates/github-oauth/files/src/lib/auth/get-current-user.ts +31 -0
- package/dist/templates/github-oauth/files/src/lib/auth/require-auth.ts +11 -0
- package/dist/templates/github-oauth/manifest.json +83 -0
- package/dist/templates/google-oauth/README.md +70 -0
- package/dist/templates/google-oauth/files/.env.google-oauth.example +14 -0
- package/dist/templates/google-oauth/files/app/api/auth/callback/google/route.ts +78 -0
- package/dist/templates/google-oauth/files/app/api/auth/login/google/route.ts +34 -0
- package/dist/templates/google-oauth/files/app/api/auth/logout/google/route.ts +8 -0
- package/dist/templates/google-oauth/files/app/api/auth/me/route.ts +13 -0
- package/dist/templates/google-oauth/files/middleware.ts +62 -0
- package/dist/templates/google-oauth/files/src/infrastructure/auth/google/config.ts +29 -0
- package/dist/templates/google-oauth/files/src/infrastructure/auth/google/google-auth.adapter.ts +22 -0
- package/dist/templates/google-oauth/files/src/infrastructure/auth/google/google-client.ts +65 -0
- package/dist/templates/google-oauth/files/src/infrastructure/auth/google/google-user.ts +9 -0
- package/dist/templates/google-oauth/files/src/infrastructure/auth/google/session-store.ts +62 -0
- package/dist/templates/google-oauth/files/src/infrastructure/auth/google/user-profile-mapper.ts +24 -0
- package/dist/templates/google-oauth/files/src/lib/auth/get-current-user.ts +36 -0
- package/dist/templates/google-oauth/files/src/lib/auth/require-auth.ts +13 -0
- package/dist/templates/google-oauth/manifest.json +82 -0
- package/dist/templates/langgraph/README.md +60 -0
- package/dist/templates/langgraph/files/.env.langgraph.example +26 -0
- package/dist/templates/langgraph/files/app/api/agent/invoke/route.ts +48 -0
- package/dist/templates/langgraph/files/app/api/agent/resume/route.ts +66 -0
- package/dist/templates/langgraph/files/app/api/agent/stream/route.ts +63 -0
- package/dist/templates/langgraph/files/src/domain/ports/out/agent-graph.port.ts +78 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/adapters/langgraph.adapter.ts +185 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/checkpointers/index.ts +84 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/checkpointers/memory-checkpointer.ts +12 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/checkpointers/postgres-checkpointer.ts +20 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/checkpointers/redis-checkpointer.ts +25 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/checkpointers/supabase-checkpointer.ts +26 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/edges/routing.ts +31 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/graphs/research-agent.graph.ts +81 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/graphs/simple-chain.graph.ts +81 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/index.ts +23 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/human-review.node.ts +34 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/input-processor.node.ts +31 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/llm-call.node.ts +38 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/output-formatter.node.ts +27 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/planner.node.ts +51 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/researcher.node.ts +63 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/synthesiser.node.ts +62 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/state/graph-state.ts +57 -0
- package/dist/templates/langgraph/files/src/infrastructure/langgraph/streaming/token-stream.ts +84 -0
- package/dist/templates/langgraph/manifest.json +131 -0
- package/dist/templates/llm-adapter/README.md +63 -0
- package/dist/templates/llm-adapter/files/.env.llm.example +49 -0
- package/dist/templates/llm-adapter/files/src/domain/ports/out/llm-client.port.ts +36 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/adapters/anthropic-llm-client.adapter.ts +111 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/adapters/azure-openai-llm-client.adapter.ts +105 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/adapters/ollama-llm-client.adapter.ts +102 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/adapters/openai-llm-client.adapter.ts +104 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/adapters/xai-llm-client.adapter.ts +104 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/constants/capabilities.ts +38 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/constants/models.ts +39 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/errors/llm-errors.ts +83 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/index.ts +39 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/router/llm-router.ts +117 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/router/provider-registry.ts +45 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/smoke-test.ts +25 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/utils/parse-env.ts +8 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/utils/retry.ts +39 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/utils/structured-output.ts +78 -0
- package/dist/templates/llm-adapter/files/src/infrastructure/llm/utils/timeout.ts +22 -0
- package/dist/templates/llm-adapter/manifest.json +113 -0
- package/dist/templates/llm-adapter-bedrock/README.md +58 -0
- package/dist/templates/llm-adapter-bedrock/files/.env.bedrock.example +23 -0
- package/dist/templates/llm-adapter-bedrock/files/src/infrastructure/llm/adapters/bedrock-llm-client.adapter.ts +126 -0
- package/dist/templates/llm-adapter-bedrock/files/src/infrastructure/llm/adapters/bedrock-register.ts +20 -0
- package/dist/templates/llm-adapter-bedrock/files/src/infrastructure/llm/errors/bedrock-errors.ts +42 -0
- package/dist/templates/llm-adapter-bedrock/manifest.json +51 -0
- package/dist/templates/magic-link/README.md +66 -0
- package/dist/templates/magic-link/files/.env.magic-link.example +24 -0
- package/dist/templates/magic-link/files/app/api/auth/logout/route.ts +12 -0
- package/dist/templates/magic-link/files/app/api/auth/magic-link/request/route.ts +34 -0
- package/dist/templates/magic-link/files/app/api/auth/magic-link/verify/route.ts +41 -0
- package/dist/templates/magic-link/files/app/api/auth/me/route.ts +10 -0
- package/dist/templates/magic-link/files/middleware.ts +60 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/config.ts +17 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/email-templates.ts +46 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/email-transport.ts +71 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/magic-link-auth.adapter.ts +11 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/magic-link-store.ts +31 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/session-store.ts +56 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/token-generator.ts +71 -0
- package/dist/templates/magic-link/files/src/infrastructure/auth/magic-link/user-profile-mapper.ts +10 -0
- package/dist/templates/magic-link/files/src/lib/auth/get-current-user.ts +28 -0
- package/dist/templates/magic-link/files/src/lib/auth/require-auth.ts +11 -0
- package/dist/templates/magic-link/manifest.json +99 -0
- package/dist/templates/microsoft-entra/README.md +63 -0
- package/dist/templates/microsoft-entra/files/.env.microsoft-entra.example +17 -0
- package/dist/templates/microsoft-entra/files/app/api/auth/callback/entra/route.ts +93 -0
- package/dist/templates/microsoft-entra/files/app/api/auth/login/entra/route.ts +29 -0
- package/dist/templates/microsoft-entra/files/app/api/auth/logout/entra/route.ts +26 -0
- package/dist/templates/microsoft-entra/files/app/api/auth/me/route.ts +10 -0
- package/dist/templates/microsoft-entra/files/middleware.ts +59 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/config.ts +43 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/entra-auth.adapter.ts +14 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/entra-client.ts +82 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/entra-user.ts +9 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/group-role-mapper.ts +22 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/pkce.ts +20 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/session-store.ts +56 -0
- package/dist/templates/microsoft-entra/files/src/infrastructure/auth/entra/user-profile-mapper.ts +33 -0
- package/dist/templates/microsoft-entra/files/src/lib/auth/get-current-user.ts +31 -0
- package/dist/templates/microsoft-entra/files/src/lib/auth/require-auth.ts +11 -0
- package/dist/templates/microsoft-entra/manifest.json +93 -0
- package/dist/templates/nextauth/README.md +61 -0
- package/dist/templates/nextauth/files/.env.nextauth.example +16 -0
- package/dist/templates/nextauth/files/app/api/auth/[...nextauth]/route.ts +4 -0
- package/dist/templates/nextauth/files/middleware.ts +17 -0
- package/dist/templates/nextauth/files/src/auth.config.ts +41 -0
- package/dist/templates/nextauth/files/src/auth.ts +67 -0
- package/dist/templates/nextauth/files/types/next-auth.d.ts +16 -0
- package/dist/templates/nextauth/manifest.json +74 -0
- package/dist/templates/observability/README.md +69 -0
- package/dist/templates/observability/files/.env.observability.example +12 -0
- package/dist/templates/observability/files/.env.otel.example +7 -0
- package/dist/templates/observability/files/app/api/health/route.ts +37 -0
- package/dist/templates/observability/files/instrumentation.ts +52 -0
- package/dist/templates/observability/files/server/middleware/request-logger.ts +53 -0
- package/dist/templates/observability/files/src/infrastructure/logging/context.ts +21 -0
- package/dist/templates/observability/files/src/infrastructure/logging/correlation.ts +39 -0
- package/dist/templates/observability/files/src/infrastructure/logging/index.ts +12 -0
- package/dist/templates/observability/files/src/infrastructure/logging/logger.ts +68 -0
- package/dist/templates/observability/files/src/infrastructure/logging/redact.ts +89 -0
- package/dist/templates/observability/manifest.json +57 -0
- package/dist/templates/rate-limiting/README.md +63 -0
- package/dist/templates/rate-limiting/files/.env.rate-limit.example +21 -0
- package/dist/templates/rate-limiting/files/server/errors/rate-limit-exceeded.error.ts +43 -0
- package/dist/templates/rate-limiting/files/server/middleware/rate-limit.ts +79 -0
- package/dist/templates/rate-limiting/files/server/utils/get-client-ip.ts +27 -0
- package/dist/templates/rate-limiting/files/server/utils/rate-limiter.ts +82 -0
- package/dist/templates/rate-limiting/files/server/utils/session-id.ts +28 -0
- package/dist/templates/rate-limiting/files/types/rate-limit.d.ts +12 -0
- package/dist/templates/rate-limiting/manifest.json +66 -0
- package/dist/templates/shared-types/README.md +59 -0
- package/dist/templates/shared-types/files/.env.shared-types.example +14 -0
- package/dist/templates/shared-types/files/src/domain/value-objects/user-context.ts +11 -0
- package/dist/templates/shared-types/files/src/infrastructure/auth/mock-user.ts +16 -0
- package/dist/templates/shared-types/files/src/infrastructure/auth/session/session-manager.ts +59 -0
- package/dist/templates/shared-types/manifest.json +37 -0
- package/dist/templates/supabase/README.md +59 -0
- package/dist/templates/supabase/files/.env.supabase.example +15 -0
- package/dist/templates/supabase/files/drizzle.config.ts +15 -0
- package/dist/templates/supabase/files/scripts/gen-types.sh +9 -0
- package/dist/templates/supabase/files/scripts/migrate.ts +23 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/admin.ts +23 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/client.ts +16 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/drizzle/client.ts +17 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/drizzle/schema.ts +10 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/realtime/subscribe.ts +41 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/result.ts +30 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/server.ts +28 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/storage/delete.ts +17 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/storage/download.ts +17 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/storage/index.ts +4 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/storage/signed-url.ts +26 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/storage/upload.ts +24 -0
- package/dist/templates/supabase/files/src/infrastructure/supabase/types/database.types.ts +10 -0
- package/dist/templates/supabase/files/supabase/migrations/0001_example_rls.sql +23 -0
- package/dist/templates/supabase/files/supabase/seed.sql +7 -0
- package/dist/templates/supabase/manifest.json +133 -0
- package/dist/templates/supabase-auth/README.md +55 -0
- package/dist/templates/supabase-auth/files/app/api/auth/me/route.ts +10 -0
- package/dist/templates/supabase-auth/files/middleware.ts +108 -0
- package/dist/templates/supabase-auth/files/src/lib/auth/get-current-user.ts +46 -0
- package/dist/templates/supabase-auth/files/src/lib/auth/require-auth.ts +11 -0
- package/dist/templates/supabase-auth/manifest.json +40 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/manifest/apps.d.ts +24 -0
- package/dist/types/manifest/apps.d.ts.map +1 -0
- package/dist/types/manifest/bounded-context.d.ts +43 -0
- package/dist/types/manifest/bounded-context.d.ts.map +1 -0
- package/dist/types/manifest/generator.d.ts +51 -0
- package/dist/types/manifest/generator.d.ts.map +1 -0
- package/dist/types/manifest/helpers.d.ts +30 -0
- package/dist/types/manifest/helpers.d.ts.map +1 -0
- package/dist/types/manifest/index.d.ts +8 -0
- package/dist/types/manifest/index.d.ts.map +1 -0
- package/dist/types/manifest/layers.d.ts +32 -0
- package/dist/types/manifest/layers.d.ts.map +1 -0
- package/dist/types/manifest/manifest.d.ts +64 -0
- package/dist/types/manifest/manifest.d.ts.map +1 -0
- package/dist/types/manifest/monorepo.d.ts +94 -0
- package/dist/types/manifest/monorepo.d.ts.map +1 -0
- package/dist/types/manifest.d.ts +2 -0
- package/dist/types/manifest.d.ts.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Adobe Firefly — Audio/Video (Media) (`adobe-firefly-media`)
|
|
2
|
+
|
|
3
|
+
> Long-running Audio/Video generation: text-to-video, image-to-video, audio/video translation,
|
|
4
|
+
> speech, and sound effects. The longest jobs in the family (minutes).
|
|
5
|
+
|
|
6
|
+
| | |
|
|
7
|
+
| ------------- | ------------------------------------------------ |
|
|
8
|
+
| **ID** | `adobe-firefly-media` |
|
|
9
|
+
| **Category** | Adobe Firefly Services — Core Generative |
|
|
10
|
+
| **Requires** | `adobe-firefly-core` |
|
|
11
|
+
| **Conflicts** | none |
|
|
12
|
+
| **Branch** | `feature/generator-template-adobe-firefly-media` |
|
|
13
|
+
|
|
14
|
+
Author/agent-facing reference, beside `manifest.json` — not emitted into projects.
|
|
15
|
+
|
|
16
|
+
## What it does
|
|
17
|
+
|
|
18
|
+
Adds `MediaGenerationPort` + `fireflyMedia` adapter with five operations: `textToVideo`,
|
|
19
|
+
`imageToVideo`, `translateAudioVideo`, `generateSpeech`, `soundEffect`. Each presigns its IO,
|
|
20
|
+
submits an async job, and resolves to the output href.
|
|
21
|
+
|
|
22
|
+
## Service & API
|
|
23
|
+
|
|
24
|
+
- **Host:** `firefly-api.adobe.io` (the core `ADOBE_FIREFLY_BASE_URL`) — **not** image.adobe.io.
|
|
25
|
+
The shared `fireflyClient` posts **relative** paths (`/v3/videos/*-async`, `/v3/audio/*-async`,
|
|
26
|
+
and `/v3/audio-video/translate-async` for `translateAudioVideo`).
|
|
27
|
+
- **Auth:** IMS Server-to-Server (inherited from core).
|
|
28
|
+
- **Wait:** `jobPort.await(handle)` — polling **or** webhook, transparently (the firefly-api job path,
|
|
29
|
+
not the image.adobe.io always-poll). Guards a missing `jobId`.
|
|
30
|
+
- **Partner models:** Veo / Runway / Kling / ElevenLabs are passed as **opaque `model` ids** where
|
|
31
|
+
your entitlement allows — forwarded unchanged, no partner SDKs.
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
`hexagen add adobe-firefly-media`. Question:
|
|
36
|
+
|
|
37
|
+
| Question | Default |
|
|
38
|
+
| ------------------------- | ------------------------------------------- |
|
|
39
|
+
| `partner_model` (boolean) | `false` — acknowledge partner-model routing |
|
|
40
|
+
|
|
41
|
+
Env: `ADOBE_FIREFLY_MEDIA_MODEL`. Emits `media-generation.port.ts`, `firefly-media.adapter.ts`,
|
|
42
|
+
`.env.adobe-media.example`.
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import { fireflyMedia } from "@/infrastructure/adobe/media/firefly-media.adapter";
|
|
48
|
+
|
|
49
|
+
await fireflyMedia.textToVideo({
|
|
50
|
+
prompt: "a kite over dunes at dawn",
|
|
51
|
+
outputHref: "s3://b/out/kite.mp4",
|
|
52
|
+
});
|
|
53
|
+
await fireflyMedia.imageToVideo({
|
|
54
|
+
inputHref,
|
|
55
|
+
outputHref,
|
|
56
|
+
prompt: "slow push-in",
|
|
57
|
+
});
|
|
58
|
+
await fireflyMedia.translateAudioVideo({
|
|
59
|
+
inputHref,
|
|
60
|
+
outputHref,
|
|
61
|
+
targetLocale: "es-ES",
|
|
62
|
+
});
|
|
63
|
+
await fireflyMedia.generateSpeech({
|
|
64
|
+
text: "Welcome",
|
|
65
|
+
outputHref,
|
|
66
|
+
voiceId: "narrator",
|
|
67
|
+
});
|
|
68
|
+
await fireflyMedia.soundEffect({ prompt: "distant thunder", outputHref });
|
|
69
|
+
|
|
70
|
+
// partner model (where entitled) — opaque id, no SDK:
|
|
71
|
+
await fireflyMedia.textToVideo({ prompt: "...", outputHref, model: "veo-3" });
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Configuration
|
|
75
|
+
|
|
76
|
+
| Env var | Purpose |
|
|
77
|
+
| --------------------------- | ----------------------------------------------------------------------- |
|
|
78
|
+
| `ADOBE_FIREFLY_MEDIA_MODEL` | default model id (also `MediaOptions.model`); verify against Adobe docs |
|
|
79
|
+
|
|
80
|
+
## Notes for agents
|
|
81
|
+
|
|
82
|
+
- **Longest-running jobs in the family.** These are firefly-api webhook-delivering jobs, so
|
|
83
|
+
`ADOBE_WEBHOOK_TIMEOUT_MS` **does** apply (unlike the image.adobe.io services) — prefer
|
|
84
|
+
`job_mode=webhook` and raise it; if polling, raise `ADOBE_JOB_POLL_INTERVAL_MS`.
|
|
85
|
+
- Each method resolves to a single output href (`done.outputs[0]`).
|
|
86
|
+
- Presign IO via core passthrough or a `storage-*` addon.
|
|
87
|
+
|
|
88
|
+
## Checklist (post-install)
|
|
89
|
+
|
|
90
|
+
Confirm the Audio/Video entitlement/scope; verify the `/v3/videos/*`, `/v3/audio/*`, and
|
|
91
|
+
`/v3/audio-video/translate-async` endpoints;
|
|
92
|
+
tune webhook/poll timeouts for the long jobs; supply presigned IO; set the default model; pass partner
|
|
93
|
+
models as opaque ids. Optional SDK: `npm install @adobe/firefly-services-sdk-js`.
|
|
94
|
+
|
|
95
|
+
## Related
|
|
96
|
+
|
|
97
|
+
Foundation: [`adobe-firefly-core`](../adobe-firefly-core). Sibling Core Generative services:
|
|
98
|
+
[`adobe-firefly-generate`](../adobe-firefly-generate), [`adobe-firefly-upscale`](../adobe-firefly-upscale),
|
|
99
|
+
[`adobe-firefly-composite`](../adobe-firefly-composite).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# --- Adobe Firefly — Audio/Video (Media) ---
|
|
2
|
+
# Audio/Video generation on firefly-api.adobe.io (the core ADOBE_FIREFLY_BASE_URL).
|
|
3
|
+
# Jobs run for MINUTES — prefer webhook job_mode (raise ADOBE_WEBHOOK_TIMEOUT_MS),
|
|
4
|
+
# and scale up ADOBE_JOB_POLL_INTERVAL_MS if polling.
|
|
5
|
+
# Partner-model routing acknowledged at install (partner_model={partner_model}).
|
|
6
|
+
# Pass a partner model id (Veo/Runway/Kling/ElevenLabs, where entitled) as the
|
|
7
|
+
# per-call model option — it is forwarded unchanged; no partner SDKs are bundled.
|
|
8
|
+
ADOBE_FIREFLY_MEDIA_MODEL=firefly-video-v1 # default model id; verify against Adobe docs
|
package/dist/templates/adobe-firefly-media/files/src/domain/ports/out/media-generation.port.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { Result } from "../../../shared/result";
|
|
2
|
+
// Type-only import of the infrastructure error (erased at compile) — the deliberate
|
|
3
|
+
// domain→infra decoupling for the port's failure channel, not an oversight.
|
|
4
|
+
import type { FireflyError } from "../../../infrastructure/adobe/errors/firefly-errors";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Outbound port for the Adobe Firefly Audio/Video (Media) API.
|
|
8
|
+
*
|
|
9
|
+
* Long-running async generation: text-to-video, image-to-video, audio/video
|
|
10
|
+
* translation, speech, and sound effects. Every method resolves to the output
|
|
11
|
+
* href. Hrefs are presigned URLs (`storage: "external"`).
|
|
12
|
+
*/
|
|
13
|
+
export interface MediaOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Opaque model id. Defaults to the install-configured model; pass a partner
|
|
16
|
+
* model id (Veo / Runway / Kling / ElevenLabs, where your entitlement allows)
|
|
17
|
+
* and it is forwarded unchanged — no partner SDKs are involved.
|
|
18
|
+
*/
|
|
19
|
+
readonly model?: string;
|
|
20
|
+
/** Per-call seed for reproducibility. */
|
|
21
|
+
readonly seed?: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface TextToVideoRequest extends MediaOptions {
|
|
25
|
+
/** Text prompt describing the video. */
|
|
26
|
+
readonly prompt: string;
|
|
27
|
+
/** Presigned destination the rendered video is written to. */
|
|
28
|
+
readonly outputHref: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ImageToVideoRequest extends MediaOptions {
|
|
32
|
+
/** Presigned source / first-frame image. */
|
|
33
|
+
readonly inputHref: string;
|
|
34
|
+
/** Presigned destination the rendered video is written to. */
|
|
35
|
+
readonly outputHref: string;
|
|
36
|
+
/** Optional motion/style prompt. */
|
|
37
|
+
readonly prompt?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface TranslateAudioVideoRequest extends MediaOptions {
|
|
41
|
+
/** Presigned source audio/video. */
|
|
42
|
+
readonly inputHref: string;
|
|
43
|
+
/** Presigned destination the translated asset is written to. */
|
|
44
|
+
readonly outputHref: string;
|
|
45
|
+
/** Target locale, e.g. `es-ES`. */
|
|
46
|
+
readonly targetLocale: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface GenerateSpeechRequest extends MediaOptions {
|
|
50
|
+
/** Text to synthesise. */
|
|
51
|
+
readonly text: string;
|
|
52
|
+
/** Presigned destination the audio is written to. */
|
|
53
|
+
readonly outputHref: string;
|
|
54
|
+
/** Optional voice id. */
|
|
55
|
+
readonly voiceId?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface SoundEffectRequest extends MediaOptions {
|
|
59
|
+
/** Text prompt describing the sound effect. */
|
|
60
|
+
readonly prompt: string;
|
|
61
|
+
/** Presigned destination the audio is written to. */
|
|
62
|
+
readonly outputHref: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface MediaGenerationPort {
|
|
66
|
+
/** Generate a video from a text prompt. */
|
|
67
|
+
textToVideo(req: TextToVideoRequest): Promise<Result<string, FireflyError>>;
|
|
68
|
+
/** Animate a source image into a video. */
|
|
69
|
+
imageToVideo(req: ImageToVideoRequest): Promise<Result<string, FireflyError>>;
|
|
70
|
+
/** Translate the audio/video of a source asset into another locale. */
|
|
71
|
+
translateAudioVideo(
|
|
72
|
+
req: TranslateAudioVideoRequest,
|
|
73
|
+
): Promise<Result<string, FireflyError>>;
|
|
74
|
+
/** Synthesise speech from text. */
|
|
75
|
+
generateSpeech(
|
|
76
|
+
req: GenerateSpeechRequest,
|
|
77
|
+
): Promise<Result<string, FireflyError>>;
|
|
78
|
+
/** Generate a sound effect from a text prompt. */
|
|
79
|
+
soundEffect(req: SoundEffectRequest): Promise<Result<string, FireflyError>>;
|
|
80
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// @hexagen-server-only
|
|
2
|
+
import type {
|
|
3
|
+
GenerateSpeechRequest,
|
|
4
|
+
ImageToVideoRequest,
|
|
5
|
+
MediaGenerationPort,
|
|
6
|
+
MediaOptions,
|
|
7
|
+
SoundEffectRequest,
|
|
8
|
+
TextToVideoRequest,
|
|
9
|
+
TranslateAudioVideoRequest,
|
|
10
|
+
} from "../../../domain/ports/out/media-generation.port";
|
|
11
|
+
import { fireflyClient } from "../http/firefly-client";
|
|
12
|
+
import { jobPort } from "../jobs/job-port";
|
|
13
|
+
import { toJobHandle } from "../jobs/job-result";
|
|
14
|
+
import { getStoragePresigner } from "../storage/passthrough-storage.adapter";
|
|
15
|
+
import { classifyAdobeError, FireflyError } from "../errors/firefly-errors";
|
|
16
|
+
import { ok, err, type Result } from "../../../shared/result";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Firefly Audio/Video (Media) adapter — the boundary for {@link MediaGenerationPort}.
|
|
20
|
+
*
|
|
21
|
+
* Unlike the image.adobe.io services, Media runs on firefly-api.adobe.io (the core
|
|
22
|
+
* ADOBE_FIREFLY_BASE_URL), so the shared `fireflyClient` posts RELATIVE paths and
|
|
23
|
+
* each call awaits completion via `FireflyJobPort` (polling OR webhook,
|
|
24
|
+
* transparently) — NOT the image.adobe.io always-poll path.
|
|
25
|
+
*
|
|
26
|
+
* These are the LONGEST jobs in the family (minutes). Prefer webhook job_mode and
|
|
27
|
+
* raise ADOBE_WEBHOOK_TIMEOUT_MS; if polling, scale ADOBE_JOB_POLL_INTERVAL_MS up.
|
|
28
|
+
*
|
|
29
|
+
* Partner-model routing acknowledged at install (partner_model={partner_model}).
|
|
30
|
+
* Pass a partner model id (Veo / Runway / Kling / ElevenLabs, where entitled) as the
|
|
31
|
+
* opaque `model` option — it is forwarded unchanged; no partner SDKs are bundled.
|
|
32
|
+
*
|
|
33
|
+
* NOTE: paths/payloads version frequently — verify against Adobe docs.
|
|
34
|
+
*/
|
|
35
|
+
const DEFAULT_MODEL =
|
|
36
|
+
process.env.ADOBE_FIREFLY_MEDIA_MODEL?.trim() || "firefly-video-v1";
|
|
37
|
+
|
|
38
|
+
export class FireflyMediaAdapter implements MediaGenerationPort {
|
|
39
|
+
async textToVideo(
|
|
40
|
+
req: TextToVideoRequest,
|
|
41
|
+
): Promise<Result<string, FireflyError>> {
|
|
42
|
+
return this.run(async () => {
|
|
43
|
+
const output = await getStoragePresigner().presignOutput(req.outputHref);
|
|
44
|
+
return {
|
|
45
|
+
path: "/v3/videos/generate-async",
|
|
46
|
+
body: withOptions({ prompt: req.prompt, output: external(output.href) }, req),
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async imageToVideo(
|
|
52
|
+
req: ImageToVideoRequest,
|
|
53
|
+
): Promise<Result<string, FireflyError>> {
|
|
54
|
+
return this.run(async () => {
|
|
55
|
+
const storage = getStoragePresigner();
|
|
56
|
+
const input = await storage.presignInput(req.inputHref);
|
|
57
|
+
const output = await storage.presignOutput(req.outputHref);
|
|
58
|
+
return {
|
|
59
|
+
path: "/v3/videos/generate-async",
|
|
60
|
+
body: withOptions(
|
|
61
|
+
{ image: external(input.href), prompt: req.prompt, output: external(output.href) },
|
|
62
|
+
req,
|
|
63
|
+
),
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async translateAudioVideo(
|
|
69
|
+
req: TranslateAudioVideoRequest,
|
|
70
|
+
): Promise<Result<string, FireflyError>> {
|
|
71
|
+
return this.run(async () => {
|
|
72
|
+
const storage = getStoragePresigner();
|
|
73
|
+
const input = await storage.presignInput(req.inputHref);
|
|
74
|
+
const output = await storage.presignOutput(req.outputHref);
|
|
75
|
+
return {
|
|
76
|
+
path: "/v3/audio-video/translate-async",
|
|
77
|
+
body: withOptions(
|
|
78
|
+
{
|
|
79
|
+
input: external(input.href),
|
|
80
|
+
targetLocale: req.targetLocale,
|
|
81
|
+
output: external(output.href),
|
|
82
|
+
},
|
|
83
|
+
req,
|
|
84
|
+
),
|
|
85
|
+
};
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
async generateSpeech(
|
|
90
|
+
req: GenerateSpeechRequest,
|
|
91
|
+
): Promise<Result<string, FireflyError>> {
|
|
92
|
+
return this.run(async () => {
|
|
93
|
+
const output = await getStoragePresigner().presignOutput(req.outputHref);
|
|
94
|
+
const body: Record<string, unknown> = {
|
|
95
|
+
text: req.text,
|
|
96
|
+
output: external(output.href),
|
|
97
|
+
};
|
|
98
|
+
if (req.voiceId !== undefined) body.voiceId = req.voiceId;
|
|
99
|
+
return { path: "/v3/audio/speech-async", body: withOptions(body, req) };
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async soundEffect(
|
|
104
|
+
req: SoundEffectRequest,
|
|
105
|
+
): Promise<Result<string, FireflyError>> {
|
|
106
|
+
return this.run(async () => {
|
|
107
|
+
const output = await getStoragePresigner().presignOutput(req.outputHref);
|
|
108
|
+
return {
|
|
109
|
+
path: "/v3/audio/sound-effect-async",
|
|
110
|
+
body: withOptions({ prompt: req.prompt, output: external(output.href) }, req),
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
private async run(
|
|
116
|
+
build: () => Promise<{ path: string; body: unknown }>,
|
|
117
|
+
): Promise<Result<string, FireflyError>> {
|
|
118
|
+
try {
|
|
119
|
+
const { path, body } = await build();
|
|
120
|
+
const handle = toJobHandle(await fireflyClient.post(path, body));
|
|
121
|
+
// A missing job id (e.g. an empty 202 body) can't be correlated and would
|
|
122
|
+
// collide in webhook mode — fail here with a precise error.
|
|
123
|
+
if (!handle.jobId) {
|
|
124
|
+
return err(
|
|
125
|
+
new FireflyError("Media submit response did not include a job id."),
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
// Long (minutes) jobs: await transparently polls or resolves a webhook.
|
|
129
|
+
const done = await jobPort.await(handle);
|
|
130
|
+
const href = done.outputs[0]?.href;
|
|
131
|
+
if (done.status !== "succeeded" || !href) {
|
|
132
|
+
return err(
|
|
133
|
+
new FireflyError(done.error ?? "Media job did not produce an output."),
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
return ok(href);
|
|
137
|
+
} catch (error) {
|
|
138
|
+
return err(classifyAdobeError(error));
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function external(href: string): { href: string; storage: "external" } {
|
|
144
|
+
return { href, storage: "external" };
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Forward the install/partner model (or the per-call override) plus an optional seed.
|
|
148
|
+
function withOptions(
|
|
149
|
+
body: Record<string, unknown>,
|
|
150
|
+
opts: MediaOptions,
|
|
151
|
+
): Record<string, unknown> {
|
|
152
|
+
const out: Record<string, unknown> = {
|
|
153
|
+
...body,
|
|
154
|
+
model: opts.model?.trim() || DEFAULT_MODEL,
|
|
155
|
+
};
|
|
156
|
+
if (opts.seed !== undefined) out.seed = opts.seed;
|
|
157
|
+
return out;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** Shared singleton. */
|
|
161
|
+
export const fireflyMedia = new FireflyMediaAdapter();
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "adobe-firefly-media",
|
|
3
|
+
"name": "Adobe Firefly — Audio/Video (Media)",
|
|
4
|
+
"description": "Audio/Video (Media) generation for Adobe Firefly Services (firefly-api.adobe.io): a MediaGenerationPort + adapter for text-to-video, image-to-video, audio/video translation, speech, and sound effects over the adobe-firefly-core foundation. Async and LONG (minutes) via FireflyJobPort; webhook job_mode strongly recommended. Partner models (Veo/Runway/Kling/ElevenLabs) are opaque model ids where entitled — no partner SDKs.",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"requires": ["adobe-firefly-core"],
|
|
7
|
+
"conflicts": [],
|
|
8
|
+
"questions": [
|
|
9
|
+
{
|
|
10
|
+
"id": "partner_model",
|
|
11
|
+
"type": "boolean",
|
|
12
|
+
"prompt": "Acknowledge partner-model routing (Veo/Runway/Kling/ElevenLabs as opaque model ids where entitled)?",
|
|
13
|
+
"default": false
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"envVars": ["ADOBE_FIREFLY_MEDIA_MODEL"],
|
|
17
|
+
"outputs": [
|
|
18
|
+
"src/domain/ports/out/media-generation.port.ts",
|
|
19
|
+
"src/infrastructure/adobe/media/firefly-media.adapter.ts",
|
|
20
|
+
".env.adobe-media.example"
|
|
21
|
+
],
|
|
22
|
+
"checklist": [
|
|
23
|
+
"Confirm the Audio/Video API entitlement + scope on your Adobe Developer Console project",
|
|
24
|
+
"Verify the current endpoints/payloads against Adobe docs — Firefly paths version frequently (this scaffold posts to the async /v3/videos/*-async, /v3/audio/*-async, and /v3/audio-video/translate-async endpoints, which return a job to await)",
|
|
25
|
+
"Long jobs (minutes): prefer webhook job_mode and raise ADOBE_WEBHOOK_TIMEOUT_MS; if polling, raise ADOBE_JOB_POLL_INTERVAL_MS to scale the poll interval up for these long jobs",
|
|
26
|
+
"Provide presigned input (image for imageToVideo, source media for translateAudioVideo) + output hrefs — use core passthrough or install an adobe-firefly-storage-* addon",
|
|
27
|
+
"Set the default model via ADOBE_FIREFLY_MEDIA_MODEL; pass a per-call model to override",
|
|
28
|
+
"Partner models (Veo/Runway/Kling/ElevenLabs) are passed as opaque model ids where your entitlement allows — no partner SDKs are bundled",
|
|
29
|
+
"Optional official SDK: npm install @adobe/firefly-services-sdk-js"
|
|
30
|
+
],
|
|
31
|
+
"branch": "feature/generator-template-adobe-firefly-media"
|
|
32
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Adobe Firefly — Azure Blob Presigned Storage (`adobe-firefly-storage-azure`)
|
|
2
|
+
|
|
3
|
+
> Registers an Azure Blob Storage presigner for the `adobe-firefly-core` storage seam, so every
|
|
4
|
+
> Firefly service can take plain blob names instead of pre-made SAS URLs.
|
|
5
|
+
|
|
6
|
+
| | |
|
|
7
|
+
| ------------- | ----------------------------------------------------------------------------------- |
|
|
8
|
+
| **ID** | `adobe-firefly-storage-azure` |
|
|
9
|
+
| **Category** | Adobe Firefly Services — storage presigner |
|
|
10
|
+
| **Requires** | `adobe-firefly-core` |
|
|
11
|
+
| **Conflicts** | `adobe-firefly-storage-s3`, `adobe-firefly-storage-gcs` (one presigner per project) |
|
|
12
|
+
| **Branch** | `feature/generator-template-adobe-firefly-storage-azure` |
|
|
13
|
+
|
|
14
|
+
Author/agent-facing reference, beside `manifest.json` — not emitted into projects.
|
|
15
|
+
|
|
16
|
+
## What it does
|
|
17
|
+
|
|
18
|
+
Swaps the core passthrough presigner for an Azure-backed one via `setStoragePresigner()`. Inputs
|
|
19
|
+
get a **read** SAS URL, outputs a **create/write** SAS URL, both tagged `storage: "external"` for
|
|
20
|
+
the Adobe APIs. An `http(s)` ref is passed through unchanged. Infrastructure-only — no new domain port.
|
|
21
|
+
|
|
22
|
+
## Service & API
|
|
23
|
+
|
|
24
|
+
- **Provider:** Azure Blob Storage (`@azure/storage-blob`), SAS via `generateBlobSASQueryParameters`.
|
|
25
|
+
- **Signing (two modes):**
|
|
26
|
+
- **Account key** — set `ADOBE_AZURE_STORAGE_KEY`; the SAS is signed locally (simplest off-Azure).
|
|
27
|
+
- **Managed identity** — leave the key unset; the adapter uses `DefaultAzureCredential`
|
|
28
|
+
(`@azure/identity`) to mint a **user-delegation** SAS. Nothing is hardcoded.
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
`hexagen add adobe-firefly-storage-azure`. Question:
|
|
33
|
+
|
|
34
|
+
| Question | Options (default) |
|
|
35
|
+
| -------------------- | -------------------------------------------------------------------- |
|
|
36
|
+
| `url_expiry_seconds` | `300` / `900` / `3600` (`900`) — SAS lifetime (clamped to 1..604800) |
|
|
37
|
+
|
|
38
|
+
Env: `ADOBE_AZURE_STORAGE_ACCOUNT`, `ADOBE_AZURE_CONTAINER`, `ADOBE_AZURE_STORAGE_KEY` (optional),
|
|
39
|
+
`ADOBE_AZURE_PREFIX`. Emits `azure-blob-presign.adapter.ts` (`AzureBlobPresignStorageAdapter`),
|
|
40
|
+
`azure-register.ts`, `.env.adobe-storage-azure.example`.
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
// Register ONCE at startup, before any Firefly service call:
|
|
46
|
+
import "@/infrastructure/adobe/storage/azure-register";
|
|
47
|
+
|
|
48
|
+
// Thereafter, pass blob names (not full URLs) as input/output refs:
|
|
49
|
+
await fireflyUpscale.upscale({
|
|
50
|
+
inputHref: "in/small.png",
|
|
51
|
+
outputHref: "out/large.png",
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Configuration
|
|
56
|
+
|
|
57
|
+
| Env var | Purpose |
|
|
58
|
+
| ----------------------------- | ------------------------------------------------------------------ |
|
|
59
|
+
| `ADOBE_AZURE_STORAGE_ACCOUNT` | storage account name (read at presign time) |
|
|
60
|
+
| `ADOBE_AZURE_CONTAINER` | blob container |
|
|
61
|
+
| `ADOBE_AZURE_STORAGE_KEY` | optional account key; unset → managed-identity user-delegation SAS |
|
|
62
|
+
| `ADOBE_AZURE_PREFIX` | optional blob-name prefix (leading/trailing slashes normalised) |
|
|
63
|
+
|
|
64
|
+
## Notes for agents
|
|
65
|
+
|
|
66
|
+
- **No `deps` field exists in manifests** — installing the SDKs is a checklist step:
|
|
67
|
+
`npm install @azure/storage-blob @azure/identity`.
|
|
68
|
+
- **Managed-identity (keyless) signing** mints a _user-delegation_ SAS — grant the identity the
|
|
69
|
+
**Storage Blob Delegator** role (which grants
|
|
70
|
+
`Microsoft.Storage/storageAccounts/blobServices/generateUserDelegationKey/action`, required to mint
|
|
71
|
+
the delegation key) plus **Storage Blob Data Contributor** for the blob read/write, or
|
|
72
|
+
`getUserDelegationKey` fails.
|
|
73
|
+
- Account/container/prefix are **read at presign time** (and the `BlobServiceClient` built lazily),
|
|
74
|
+
so a `.env` loaded after `azure-register`'s side-effect import is honoured and startup stays
|
|
75
|
+
crash-free. Refs reject `..` path traversal.
|
|
76
|
+
- Mutually exclusive with the S3/GCS presigners (declared `conflicts`).
|
|
77
|
+
|
|
78
|
+
## Checklist (post-install)
|
|
79
|
+
|
|
80
|
+
Install `@azure/storage-blob @azure/identity`; set account + container; choose account-key or
|
|
81
|
+
managed-identity signing (for keyless, grant the identity **Storage Blob Delegator** +
|
|
82
|
+
**Storage Blob Data Contributor**); import `azure-register` once at startup; pass blob names (not
|
|
83
|
+
URLs) as refs.
|
|
84
|
+
|
|
85
|
+
## Related
|
|
86
|
+
|
|
87
|
+
Foundation: [`adobe-firefly-core`](../adobe-firefly-core) (the storage seam). Alternatives:
|
|
88
|
+
[`adobe-firefly-storage-s3`](../adobe-firefly-storage-s3), [`adobe-firefly-storage-gcs`](../adobe-firefly-storage-gcs).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# --- Adobe Firefly — Azure Blob Presigned Storage ---
|
|
2
|
+
# Mints SAS URLs (read for inputs, create/write for outputs). Set the account +
|
|
3
|
+
# container. Signing: set ADOBE_AZURE_STORAGE_KEY for account-key signing, OR leave
|
|
4
|
+
# it unset to use a managed identity (DefaultAzureCredential) user-delegation SAS.
|
|
5
|
+
# SAS lifetime is set at install time (url_expiry_seconds).
|
|
6
|
+
ADOBE_AZURE_STORAGE_ACCOUNT= # required
|
|
7
|
+
ADOBE_AZURE_CONTAINER= # required
|
|
8
|
+
ADOBE_AZURE_STORAGE_KEY= # optional; unset = managed-identity (user-delegation) SAS
|
|
9
|
+
ADOBE_AZURE_PREFIX=
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
// @hexagen-server-only
|
|
2
|
+
import {
|
|
3
|
+
BlobServiceClient,
|
|
4
|
+
StorageSharedKeyCredential,
|
|
5
|
+
BlobSASPermissions,
|
|
6
|
+
generateBlobSASQueryParameters,
|
|
7
|
+
type UserDelegationKey,
|
|
8
|
+
} from "@azure/storage-blob";
|
|
9
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
10
|
+
import type {
|
|
11
|
+
FireflyStoragePort,
|
|
12
|
+
PresignedHref,
|
|
13
|
+
} from "../../../domain/ports/out/firefly-storage.port";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Azure Blob Storage presigner for the Firefly storage seam.
|
|
17
|
+
*
|
|
18
|
+
* Firefly reads inputs and writes outputs via presigned URLs (`storage:
|
|
19
|
+
* "external"`). This adapter mints a read SAS for inputs and a create/write SAS
|
|
20
|
+
* for outputs against `ADOBE_AZURE_CONTAINER` in `ADOBE_AZURE_STORAGE_ACCOUNT`.
|
|
21
|
+
*
|
|
22
|
+
* Signing: if `ADOBE_AZURE_STORAGE_KEY` is set, the SAS is signed locally with the
|
|
23
|
+
* account key; otherwise the adapter falls back to a managed identity
|
|
24
|
+
* (`DefaultAzureCredential`) and mints a USER-DELEGATION SAS — nothing is hardcoded.
|
|
25
|
+
*
|
|
26
|
+
* Refs are treated as blob names (an optional ADOBE_AZURE_PREFIX is applied). A ref
|
|
27
|
+
* that is already an http(s) URL is returned unchanged, so callers may mix
|
|
28
|
+
* pre-signed hrefs with blob names.
|
|
29
|
+
*/
|
|
30
|
+
// Interpolated from the url_expiry_seconds answer. Validate + clamp so a bad or
|
|
31
|
+
// overridden value never produces a NaN/out-of-range expiry. We deliberately fall
|
|
32
|
+
// back rather than throw at module scope — this file is imported at startup (via
|
|
33
|
+
// azure-register), so a throw here would crash the app. SAS lifetimes are bounded
|
|
34
|
+
// to 1..604800s (7 days, the user-delegation ceiling); default 900 (15 min).
|
|
35
|
+
const URL_EXPIRY_SECONDS = resolveExpiry(Number("{url_expiry_seconds}"));
|
|
36
|
+
|
|
37
|
+
function resolveExpiry(value: number): number {
|
|
38
|
+
if (!Number.isFinite(value) || value <= 0) return 900;
|
|
39
|
+
// Clamp AFTER flooring — a fractional value like 0.5 floors to 0, out of range.
|
|
40
|
+
return Math.max(1, Math.min(Math.floor(value), 604_800));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Back-date SAS/key starts a little to absorb clock skew.
|
|
44
|
+
const CLOCK_SKEW_MS = 5 * 60_000;
|
|
45
|
+
// In managed-identity mode the user-delegation key is reused for this long beyond a
|
|
46
|
+
// SAS window, so a single Firefly request (which presigns 2–3+ refs) makes ONE
|
|
47
|
+
// getUserDelegationKey control-plane call instead of one per ref.
|
|
48
|
+
const DELEGATION_KEY_CACHE_MS = 5 * 60_000;
|
|
49
|
+
// User-delegation keys (and the SAS they sign) max out at 7 days.
|
|
50
|
+
const MAX_SAS_WINDOW_MS = 604_800 * 1000;
|
|
51
|
+
|
|
52
|
+
export class AzureBlobPresignStorageAdapter implements FireflyStoragePort {
|
|
53
|
+
private service: BlobServiceClient | undefined;
|
|
54
|
+
// Cached managed-identity user-delegation key + the epoch ms it is valid until.
|
|
55
|
+
private delegationKey: UserDelegationKey | undefined;
|
|
56
|
+
private delegationKeyExpiresOnMs = 0;
|
|
57
|
+
|
|
58
|
+
constructor(service?: BlobServiceClient) {
|
|
59
|
+
// Capture NO env here (same reasoning as the s3/gcs presigners). This adapter is
|
|
60
|
+
// constructed at import time by azure-register.ts (a side-effect import at
|
|
61
|
+
// startup), so the service client is built lazily and account/container/prefix
|
|
62
|
+
// are read at presign time — a .env loaded later is honoured, startup stays
|
|
63
|
+
// crash-free, and config is validated at the point of use.
|
|
64
|
+
this.service = service;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
private getService(): BlobServiceClient {
|
|
68
|
+
if (this.service) return this.service;
|
|
69
|
+
const account = requireEnv("ADOBE_AZURE_STORAGE_ACCOUNT", "storage account");
|
|
70
|
+
const url = `https://${account}.blob.core.windows.net`;
|
|
71
|
+
const key = process.env.ADOBE_AZURE_STORAGE_KEY?.trim();
|
|
72
|
+
// Return a local so the result is statically BlobServiceClient (strict TS won't
|
|
73
|
+
// narrow the optional field across the assignment).
|
|
74
|
+
const created = key
|
|
75
|
+
? new BlobServiceClient(url, new StorageSharedKeyCredential(account, key))
|
|
76
|
+
: new BlobServiceClient(url, new DefaultAzureCredential());
|
|
77
|
+
this.service = created;
|
|
78
|
+
return created;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async presignInput(ref: string): Promise<PresignedHref> {
|
|
82
|
+
if (isHttpUrl(ref)) return { href: ref };
|
|
83
|
+
return { href: await this.sign(ref, "read") };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async presignOutput(ref: string): Promise<PresignedHref> {
|
|
87
|
+
if (isHttpUrl(ref)) return { href: ref };
|
|
88
|
+
return { href: await this.sign(ref, "write") };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
private async sign(ref: string, action: "read" | "write"): Promise<string> {
|
|
92
|
+
const account = requireEnv("ADOBE_AZURE_STORAGE_ACCOUNT", "storage account");
|
|
93
|
+
const container = requireEnv("ADOBE_AZURE_CONTAINER", "blob container");
|
|
94
|
+
const blobName = this.key(ref);
|
|
95
|
+
const blobClient = this.getService()
|
|
96
|
+
.getContainerClient(container)
|
|
97
|
+
.getBlobClient(blobName);
|
|
98
|
+
|
|
99
|
+
// Back-date the start a little for clock skew; bound the end by the install TTL.
|
|
100
|
+
const startsOn = new Date(Date.now() - CLOCK_SKEW_MS);
|
|
101
|
+
const expiresOn = new Date(Date.now() + URL_EXPIRY_SECONDS * 1000);
|
|
102
|
+
// read → "r"; write → create + write so Firefly can create the output blob.
|
|
103
|
+
const permissions = BlobSASPermissions.parse(action === "read" ? "r" : "cw");
|
|
104
|
+
const values = { containerName: container, blobName, permissions, startsOn, expiresOn };
|
|
105
|
+
|
|
106
|
+
const key = process.env.ADOBE_AZURE_STORAGE_KEY?.trim();
|
|
107
|
+
const sas = key
|
|
108
|
+
? generateBlobSASQueryParameters(
|
|
109
|
+
values,
|
|
110
|
+
new StorageSharedKeyCredential(account, key),
|
|
111
|
+
)
|
|
112
|
+
: generateBlobSASQueryParameters(
|
|
113
|
+
values,
|
|
114
|
+
// No key → reuse a cached user-delegation key (one control-plane call per
|
|
115
|
+
// ~window, not per presign), minted via the managed identity.
|
|
116
|
+
await this.getDelegationKey(expiresOn.getTime()),
|
|
117
|
+
account,
|
|
118
|
+
);
|
|
119
|
+
return `${blobClient.url}?${sas.toString()}`;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private async getDelegationKey(
|
|
123
|
+
neededUntilMs: number,
|
|
124
|
+
): Promise<UserDelegationKey> {
|
|
125
|
+
// Reuse the cached key while it still covers this SAS's expiry — the SAS expiry
|
|
126
|
+
// must fall within the key's validity window.
|
|
127
|
+
if (this.delegationKey && this.delegationKeyExpiresOnMs >= neededUntilMs) {
|
|
128
|
+
return this.delegationKey;
|
|
129
|
+
}
|
|
130
|
+
// Mint a key valid a little beyond the SAS window so the next few presigns reuse
|
|
131
|
+
// it; never exceed the 7-day user-delegation ceiling.
|
|
132
|
+
const startsOn = new Date(Date.now() - CLOCK_SKEW_MS);
|
|
133
|
+
const expiresOnMs = Math.min(
|
|
134
|
+
neededUntilMs + DELEGATION_KEY_CACHE_MS,
|
|
135
|
+
Date.now() + MAX_SAS_WINDOW_MS,
|
|
136
|
+
);
|
|
137
|
+
const key = await this.getService().getUserDelegationKey(
|
|
138
|
+
startsOn,
|
|
139
|
+
new Date(expiresOnMs),
|
|
140
|
+
);
|
|
141
|
+
this.delegationKey = key;
|
|
142
|
+
this.delegationKeyExpiresOnMs = expiresOnMs;
|
|
143
|
+
return key;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
private key(ref: string): string {
|
|
147
|
+
const cleanRef = ref.replace(/^\/+/, "");
|
|
148
|
+
// Reject path traversal so a ref can never escape ADOBE_AZURE_PREFIX.
|
|
149
|
+
if (cleanRef.split("/").some((segment) => segment === "..")) {
|
|
150
|
+
throw new Error(`Invalid Azure blob name ${JSON.stringify(ref)}: path traversal ("..") is not allowed.`);
|
|
151
|
+
}
|
|
152
|
+
// Normalise the prefix at call time to a slash-free segment so a "/firefly"
|
|
153
|
+
// (path-style) prefix can't yield blob names that start with "/".
|
|
154
|
+
const prefix = (process.env.ADOBE_AZURE_PREFIX ?? "").replace(/^\/+/, "").replace(/\/+$/, "");
|
|
155
|
+
if (!prefix) return cleanRef;
|
|
156
|
+
return `${prefix}/${cleanRef}`;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function requireEnv(name: string, label: string): string {
|
|
161
|
+
// Read at call time so a .env loaded after this module is imported is honoured.
|
|
162
|
+
const value = process.env[name]?.trim();
|
|
163
|
+
if (!value) {
|
|
164
|
+
throw new Error(`${name} is not set — set the ${label} the Firefly Azure presigner uses.`);
|
|
165
|
+
}
|
|
166
|
+
return value;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function isHttpUrl(value: string): boolean {
|
|
170
|
+
return /^https?:\/\//i.test(value);
|
|
171
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @hexagen-server-only
|
|
2
|
+
//
|
|
3
|
+
// Registers the Azure Blob presigner with the core storage seam. Import this ONCE
|
|
4
|
+
// at startup, before any Firefly service call:
|
|
5
|
+
//
|
|
6
|
+
// import "./infrastructure/adobe/storage/azure-register";
|
|
7
|
+
//
|
|
8
|
+
// Side-effect only (like the bedrock provider registration): it swaps the core
|
|
9
|
+
// `passthrough` default for the Azure presigner via `setStoragePresigner`, so
|
|
10
|
+
// service adapters resolve it through `getStoragePresigner()` with no static
|
|
11
|
+
// import of this addon file.
|
|
12
|
+
import { setStoragePresigner } from "./passthrough-storage.adapter";
|
|
13
|
+
import { AzureBlobPresignStorageAdapter } from "./azure-blob-presign.adapter";
|
|
14
|
+
|
|
15
|
+
setStoragePresigner(new AzureBlobPresignStorageAdapter());
|