@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,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "adobe-firefly-storage-azure",
|
|
3
|
+
"name": "Adobe Firefly — Azure Blob Presigned Storage",
|
|
4
|
+
"description": "Registers an Azure Blob Storage presigner for the adobe-firefly-core storage seam: mints read SAS URLs for Firefly inputs and create/write SAS URLs for outputs (storage: \"external\"). Signs with an account key, or a managed-identity user-delegation key when no key is set. Mutually exclusive with the S3/GCS presigners. Install @azure/storage-blob + @azure/identity.",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"requires": ["adobe-firefly-core"],
|
|
7
|
+
"conflicts": ["adobe-firefly-storage-s3", "adobe-firefly-storage-gcs"],
|
|
8
|
+
"questions": [
|
|
9
|
+
{
|
|
10
|
+
"id": "url_expiry_seconds",
|
|
11
|
+
"type": "select",
|
|
12
|
+
"prompt": "Presigned-URL (SAS) lifetime (seconds)?",
|
|
13
|
+
"options": ["300", "900", "3600"],
|
|
14
|
+
"default": "900"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"envVars": [
|
|
18
|
+
"ADOBE_AZURE_STORAGE_ACCOUNT",
|
|
19
|
+
"ADOBE_AZURE_CONTAINER",
|
|
20
|
+
"ADOBE_AZURE_STORAGE_KEY",
|
|
21
|
+
"ADOBE_AZURE_PREFIX"
|
|
22
|
+
],
|
|
23
|
+
"outputs": [
|
|
24
|
+
"src/infrastructure/adobe/storage/azure-blob-presign.adapter.ts",
|
|
25
|
+
"src/infrastructure/adobe/storage/azure-register.ts",
|
|
26
|
+
".env.adobe-storage-azure.example"
|
|
27
|
+
],
|
|
28
|
+
"checklist": [
|
|
29
|
+
"Install the Azure SDKs (the only channel — manifests have no deps field): npm install @azure/storage-blob @azure/identity",
|
|
30
|
+
"Set ADOBE_AZURE_STORAGE_ACCOUNT (the storage account name) and ADOBE_AZURE_CONTAINER",
|
|
31
|
+
"Account-key signing: set ADOBE_AZURE_STORAGE_KEY (a storage account access key) — signs the SAS locally; simplest for non-Azure hosts",
|
|
32
|
+
"Managed-identity signing (recommended on Azure): leave ADOBE_AZURE_STORAGE_KEY unset — the adapter falls back to DefaultAzureCredential and mints a USER-DELEGATION SAS. Grant the identity the Storage Blob Delegator role (which grants Microsoft.Storage/storageAccounts/blobServices/generateUserDelegationKey/action, required to mint the delegation key) plus Storage Blob Data Contributor for the blob read/write the SAS performs",
|
|
33
|
+
"Import the registration once at startup, before any Firefly service call: import './infrastructure/adobe/storage/azure-register'",
|
|
34
|
+
"Pass blob names (not full URLs) as input/output refs — the adapter mints a read SAS for inputs and a create/write SAS for outputs (an http(s) ref is passed through unchanged)"
|
|
35
|
+
],
|
|
36
|
+
"branch": "feature/generator-template-adobe-firefly-storage-azure"
|
|
37
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Adobe Firefly — GCS Presigned Storage (`adobe-firefly-storage-gcs`)
|
|
2
|
+
|
|
3
|
+
> Registers a Google Cloud Storage presigner for the `adobe-firefly-core` storage seam, so every
|
|
4
|
+
> Firefly service can take plain GCS object names instead of pre-made presigned URLs.
|
|
5
|
+
|
|
6
|
+
| | |
|
|
7
|
+
| ------------- | ------------------------------------------------------------------------------------- |
|
|
8
|
+
| **ID** | `adobe-firefly-storage-gcs` |
|
|
9
|
+
| **Category** | Adobe Firefly Services — storage presigner |
|
|
10
|
+
| **Requires** | `adobe-firefly-core` |
|
|
11
|
+
| **Conflicts** | `adobe-firefly-storage-s3`, `adobe-firefly-storage-azure` (one presigner per project) |
|
|
12
|
+
| **Branch** | `feature/generator-template-adobe-firefly-storage-gcs` |
|
|
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 a GCS-backed one via `setStoragePresigner()`. Inputs get
|
|
19
|
+
a **V4 read** signed URL, outputs a **V4 write** signed 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:** Google Cloud Storage (`@google-cloud/storage`), V4 signed URLs (`getSignedUrl`).
|
|
25
|
+
- **Credentials:** the Google Application Default Credentials chain (`GOOGLE_APPLICATION_CREDENTIALS`
|
|
26
|
+
locally; the attached service account on Cloud Run/GCE/GKE). Signing uses the SA private key, or
|
|
27
|
+
the IAM SignBlob API when no key file is present. No region concept (GCS buckets are global-addressed).
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
`hexagen add adobe-firefly-storage-gcs`. Question:
|
|
32
|
+
|
|
33
|
+
| Question | Options (default) |
|
|
34
|
+
| -------------------- | --------------------------------------------------------------------------- |
|
|
35
|
+
| `url_expiry_seconds` | `300` / `900` / `3600` (`900`) — signed-URL lifetime (clamped to 1..604800) |
|
|
36
|
+
|
|
37
|
+
Env: `ADOBE_GCS_BUCKET`, `ADOBE_GCS_PREFIX`. Emits `gcs-presign.adapter.ts`
|
|
38
|
+
(`GcsPresignStorageAdapter`), `gcs-register.ts`, `.env.adobe-storage-gcs.example`.
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
// Register ONCE at startup, before any Firefly service call:
|
|
44
|
+
import "@/infrastructure/adobe/storage/gcs-register";
|
|
45
|
+
|
|
46
|
+
// Thereafter, pass GCS object names (not full URLs) as input/output refs:
|
|
47
|
+
await fireflyUpscale.upscale({
|
|
48
|
+
inputHref: "in/small.png",
|
|
49
|
+
outputHref: "out/large.png",
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Configuration
|
|
54
|
+
|
|
55
|
+
| Env var | Purpose |
|
|
56
|
+
| ------------------ | -------------------------------------------------------------------------- |
|
|
57
|
+
| `ADOBE_GCS_BUCKET` | bucket the presigner signs against (validated at presign time, not import) |
|
|
58
|
+
| `ADOBE_GCS_PREFIX` | optional object-name prefix (leading/trailing slashes normalised) |
|
|
59
|
+
|
|
60
|
+
## Notes for agents
|
|
61
|
+
|
|
62
|
+
- **No `deps` field exists in manifests** — installing the SDK is a checklist step:
|
|
63
|
+
`npm install @google-cloud/storage`.
|
|
64
|
+
- **V4 signing without a key file** uses the IAM Credentials SignBlob API — grant the SA
|
|
65
|
+
`roles/iam.serviceAccountTokenCreator` on itself and enable the IAM Credentials API.
|
|
66
|
+
- **Keyless signing (ADC without a key file — metadata server / Workload Identity) makes one
|
|
67
|
+
SignBlob round-trip _per presigned URL_.** GCS signs each V4 URL
|
|
68
|
+
individually — the signature is per-URL, so there's no reusable key to cache (unlike Azure's
|
|
69
|
+
user-delegation key). Firefly adapters presign 2–3+ refs per request, so this is N control-plane
|
|
70
|
+
calls per request in keyless mode. To sign **locally** with no per-URL calls, supply a
|
|
71
|
+
service-account key file via `GOOGLE_APPLICATION_CREDENTIALS`.
|
|
72
|
+
- Bucket validation is **deferred to presign time** (`requireBucket`) so a missing bucket can't crash
|
|
73
|
+
startup when `gcs-register` is imported. Refs reject `..` path traversal so they can't escape the prefix.
|
|
74
|
+
- Mutually exclusive with the S3/Azure presigners (declared `conflicts`).
|
|
75
|
+
|
|
76
|
+
## Checklist (post-install)
|
|
77
|
+
|
|
78
|
+
Install `@google-cloud/storage`; set `ADOBE_GCS_BUCKET` and grant the SA object viewer+creator (or
|
|
79
|
+
objectAdmin); provide ADC credentials; grant `serviceAccountTokenCreator` for keyless signing; import
|
|
80
|
+
`gcs-register` once at startup; pass object names (not URLs) as refs.
|
|
81
|
+
|
|
82
|
+
## Related
|
|
83
|
+
|
|
84
|
+
Foundation: [`adobe-firefly-core`](../adobe-firefly-core) (the storage seam). Alternatives:
|
|
85
|
+
[`adobe-firefly-storage-s3`](../adobe-firefly-storage-s3); `adobe-firefly-storage-azure` (design-only).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# --- Adobe Firefly — GCS Presigned Storage ---
|
|
2
|
+
# The presigner needs the bucket; credentials resolve from the Google Application
|
|
3
|
+
# Default Credentials chain (GOOGLE_APPLICATION_CREDENTIALS / Cloud Run / GCE
|
|
4
|
+
# metadata). V4 signing uses the service-account key locally, or the IAM SignBlob
|
|
5
|
+
# API when no key file is present. Presigned-URL lifetime is set at install time
|
|
6
|
+
# (url_expiry_seconds).
|
|
7
|
+
ADOBE_GCS_BUCKET= # required
|
|
8
|
+
ADOBE_GCS_PREFIX=
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// @hexagen-server-only
|
|
2
|
+
import { Storage } from "@google-cloud/storage";
|
|
3
|
+
import type {
|
|
4
|
+
FireflyStoragePort,
|
|
5
|
+
PresignedHref,
|
|
6
|
+
} from "../../../domain/ports/out/firefly-storage.port";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Google Cloud Storage presigner for the Firefly storage seam.
|
|
10
|
+
*
|
|
11
|
+
* Firefly reads inputs and writes outputs via presigned URLs (`storage:
|
|
12
|
+
* "external"`). This adapter signs a V4 read URL for inputs and a V4 write URL
|
|
13
|
+
* for outputs against `ADOBE_GCS_BUCKET`. Credentials resolve from the Google
|
|
14
|
+
* Application Default Credentials chain (GOOGLE_APPLICATION_CREDENTIALS / the
|
|
15
|
+
* Cloud Run / GCE metadata server) — nothing is hardcoded; V4 signing uses the
|
|
16
|
+
* service-account private key locally, or the IAM SignBlob API when no key file
|
|
17
|
+
* is present.
|
|
18
|
+
*
|
|
19
|
+
* Refs are treated as GCS object names (an optional ADOBE_GCS_PREFIX is applied).
|
|
20
|
+
* A ref that is already an http(s) URL is returned unchanged, so callers may mix
|
|
21
|
+
* pre-presigned hrefs with object names.
|
|
22
|
+
*/
|
|
23
|
+
// Interpolated from the url_expiry_seconds answer. Validate + clamp so a bad or
|
|
24
|
+
// overridden value never reaches getSignedUrl as NaN/out-of-range. We deliberately
|
|
25
|
+
// fall back rather than throw at module scope — this file is imported at startup
|
|
26
|
+
// (via gcs-register), so a throw here would crash the app. GCS V4 signed URLs allow
|
|
27
|
+
// 1..604800s (7 days); default to 900 (15 min) on an invalid value.
|
|
28
|
+
const URL_EXPIRY_SECONDS = resolveExpiry(Number("{url_expiry_seconds}"));
|
|
29
|
+
|
|
30
|
+
function resolveExpiry(value: number): number {
|
|
31
|
+
if (!Number.isFinite(value) || value <= 0) return 900;
|
|
32
|
+
// Clamp AFTER flooring — a fractional value like 0.5 floors to 0, which is
|
|
33
|
+
// outside the 1..604800 range GCS accepts.
|
|
34
|
+
return Math.max(1, Math.min(Math.floor(value), 604_800));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export class GcsPresignStorageAdapter implements FireflyStoragePort {
|
|
38
|
+
private readonly storage: Storage;
|
|
39
|
+
|
|
40
|
+
constructor(storage?: Storage) {
|
|
41
|
+
// Credentials + project resolve from the Google ADC chain; never hardcoded.
|
|
42
|
+
// Bucket/prefix are NOT captured here — they're read from process.env at
|
|
43
|
+
// presign time. This adapter is constructed at import time by gcs-register.ts
|
|
44
|
+
// (a side-effect import at startup), so snapshotting env in the constructor
|
|
45
|
+
// would permanently lock in whatever was set before .env loaded. Reading at
|
|
46
|
+
// call time honours a .env loaded later AND keeps startup crash-free
|
|
47
|
+
// (validation stays deferred to presign time).
|
|
48
|
+
this.storage = storage ?? new Storage();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async presignInput(ref: string): Promise<PresignedHref> {
|
|
52
|
+
if (isHttpUrl(ref)) return { href: ref };
|
|
53
|
+
return { href: await this.sign(ref, "read") };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async presignOutput(ref: string): Promise<PresignedHref> {
|
|
57
|
+
if (isHttpUrl(ref)) return { href: ref };
|
|
58
|
+
return { href: await this.sign(ref, "write") };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private async sign(ref: string, action: "read" | "write"): Promise<string> {
|
|
62
|
+
const [url] = await this.storage
|
|
63
|
+
.bucket(this.requireBucket())
|
|
64
|
+
.file(this.key(ref))
|
|
65
|
+
.getSignedUrl({
|
|
66
|
+
version: "v4",
|
|
67
|
+
action,
|
|
68
|
+
// GCS takes an absolute expiry; the SDK enforces the 7-day V4 ceiling.
|
|
69
|
+
expires: Date.now() + URL_EXPIRY_SECONDS * 1000,
|
|
70
|
+
});
|
|
71
|
+
return url;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
private requireBucket(): string {
|
|
75
|
+
// Read at call time so a .env loaded after this module is imported is honoured.
|
|
76
|
+
// Fail loud + fast at the point of use (a config error), not at import.
|
|
77
|
+
const bucket = process.env.ADOBE_GCS_BUCKET?.trim();
|
|
78
|
+
if (!bucket) {
|
|
79
|
+
throw new Error("ADOBE_GCS_BUCKET is not set — set the bucket the Firefly GCS presigner uses.");
|
|
80
|
+
}
|
|
81
|
+
return bucket;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
private key(ref: string): string {
|
|
85
|
+
const cleanRef = ref.replace(/^\/+/, "");
|
|
86
|
+
// Reject path traversal so a ref can never escape ADOBE_GCS_PREFIX.
|
|
87
|
+
if (cleanRef.split("/").some((segment) => segment === "..")) {
|
|
88
|
+
throw new Error(`Invalid GCS object name ${JSON.stringify(ref)}: path traversal ("..") is not allowed.`);
|
|
89
|
+
}
|
|
90
|
+
// Normalise the prefix at call time to a slash-free segment so a "/firefly"
|
|
91
|
+
// (path-style) prefix can't yield object names that start with "/".
|
|
92
|
+
const prefix = (process.env.ADOBE_GCS_PREFIX ?? "").replace(/^\/+/, "").replace(/\/+$/, "");
|
|
93
|
+
if (!prefix) return cleanRef;
|
|
94
|
+
return `${prefix}/${cleanRef}`;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function isHttpUrl(value: string): boolean {
|
|
99
|
+
return /^https?:\/\//i.test(value);
|
|
100
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @hexagen-server-only
|
|
2
|
+
//
|
|
3
|
+
// Registers the GCS presigner with the core storage seam. Import this ONCE at
|
|
4
|
+
// startup, before any Firefly service call:
|
|
5
|
+
//
|
|
6
|
+
// import "./infrastructure/adobe/storage/gcs-register";
|
|
7
|
+
//
|
|
8
|
+
// Side-effect only (like the bedrock provider registration): it swaps the core
|
|
9
|
+
// `passthrough` default for the GCS 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 { GcsPresignStorageAdapter } from "./gcs-presign.adapter";
|
|
14
|
+
|
|
15
|
+
setStoragePresigner(new GcsPresignStorageAdapter());
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "adobe-firefly-storage-gcs",
|
|
3
|
+
"name": "Adobe Firefly — GCS Presigned Storage",
|
|
4
|
+
"description": "Registers a Google Cloud Storage presigner for the adobe-firefly-core storage seam: signs V4 read URLs for Firefly inputs and V4 write URLs for outputs (storage: \"external\"). Mutually exclusive with the S3/Azure presigners. Install @google-cloud/storage.",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"requires": ["adobe-firefly-core"],
|
|
7
|
+
"conflicts": ["adobe-firefly-storage-s3", "adobe-firefly-storage-azure"],
|
|
8
|
+
"questions": [
|
|
9
|
+
{
|
|
10
|
+
"id": "url_expiry_seconds",
|
|
11
|
+
"type": "select",
|
|
12
|
+
"prompt": "Presigned-URL lifetime (seconds)?",
|
|
13
|
+
"options": ["300", "900", "3600"],
|
|
14
|
+
"default": "900"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"envVars": ["ADOBE_GCS_BUCKET", "ADOBE_GCS_PREFIX"],
|
|
18
|
+
"outputs": [
|
|
19
|
+
"src/infrastructure/adobe/storage/gcs-presign.adapter.ts",
|
|
20
|
+
"src/infrastructure/adobe/storage/gcs-register.ts",
|
|
21
|
+
".env.adobe-storage-gcs.example"
|
|
22
|
+
],
|
|
23
|
+
"checklist": [
|
|
24
|
+
"Install the Google Cloud Storage SDK (the only channel — manifests have no deps field): npm install @google-cloud/storage",
|
|
25
|
+
"Set ADOBE_GCS_BUCKET; grant the runtime service account access on it (roles/storage.objectViewer for inputs + roles/storage.objectCreator for outputs, or roles/storage.objectAdmin for both)",
|
|
26
|
+
"Provide credentials via the Google ADC chain: set GOOGLE_APPLICATION_CREDENTIALS to a service-account key for local dev; on Cloud Run/GCE/GKE use the attached service account",
|
|
27
|
+
"V4 signing without a local key file uses the IAM Credentials SignBlob API — grant the service account roles/iam.serviceAccountTokenCreator on itself and enable the IAM Credentials API, or getSignedUrl cannot sign",
|
|
28
|
+
"Performance: keyless signing (ADC WITHOUT a key file — e.g. the GCE/Cloud Run metadata server or Workload Identity) makes one IAM SignBlob round-trip per presigned URL — GCS signs each V4 URL individually, so there is no reusable key to cache (unlike Azure's user-delegation key). Firefly presigns 2-3+ refs per request; supply a service-account key file via GOOGLE_APPLICATION_CREDENTIALS to sign locally and avoid the per-URL round-trips",
|
|
29
|
+
"Import the registration once at startup, before any Firefly service call: import './infrastructure/adobe/storage/gcs-register'",
|
|
30
|
+
"Pass GCS object names (not full URLs) as input/output refs — the adapter signs read for inputs, write for outputs (an http(s) ref is passed through unchanged)"
|
|
31
|
+
],
|
|
32
|
+
"branch": "feature/generator-template-adobe-firefly-storage-gcs"
|
|
33
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Adobe Firefly — S3 Presigned Storage (`adobe-firefly-storage-s3`)
|
|
2
|
+
|
|
3
|
+
> Registers an Amazon S3 presigner for the `adobe-firefly-core` storage seam, so every
|
|
4
|
+
> Firefly service can take plain S3 keys instead of pre-made presigned URLs.
|
|
5
|
+
|
|
6
|
+
| | |
|
|
7
|
+
| ------------- | -------------------------------------------------------------------------------------- |
|
|
8
|
+
| **ID** | `adobe-firefly-storage-s3` |
|
|
9
|
+
| **Category** | Adobe Firefly Services — storage presigner |
|
|
10
|
+
| **Requires** | `adobe-firefly-core` |
|
|
11
|
+
| **Conflicts** | `adobe-firefly-storage-gcs`, `adobe-firefly-storage-azure` (one presigner per project) |
|
|
12
|
+
| **Branch** | `feature/generator-template-adobe-firefly-storage-s3` |
|
|
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 S3-backed one via `setStoragePresigner()`.
|
|
19
|
+
Inputs get a presigned **GET** URL, outputs a presigned **PUT** URL, both tagged
|
|
20
|
+
`storage: "external"` for the Adobe APIs. An `http(s)` ref is passed through unchanged.
|
|
21
|
+
This is infrastructure-only — no new domain port.
|
|
22
|
+
|
|
23
|
+
## Service & API
|
|
24
|
+
|
|
25
|
+
- **Provider:** Amazon S3 (`@aws-sdk/client-s3` + `@aws-sdk/s3-request-presigner`).
|
|
26
|
+
- Region + credentials use the standard AWS chain (IAM role on AWS infra, `AWS_*` locally).
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
`hexagen add adobe-firefly-storage-s3`. Question:
|
|
31
|
+
|
|
32
|
+
| Question | Options (default) |
|
|
33
|
+
| -------------------- | ------------------------------------------------------- |
|
|
34
|
+
| `url_expiry_seconds` | `300` / `900` / `3600` (`900`) — presigned-URL lifetime |
|
|
35
|
+
|
|
36
|
+
Env: `ADOBE_S3_BUCKET`, `ADOBE_S3_REGION`, `ADOBE_S3_PREFIX`. Emits
|
|
37
|
+
`s3-presign.adapter.ts` (`S3PresignStorageAdapter`), `s3-register.ts`,
|
|
38
|
+
`.env.adobe-storage-s3.example`.
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
// Register ONCE at startup, before any Firefly service call:
|
|
44
|
+
import "@/infrastructure/adobe/storage/s3-register";
|
|
45
|
+
|
|
46
|
+
// Thereafter, pass S3 object keys (not full URLs) as input/output refs:
|
|
47
|
+
await fireflyUpscale.upscale({
|
|
48
|
+
inputHref: "in/small.png",
|
|
49
|
+
outputHref: "out/large.png",
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Configuration
|
|
54
|
+
|
|
55
|
+
| Env var | Purpose |
|
|
56
|
+
| ----------------- | ------------------------------------------------------ |
|
|
57
|
+
| `ADOBE_S3_BUCKET` | bucket the presigner signs against |
|
|
58
|
+
| `ADOBE_S3_REGION` | leave unset on AWS infra (IAM role); set for local dev |
|
|
59
|
+
| `ADOBE_S3_PREFIX` | optional key prefix |
|
|
60
|
+
|
|
61
|
+
## Notes for agents
|
|
62
|
+
|
|
63
|
+
- **No `deps` field exists in manifests** — installing the AWS SDK is a checklist step:
|
|
64
|
+
`npm install @aws-sdk/client-s3 @aws-sdk/s3-request-presigner`.
|
|
65
|
+
- Presigned URLs inherit the signer's permissions — grant `s3:GetObject` + `s3:PutObject`.
|
|
66
|
+
- Mutually exclusive with the GCS/Azure presigners (declared `conflicts`).
|
|
67
|
+
|
|
68
|
+
## Checklist (post-install)
|
|
69
|
+
|
|
70
|
+
Install the AWS SDK; set `ADOBE_S3_BUCKET` and grant `s3:GetObject`/`s3:PutObject`; import
|
|
71
|
+
`s3-register` once at startup; pass S3 keys (not URLs) as refs; use the AWS credential chain.
|
|
72
|
+
|
|
73
|
+
## Related
|
|
74
|
+
|
|
75
|
+
Foundation: [`adobe-firefly-core`](../adobe-firefly-core) (the storage seam). Alternatives
|
|
76
|
+
(design-only): `adobe-firefly-storage-gcs`, `adobe-firefly-storage-azure`.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# --- Adobe Firefly — S3 Presigned Storage ---
|
|
2
|
+
# The presigner needs the bucket; region + credentials resolve from the AWS chain
|
|
3
|
+
# (AWS_REGION / shared profile / IAM role). Leave ADOBE_S3_REGION unset on AWS
|
|
4
|
+
# infra; it only overrides the region. Presigned-URL lifetime is set at install
|
|
5
|
+
# time (url_expiry_seconds).
|
|
6
|
+
ADOBE_S3_BUCKET= # required
|
|
7
|
+
ADOBE_S3_REGION=
|
|
8
|
+
ADOBE_S3_PREFIX=
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// @hexagen-server-only
|
|
2
|
+
import {
|
|
3
|
+
S3Client,
|
|
4
|
+
GetObjectCommand,
|
|
5
|
+
PutObjectCommand,
|
|
6
|
+
} from "@aws-sdk/client-s3";
|
|
7
|
+
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
|
|
8
|
+
import type {
|
|
9
|
+
FireflyStoragePort,
|
|
10
|
+
PresignedHref,
|
|
11
|
+
} from "../../../domain/ports/out/firefly-storage.port";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Amazon S3 presigner for the Firefly storage seam.
|
|
15
|
+
*
|
|
16
|
+
* Firefly reads inputs and writes outputs via presigned URLs (`storage:
|
|
17
|
+
* "external"`). This adapter presigns a GET for inputs and a PUT for outputs
|
|
18
|
+
* against `ADOBE_S3_BUCKET`. Region + credentials resolve from the AWS chain —
|
|
19
|
+
* the region is never hardcoded (ADOBE_S3_REGION → AWS_REGION → SDK default).
|
|
20
|
+
*
|
|
21
|
+
* Refs are treated as S3 object keys (an optional ADOBE_S3_PREFIX is applied).
|
|
22
|
+
* A ref that is already an http(s) URL is returned unchanged, so callers may mix
|
|
23
|
+
* pre-presigned hrefs with keys.
|
|
24
|
+
*/
|
|
25
|
+
// Interpolated from the url_expiry_seconds answer. Validate + clamp so a bad or
|
|
26
|
+
// overridden value never reaches getSignedUrl as NaN/out-of-range. We deliberately
|
|
27
|
+
// fall back rather than throw at module scope — this file is imported at startup
|
|
28
|
+
// (via s3-register), so a throw here would crash the app. AWS SigV4 presigned URLs
|
|
29
|
+
// allow 1..604800s (7 days); default to 900 (15 min) on an invalid value.
|
|
30
|
+
const URL_EXPIRY_SECONDS = resolveExpiry(Number("{url_expiry_seconds}"));
|
|
31
|
+
|
|
32
|
+
function resolveExpiry(value: number): number {
|
|
33
|
+
if (!Number.isFinite(value) || value <= 0) return 900;
|
|
34
|
+
// Clamp AFTER flooring — a fractional value like 0.5 floors to 0, which is
|
|
35
|
+
// outside the 1..604800 range AWS accepts.
|
|
36
|
+
return Math.max(1, Math.min(Math.floor(value), 604_800));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export class S3PresignStorageAdapter implements FireflyStoragePort {
|
|
40
|
+
private client: S3Client | undefined;
|
|
41
|
+
|
|
42
|
+
constructor(client?: S3Client) {
|
|
43
|
+
// Capture NO env here. This adapter is constructed at import time by
|
|
44
|
+
// s3-register.ts (a side-effect import at startup), so snapshotting env in the
|
|
45
|
+
// constructor would lock in whatever was set before .env loaded. The client is
|
|
46
|
+
// built lazily (region read on first use) and bucket/prefix are read at presign
|
|
47
|
+
// time, so a .env loaded later is honoured — and startup stays crash-free.
|
|
48
|
+
this.client = client;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
private getClient(): S3Client {
|
|
52
|
+
if (this.client) return this.client;
|
|
53
|
+
// Region resolves from the AWS chain at first use; never hardcoded/required
|
|
54
|
+
// (ADOBE_S3_REGION → AWS_REGION → SDK default). Return the local so the result
|
|
55
|
+
// is statically S3Client (strict TS won't narrow the `S3Client | undefined`
|
|
56
|
+
// field across the assignment).
|
|
57
|
+
const region = process.env.ADOBE_S3_REGION ?? process.env.AWS_REGION;
|
|
58
|
+
const created = new S3Client(region ? { region } : {});
|
|
59
|
+
this.client = created;
|
|
60
|
+
return created;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async presignInput(ref: string): Promise<PresignedHref> {
|
|
64
|
+
if (isHttpUrl(ref)) return { href: ref };
|
|
65
|
+
const href = await getSignedUrl(
|
|
66
|
+
this.getClient(),
|
|
67
|
+
new GetObjectCommand({ Bucket: this.requireBucket(), Key: this.key(ref) }),
|
|
68
|
+
{ expiresIn: URL_EXPIRY_SECONDS },
|
|
69
|
+
);
|
|
70
|
+
return { href };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async presignOutput(ref: string): Promise<PresignedHref> {
|
|
74
|
+
if (isHttpUrl(ref)) return { href: ref };
|
|
75
|
+
const href = await getSignedUrl(
|
|
76
|
+
this.getClient(),
|
|
77
|
+
new PutObjectCommand({ Bucket: this.requireBucket(), Key: this.key(ref) }),
|
|
78
|
+
{ expiresIn: URL_EXPIRY_SECONDS },
|
|
79
|
+
);
|
|
80
|
+
return { href };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private requireBucket(): string {
|
|
84
|
+
// Read at call time so a .env loaded after this module is imported is honoured.
|
|
85
|
+
// Fail loud + fast at the point of use (a config error), not at import.
|
|
86
|
+
const bucket = process.env.ADOBE_S3_BUCKET?.trim();
|
|
87
|
+
if (!bucket) {
|
|
88
|
+
throw new Error("ADOBE_S3_BUCKET is not set — set the bucket the Firefly S3 presigner uses.");
|
|
89
|
+
}
|
|
90
|
+
return bucket;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
private key(ref: string): string {
|
|
94
|
+
const cleanRef = ref.replace(/^\/+/, "");
|
|
95
|
+
// Reject path traversal so a ref can never escape ADOBE_S3_PREFIX.
|
|
96
|
+
if (cleanRef.split("/").some((segment) => segment === "..")) {
|
|
97
|
+
throw new Error(`Invalid S3 object key ${JSON.stringify(ref)}: path traversal ("..") is not allowed.`);
|
|
98
|
+
}
|
|
99
|
+
// Normalise the prefix at call time to a slash-free segment so a "/firefly"
|
|
100
|
+
// (path-style) prefix can't yield object keys that start with "/".
|
|
101
|
+
const prefix = (process.env.ADOBE_S3_PREFIX ?? "").replace(/^\/+/, "").replace(/\/+$/, "");
|
|
102
|
+
if (!prefix) return cleanRef;
|
|
103
|
+
return `${prefix}/${cleanRef}`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function isHttpUrl(value: string): boolean {
|
|
108
|
+
return /^https?:\/\//i.test(value);
|
|
109
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @hexagen-server-only
|
|
2
|
+
//
|
|
3
|
+
// Registers the S3 presigner with the core storage seam. Import this ONCE at
|
|
4
|
+
// startup, before any Firefly service call:
|
|
5
|
+
//
|
|
6
|
+
// import "./infrastructure/adobe/storage/s3-register";
|
|
7
|
+
//
|
|
8
|
+
// Side-effect only (like the bedrock provider registration): it swaps the core
|
|
9
|
+
// `passthrough` default for the S3 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 { S3PresignStorageAdapter } from "./s3-presign.adapter";
|
|
14
|
+
|
|
15
|
+
setStoragePresigner(new S3PresignStorageAdapter());
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "adobe-firefly-storage-s3",
|
|
3
|
+
"name": "Adobe Firefly — S3 Presigned Storage",
|
|
4
|
+
"description": "Registers an Amazon S3 presigner for the adobe-firefly-core storage seam: presigns GET URLs for Firefly inputs and PUT URLs for outputs (storage: \"external\"). Mutually exclusive with the GCS/Azure presigners. Install @aws-sdk/client-s3 + @aws-sdk/s3-request-presigner.",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"requires": ["adobe-firefly-core"],
|
|
7
|
+
"conflicts": ["adobe-firefly-storage-gcs", "adobe-firefly-storage-azure"],
|
|
8
|
+
"questions": [
|
|
9
|
+
{
|
|
10
|
+
"id": "url_expiry_seconds",
|
|
11
|
+
"type": "select",
|
|
12
|
+
"prompt": "Presigned-URL lifetime (seconds)?",
|
|
13
|
+
"options": ["300", "900", "3600"],
|
|
14
|
+
"default": "900"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"envVars": ["ADOBE_S3_BUCKET", "ADOBE_S3_REGION", "ADOBE_S3_PREFIX"],
|
|
18
|
+
"outputs": [
|
|
19
|
+
"src/infrastructure/adobe/storage/s3-presign.adapter.ts",
|
|
20
|
+
"src/infrastructure/adobe/storage/s3-register.ts",
|
|
21
|
+
".env.adobe-storage-s3.example"
|
|
22
|
+
],
|
|
23
|
+
"checklist": [
|
|
24
|
+
"Install the AWS SDK (the only channel — manifests have no deps field): npm install @aws-sdk/client-s3 @aws-sdk/s3-request-presigner",
|
|
25
|
+
"Set ADOBE_S3_BUCKET; grant the runtime IAM role s3:GetObject + s3:PutObject on it (presigned URLs inherit the signer's permissions)",
|
|
26
|
+
"Import the registration once at startup, before any Firefly service call: import './infrastructure/adobe/storage/s3-register'",
|
|
27
|
+
"Pass S3 object keys (not full URLs) as input/output refs — the adapter presigns GET for inputs, PUT for outputs (an http(s) ref is passed through unchanged)",
|
|
28
|
+
"Region + credentials use the AWS chain: leave ADOBE_S3_REGION unset on AWS infra (IAM role), set AWS_* for local dev"
|
|
29
|
+
],
|
|
30
|
+
"branch": "feature/generator-template-adobe-firefly-storage-s3"
|
|
31
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Adobe Firefly — Upscale (`adobe-firefly-upscale`)
|
|
2
|
+
|
|
3
|
+
> The lightest Firefly service: submit an async upscale job and get one output href.
|
|
4
|
+
> A good end-to-end validation of the `adobe-firefly-core` foundation.
|
|
5
|
+
|
|
6
|
+
| | |
|
|
7
|
+
| ------------- | -------------------------------------------------- |
|
|
8
|
+
| **ID** | `adobe-firefly-upscale` |
|
|
9
|
+
| **Category** | Adobe Firefly Services — Core Generative |
|
|
10
|
+
| **Requires** | `adobe-firefly-core` |
|
|
11
|
+
| **Conflicts** | none |
|
|
12
|
+
| **Branch** | `feature/generator-template-adobe-firefly-upscale` |
|
|
13
|
+
|
|
14
|
+
Author/agent-facing reference, beside `manifest.json` — not emitted into projects.
|
|
15
|
+
|
|
16
|
+
## What it does
|
|
17
|
+
|
|
18
|
+
Adds `UpscalePort` + `fireflyUpscale` adapter. One method, `upscale(req)`, submits an
|
|
19
|
+
async job through the core client/job port and resolves to the upscaled output href.
|
|
20
|
+
|
|
21
|
+
## Service & API
|
|
22
|
+
|
|
23
|
+
- **Host:** `firefly-api.adobe.io` (via core). Posts to `/v3/images/upscale`.
|
|
24
|
+
- **Auth:** IMS Server-to-Server (inherited). Resolves to a single **`string`** href.
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
`hexagen add adobe-firefly-upscale`. Question:
|
|
29
|
+
|
|
30
|
+
| Question | Options (default) |
|
|
31
|
+
| ---------------- | --------------------------------------------------------------- |
|
|
32
|
+
| `default_factor` | `2` / `4` (`2`) — override per call via `UpscaleRequest.factor` |
|
|
33
|
+
|
|
34
|
+
Env: `ADOBE_UPSCALE_FACTOR`. Emits `upscale.port.ts`, `upscale.adapter.ts`,
|
|
35
|
+
`.env.adobe-upscale.example`.
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { fireflyUpscale } from "@/infrastructure/adobe/upscale/upscale.adapter";
|
|
41
|
+
|
|
42
|
+
const res = await fireflyUpscale.upscale({
|
|
43
|
+
inputHref: "s3://bucket/in/small.png",
|
|
44
|
+
outputHref: "s3://bucket/out/large.png",
|
|
45
|
+
factor: 4, // optional; default from ADOBE_UPSCALE_FACTOR
|
|
46
|
+
});
|
|
47
|
+
if (res.success) console.log(res.value);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Configuration
|
|
51
|
+
|
|
52
|
+
| Env var | Purpose |
|
|
53
|
+
| ---------------------- | --------------------------------------------------------- |
|
|
54
|
+
| `ADOBE_UPSCALE_FACTOR` | install-set default factor (also `UpscaleRequest.factor`) |
|
|
55
|
+
|
|
56
|
+
## Notes for agents
|
|
57
|
+
|
|
58
|
+
- Provide presigned input/output hrefs (core passthrough) or install a `storage-*` addon.
|
|
59
|
+
- Verify the endpoint against Adobe docs — Firefly paths version frequently.
|
|
60
|
+
|
|
61
|
+
## Checklist (post-install)
|
|
62
|
+
|
|
63
|
+
Confirm the Upscale entitlement/scope; verify `/v3/images/upscale`; supply presigned IO.
|
|
64
|
+
Optional SDK: `npm install @adobe/firefly-services-sdk-js`.
|
|
65
|
+
|
|
66
|
+
## Related
|
|
67
|
+
|
|
68
|
+
Foundation: [`adobe-firefly-core`](../adobe-firefly-core).
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Result } from "../../../shared/result";
|
|
2
|
+
// Type-only import of the infrastructure error (erased at compile) — the accepted
|
|
3
|
+
// pattern for typing a port's failure channel without runtime domain→infra coupling.
|
|
4
|
+
import type { FireflyError } from "../../../infrastructure/adobe/errors/firefly-errors";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Outbound port for the Firefly Upscale service.
|
|
8
|
+
*
|
|
9
|
+
* Async under the hood (submit → await job), but the port presents a single
|
|
10
|
+
* `Result`-returning call. Hrefs are presigned URLs (`storage: "external"`):
|
|
11
|
+
* supply them yourself (core passthrough) or let a storage addon presign them.
|
|
12
|
+
*/
|
|
13
|
+
export interface UpscaleRequest {
|
|
14
|
+
/** Source image the service reads (presigned GET href). */
|
|
15
|
+
readonly inputHref: string;
|
|
16
|
+
/** Destination the upscaled image is written to (presigned PUT href). */
|
|
17
|
+
readonly outputHref: string;
|
|
18
|
+
/** Upscale factor; falls back to the install-configured default. */
|
|
19
|
+
readonly factor?: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface UpscalePort {
|
|
23
|
+
/** Upscale `inputHref` into `outputHref`; resolves to the output href on success. */
|
|
24
|
+
upscale(req: UpscaleRequest): Promise<Result<string, FireflyError>>;
|
|
25
|
+
}
|