@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,28 @@
|
|
|
1
|
+
import { NextResponse, type NextRequest } from "next/server";
|
|
2
|
+
import { MOCK_USER } from "./src/infrastructure/auth/mock-user";
|
|
3
|
+
|
|
4
|
+
// Dev-only root middleware: when AUTH_MODE=mock, every request is treated as
|
|
5
|
+
// signed in as MOCK_USER (exposed downstream via the x-user-context header).
|
|
6
|
+
// When AUTH_MODE is anything else, this is a pass-through that still strips
|
|
7
|
+
// any client-supplied x-user-context header so downstream getCurrentUser()
|
|
8
|
+
// helpers can safely trust the header when present.
|
|
9
|
+
//
|
|
10
|
+
// A real auth provider template (google-oauth, supabase, etc.) overwrites this
|
|
11
|
+
// file with its own middleware that validates the provider's session, still
|
|
12
|
+
// honours AUTH_MODE=mock as a dev short-circuit, and applies the same strip.
|
|
13
|
+
export default function middleware(request: NextRequest) {
|
|
14
|
+
const headers = new Headers(request.headers);
|
|
15
|
+
headers.delete("x-user-context");
|
|
16
|
+
|
|
17
|
+
if (process.env.AUTH_MODE === "mock") {
|
|
18
|
+
if (process.env.NODE_ENV !== "development") {
|
|
19
|
+
throw new Error("AUTH_MODE=mock is only supported in development");
|
|
20
|
+
}
|
|
21
|
+
headers.set("x-user-context", JSON.stringify(MOCK_USER));
|
|
22
|
+
}
|
|
23
|
+
return NextResponse.next({ request: { headers } });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const config = {
|
|
27
|
+
matcher: ["/((?!_next/static|_next/image|favicon.ico).*)"],
|
|
28
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "auth-mock",
|
|
3
|
+
"name": "Auth Mock",
|
|
4
|
+
"description": "Dev-only root middleware that injects shared-types' MOCK_USER as x-user-context when AUTH_MODE=mock. Real auth providers ship their own middleware that overwrites this one and still honours AUTH_MODE=mock as a dev short-circuit.",
|
|
5
|
+
"version": "3.0.0",
|
|
6
|
+
"requires": ["shared-types", "env-setup"],
|
|
7
|
+
"conflicts": [],
|
|
8
|
+
"questions": [
|
|
9
|
+
{
|
|
10
|
+
"id": "session_cookie_name",
|
|
11
|
+
"type": "auto",
|
|
12
|
+
"derivedFrom": "shared-types.session_cookie_name"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"envVars": ["AUTH_MODE"],
|
|
16
|
+
"outputs": ["middleware.ts", ".env.auth.example"],
|
|
17
|
+
"checklist": [
|
|
18
|
+
"Set AUTH_MODE=mock in development; the middleware injects MOCK_USER from shared-types as x-user-context on every request",
|
|
19
|
+
"MOCK_USER values + runtime overrides (MOCK_USER_NAME / MOCK_USER_EMAIL / MOCK_USER_ROLES / MOCK_USER_AVATAR_URL) live in shared-types",
|
|
20
|
+
"A real auth provider template overwrites this middleware with its own and still honours AUTH_MODE=mock as a dev short-circuit"
|
|
21
|
+
],
|
|
22
|
+
"branch": "feature/shared-types-and-derived-answers"
|
|
23
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Bedrock AgentCore Runtime (`bedrock-agentcore-runtime`)
|
|
2
|
+
|
|
3
|
+
> Deploy the Hexagen TypeScript server to Amazon Bedrock AgentCore Runtime as an ARM64 container
|
|
4
|
+
> implementing the HTTP contract (`POST /invocations`, `GET /ping`). No Python agent scaffolding.
|
|
5
|
+
|
|
6
|
+
| | |
|
|
7
|
+
| ------------- | ------------------------------------------------------ |
|
|
8
|
+
| **ID** | `bedrock-agentcore-runtime` |
|
|
9
|
+
| **Category** | LLM / agents — deployment |
|
|
10
|
+
| **Requires** | `docker`, `env-setup` |
|
|
11
|
+
| **Conflicts** | none |
|
|
12
|
+
| **Branch** | `feature/generator-template-bedrock-agentcore-runtime` |
|
|
13
|
+
|
|
14
|
+
Author/agent-facing reference, beside `manifest.json` — not emitted into projects.
|
|
15
|
+
|
|
16
|
+
## What it does
|
|
17
|
+
|
|
18
|
+
Packages the app as an AgentCore Runtime container: the HTTP handlers AgentCore calls
|
|
19
|
+
(`/invocations`, `/ping`), payload/session helpers, an ARM64 `Dockerfile.agentcore`,
|
|
20
|
+
`agentcore.json`, an IAM execution policy, and an optional deploy workflow. You implement
|
|
21
|
+
`AgentRuntimePort` and pass it to `createAgentCoreServer()`.
|
|
22
|
+
|
|
23
|
+
## Service & API
|
|
24
|
+
|
|
25
|
+
- **Platform:** Amazon Bedrock AgentCore Runtime. **Contract:** `POST /invocations`, `GET /ping`.
|
|
26
|
+
- **Build:** ARM64 **Container** (required for a TypeScript runtime).
|
|
27
|
+
- **Inbound auth:** `IAM` (SigV4) or `OAuth` (fail-closed until a verifier is registered).
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
`hexagen add bedrock-agentcore-runtime`. Questions: `aws_region`, `agent_name`, `protocol`
|
|
32
|
+
(`HTTP`/`MCP`/`A2A`), `build_type` (`Container`), `inbound_auth` (`IAM`/`OAuth`), `provision`
|
|
33
|
+
(`agentcore-cli`/`cdk`/`none`), `deploy_ci` (bool). Emits `Dockerfile.agentcore`, the
|
|
34
|
+
`infrastructure/agentcore/*` handlers, `agentcore/agentcore.json`, the IAM policy,
|
|
35
|
+
`.env.agentcore.example`, and gated `deploy-agentcore.yml` / `infra/agentcore-stack.ts`.
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
// src/infrastructure/agentcore/http/server.ts
|
|
41
|
+
import { createAgentCoreServer } from "./server";
|
|
42
|
+
createAgentCoreServer(myAgentRuntimePort); // implement AgentRuntimePort (run / optional runStream)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
docker buildx build --platform linux/arm64 -f Dockerfile.agentcore -t agent .
|
|
47
|
+
docker run -p 8080:8080 agent && curl localhost:8080/ping
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Notes for agents
|
|
51
|
+
|
|
52
|
+
- **Enable model access** in the Bedrock console (per account/region) or invocations fail with
|
|
53
|
+
`AccessDeniedException`.
|
|
54
|
+
- Provision via `agentcore deploy` (CLI) or `cdk deploy`; copy `AGENTCORE_RUNTIME_ARN` from
|
|
55
|
+
`agentcore status`.
|
|
56
|
+
- With [`observability`](../observability) installed, the handler seeds the correlation store from
|
|
57
|
+
`runtimeSessionId` so app logs + AgentCore OTEL→CloudWatch traces share one id.
|
|
58
|
+
- `inbound_auth=OAuth` is fail-closed: register a verifier via `setTokenVerifier()` at startup.
|
|
59
|
+
|
|
60
|
+
## Checklist (post-install)
|
|
61
|
+
|
|
62
|
+
Enable model access; implement `AgentRuntimePort`; build + smoke `/ping` locally; provision;
|
|
63
|
+
attach the IAM policy; invoke; set the runtime ARN; configure OAuth verifier if used.
|
|
64
|
+
|
|
65
|
+
## Related
|
|
66
|
+
|
|
67
|
+
Requires [`docker`](../docker), [`env-setup`](../env-setup). Stateful services:
|
|
68
|
+
[`bedrock-agentcore-services`](../bedrock-agentcore-services).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# --- Bedrock AgentCore Runtime ---
|
|
2
|
+
# Copy into .env.local. The runtime container reads these at startup.
|
|
3
|
+
|
|
4
|
+
AGENTCORE_AGENT_NAME={agent_name}
|
|
5
|
+
AGENTCORE_PROTOCOL={protocol}
|
|
6
|
+
AGENTCORE_RUNTIME_PORT=8080
|
|
7
|
+
AWS_REGION={aws_region}
|
|
8
|
+
|
|
9
|
+
# Populated after deploy (agentcore status / CDK stack output): the runtime ARN you invoke.
|
|
10
|
+
AGENTCORE_RUNTIME_ARN=
|
|
11
|
+
|
|
12
|
+
# Inbound auth = {inbound_auth}.
|
|
13
|
+
# Set these ONLY for OAuth inbound auth; when AGENTCORE_OAUTH_DISCOVERY_URL is
|
|
14
|
+
# set the runtime requires a Bearer token on /invocations (see invocations.handler.ts).
|
|
15
|
+
# OAuth mode is FAIL-CLOSED: you must also register a real token verifier at
|
|
16
|
+
# startup via setTokenVerifier() — until you do, every call is rejected (500).
|
|
17
|
+
# With IAM inbound auth, AgentCore enforces SigV4 upstream — leave these unset.
|
|
18
|
+
# AGENTCORE_OAUTH_DISCOVERY_URL=
|
|
19
|
+
# AGENTCORE_OAUTH_ALLOWED_AUDIENCE=
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
name: Deploy AgentCore Runtime
|
|
2
|
+
|
|
3
|
+
# Builds the ARM64 runtime image, pushes it to ECR, and creates/updates the
|
|
4
|
+
# Bedrock AgentCore runtime via the AWS CLI (no interactive agentcore-cli needed
|
|
5
|
+
# in CI). Auth uses GitHub OIDC -> an IAM role (no long-lived keys).
|
|
6
|
+
#
|
|
7
|
+
# Required repo configuration:
|
|
8
|
+
# secrets.AWS_DEPLOY_ROLE_ARN IAM role to assume (trusts GitHub OIDC)
|
|
9
|
+
# vars.AWS_ACCOUNT_ID target account id
|
|
10
|
+
# The runtime execution role ({agent_name}-runtime-role) must already exist
|
|
11
|
+
# with iam/agentcore-runtime-role.policy.json attached.
|
|
12
|
+
|
|
13
|
+
on:
|
|
14
|
+
push:
|
|
15
|
+
branches: [main]
|
|
16
|
+
paths:
|
|
17
|
+
- "src/infrastructure/agentcore/**"
|
|
18
|
+
- "Dockerfile.agentcore"
|
|
19
|
+
- "agentcore/**"
|
|
20
|
+
- ".github/workflows/deploy-agentcore.yml"
|
|
21
|
+
workflow_dispatch: {}
|
|
22
|
+
|
|
23
|
+
permissions:
|
|
24
|
+
id-token: write
|
|
25
|
+
contents: read
|
|
26
|
+
|
|
27
|
+
concurrency:
|
|
28
|
+
group: agentcore-deploy-{agent_name}
|
|
29
|
+
cancel-in-progress: false
|
|
30
|
+
|
|
31
|
+
env:
|
|
32
|
+
AWS_REGION: "{aws_region}"
|
|
33
|
+
AGENT_NAME: "{agent_name}"
|
|
34
|
+
ECR_REPOSITORY: "{agent_name}"
|
|
35
|
+
|
|
36
|
+
jobs:
|
|
37
|
+
deploy:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v4
|
|
41
|
+
|
|
42
|
+
- name: Configure AWS credentials (OIDC)
|
|
43
|
+
uses: aws-actions/configure-aws-credentials@v4
|
|
44
|
+
with:
|
|
45
|
+
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE_ARN }}
|
|
46
|
+
aws-region: ${{ env.AWS_REGION }}
|
|
47
|
+
|
|
48
|
+
- name: Login to Amazon ECR
|
|
49
|
+
id: ecr
|
|
50
|
+
uses: aws-actions/amazon-ecr-login@v2
|
|
51
|
+
|
|
52
|
+
- name: Ensure ECR repository exists
|
|
53
|
+
run: |
|
|
54
|
+
aws ecr describe-repositories --repository-names "$ECR_REPOSITORY" --region "$AWS_REGION" \
|
|
55
|
+
|| aws ecr create-repository --repository-name "$ECR_REPOSITORY" --region "$AWS_REGION"
|
|
56
|
+
|
|
57
|
+
- name: Set up Docker Buildx
|
|
58
|
+
uses: docker/setup-buildx-action@v3
|
|
59
|
+
|
|
60
|
+
- name: Build and push ARM64 image
|
|
61
|
+
id: build
|
|
62
|
+
env:
|
|
63
|
+
ECR_REGISTRY: ${{ steps.ecr.outputs.registry }}
|
|
64
|
+
run: |
|
|
65
|
+
IMAGE_URI="$ECR_REGISTRY/$ECR_REPOSITORY:${{ github.sha }}"
|
|
66
|
+
docker buildx build \
|
|
67
|
+
--platform linux/arm64 \
|
|
68
|
+
-f Dockerfile.agentcore \
|
|
69
|
+
-t "$IMAGE_URI" \
|
|
70
|
+
--push .
|
|
71
|
+
echo "image_uri=$IMAGE_URI" >> "$GITHUB_OUTPUT"
|
|
72
|
+
|
|
73
|
+
- name: Create or update AgentCore runtime
|
|
74
|
+
env:
|
|
75
|
+
IMAGE_URI: ${{ steps.build.outputs.image_uri }}
|
|
76
|
+
EXECUTION_ROLE_ARN: "arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/{agent_name}-runtime-role"
|
|
77
|
+
run: |
|
|
78
|
+
set -euo pipefail
|
|
79
|
+
# NOTE: the bedrock-agentcore-control CLI shape evolves; adjust flags to
|
|
80
|
+
# your installed AWS CLI version if a parameter name differs.
|
|
81
|
+
EXISTING_ID="$(aws bedrock-agentcore-control list-agent-runtimes --region "$AWS_REGION" \
|
|
82
|
+
--query "agentRuntimes[?agentRuntimeName=='$AGENT_NAME'].agentRuntimeId | [0]" \
|
|
83
|
+
--output text 2>/dev/null || echo "None")"
|
|
84
|
+
|
|
85
|
+
if [ "$EXISTING_ID" = "None" ] || [ -z "$EXISTING_ID" ]; then
|
|
86
|
+
echo "Creating runtime $AGENT_NAME"
|
|
87
|
+
aws bedrock-agentcore-control create-agent-runtime \
|
|
88
|
+
--region "$AWS_REGION" \
|
|
89
|
+
--agent-runtime-name "$AGENT_NAME" \
|
|
90
|
+
--role-arn "$EXECUTION_ROLE_ARN" \
|
|
91
|
+
--network-configuration '{"networkMode":"PUBLIC"}' \
|
|
92
|
+
--agent-runtime-artifact "{\"containerConfiguration\":{\"containerUri\":\"$IMAGE_URI\"}}"
|
|
93
|
+
else
|
|
94
|
+
echo "Updating runtime $AGENT_NAME ($EXISTING_ID)"
|
|
95
|
+
aws bedrock-agentcore-control update-agent-runtime \
|
|
96
|
+
--region "$AWS_REGION" \
|
|
97
|
+
--agent-runtime-id "$EXISTING_ID" \
|
|
98
|
+
--role-arn "$EXECUTION_ROLE_ARN" \
|
|
99
|
+
--agent-runtime-artifact "{\"containerConfiguration\":{\"containerUri\":\"$IMAGE_URI\"}}"
|
|
100
|
+
fi
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1
|
|
2
|
+
#
|
|
3
|
+
# Bedrock AgentCore Runtime container.
|
|
4
|
+
#
|
|
5
|
+
# AgentCore Runtime runs on AWS Graviton, so the image MUST be linux/arm64 and
|
|
6
|
+
# MUST listen on :8080 serving GET /ping + POST /invocations (see http/server.ts).
|
|
7
|
+
# Build with buildx:
|
|
8
|
+
# docker buildx build --platform linux/arm64 -f Dockerfile.agentcore -t {agent_name} .
|
|
9
|
+
#
|
|
10
|
+
# This scaffold runs the TypeScript entrypoint with `tsx` for zero build config.
|
|
11
|
+
# For a leaner production image, swap the CMD for a compiled build (tsc/esbuild)
|
|
12
|
+
# and copy only the emitted JS + production node_modules.
|
|
13
|
+
|
|
14
|
+
FROM --platform=linux/arm64 node:22-slim AS deps
|
|
15
|
+
WORKDIR /app
|
|
16
|
+
COPY package.json package-lock.json* ./
|
|
17
|
+
# Full install (incl. devDeps) so `tsx` is available at runtime.
|
|
18
|
+
RUN npm ci
|
|
19
|
+
|
|
20
|
+
FROM --platform=linux/arm64 node:22-slim AS runtime
|
|
21
|
+
WORKDIR /app
|
|
22
|
+
ENV NODE_ENV=production
|
|
23
|
+
ENV AGENTCORE_RUNTIME_PORT=8080
|
|
24
|
+
COPY --from=deps /app/node_modules ./node_modules
|
|
25
|
+
COPY package.json ./
|
|
26
|
+
COPY src ./src
|
|
27
|
+
|
|
28
|
+
# AgentCore polls /ping on this port to gate traffic.
|
|
29
|
+
EXPOSE 8080
|
|
30
|
+
|
|
31
|
+
# tsx must be resolvable (declare it as a project dependency, not only a devDep,
|
|
32
|
+
# if you prune devDeps in your own pipeline).
|
|
33
|
+
CMD ["npx", "tsx", "src/infrastructure/agentcore/http/server.ts"]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{agent_name}",
|
|
3
|
+
"protocol": "{protocol}",
|
|
4
|
+
"buildType": "{build_type}",
|
|
5
|
+
"region": "{aws_region}",
|
|
6
|
+
"network": "PUBLIC",
|
|
7
|
+
"inboundAuth": "{inbound_auth}",
|
|
8
|
+
"container": {
|
|
9
|
+
"platform": "linux/arm64",
|
|
10
|
+
"dockerfile": "Dockerfile.agentcore",
|
|
11
|
+
"port": 8080,
|
|
12
|
+
"healthPath": "/ping",
|
|
13
|
+
"invokePath": "/invocations"
|
|
14
|
+
},
|
|
15
|
+
"executionRolePolicy": "iam/agentcore-runtime-role.policy.json"
|
|
16
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Version": "2012-10-17",
|
|
3
|
+
"Statement": [
|
|
4
|
+
{
|
|
5
|
+
"Sid": "BedrockModelInvocation",
|
|
6
|
+
"Effect": "Allow",
|
|
7
|
+
"Action": [
|
|
8
|
+
"bedrock:InvokeModel",
|
|
9
|
+
"bedrock:InvokeModelWithResponseStream",
|
|
10
|
+
"bedrock:Converse",
|
|
11
|
+
"bedrock:ConverseStream"
|
|
12
|
+
],
|
|
13
|
+
"Resource": [
|
|
14
|
+
"arn:aws:bedrock:{aws_region}::foundation-model/*",
|
|
15
|
+
"arn:aws:bedrock:{aws_region}:*:inference-profile/*"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"Sid": "AgentCoreWorkloadIdentity",
|
|
20
|
+
"Effect": "Allow",
|
|
21
|
+
"Action": [
|
|
22
|
+
"bedrock-agentcore:GetWorkloadAccessToken",
|
|
23
|
+
"bedrock-agentcore:GetWorkloadAccessTokenForJWT",
|
|
24
|
+
"bedrock-agentcore:GetWorkloadAccessTokenForUserId"
|
|
25
|
+
],
|
|
26
|
+
"Resource": "*"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"Sid": "CloudWatchLogs",
|
|
30
|
+
"Effect": "Allow",
|
|
31
|
+
"Action": [
|
|
32
|
+
"logs:CreateLogGroup",
|
|
33
|
+
"logs:CreateLogStream",
|
|
34
|
+
"logs:PutLogEvents"
|
|
35
|
+
],
|
|
36
|
+
"Resource": "arn:aws:logs:{aws_region}:*:log-group:/aws/bedrock-agentcore/*"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"Sid": "Observability",
|
|
40
|
+
"Effect": "Allow",
|
|
41
|
+
"Action": [
|
|
42
|
+
"xray:PutTraceSegments",
|
|
43
|
+
"xray:PutTelemetryRecords",
|
|
44
|
+
"cloudwatch:PutMetricData"
|
|
45
|
+
],
|
|
46
|
+
"Resource": "*"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { App, Stack, type StackProps, CfnOutput } from "aws-cdk-lib";
|
|
2
|
+
import * as ecr from "aws-cdk-lib/aws-ecr";
|
|
3
|
+
import * as iam from "aws-cdk-lib/aws-iam";
|
|
4
|
+
import { Construct } from "constructs";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* CDK stack for the AgentCore runtime's AWS prerequisites (provision = cdk).
|
|
8
|
+
*
|
|
9
|
+
* Provisions the ECR repository the deploy workflow pushes to and the runtime
|
|
10
|
+
* execution role, mirroring iam/agentcore-runtime-role.policy.json. The agent
|
|
11
|
+
* runtime itself is created/updated by the deploy pipeline against the pushed
|
|
12
|
+
* image (the L1 CfnResource for bedrock-agentcore varies by CDK version, so it
|
|
13
|
+
* is intentionally left to the CLI/SDK path) — keeping this stack to the stable,
|
|
14
|
+
* declarative pieces.
|
|
15
|
+
*
|
|
16
|
+
* Deploy: cdk bootstrap (once per account/region)
|
|
17
|
+
* cdk deploy --app "npx tsx infra/agentcore-stack.ts"
|
|
18
|
+
*/
|
|
19
|
+
export class AgentCoreStack extends Stack {
|
|
20
|
+
constructor(scope: Construct, id: string, props?: StackProps) {
|
|
21
|
+
super(scope, id, props);
|
|
22
|
+
|
|
23
|
+
const region = this.region;
|
|
24
|
+
|
|
25
|
+
const repository = new ecr.Repository(this, "AgentCoreRepository", {
|
|
26
|
+
repositoryName: "{agent_name}",
|
|
27
|
+
imageScanOnPush: true,
|
|
28
|
+
lifecycleRules: [{ maxImageCount: 10 }],
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const executionRole = new iam.Role(this, "AgentCoreRuntimeRole", {
|
|
32
|
+
roleName: "{agent_name}-runtime-role",
|
|
33
|
+
assumedBy: new iam.ServicePrincipal("bedrock-agentcore.amazonaws.com"),
|
|
34
|
+
description: "Execution role for the {agent_name} AgentCore runtime",
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
executionRole.addToPolicy(
|
|
38
|
+
new iam.PolicyStatement({
|
|
39
|
+
sid: "BedrockModelInvocation",
|
|
40
|
+
actions: [
|
|
41
|
+
"bedrock:InvokeModel",
|
|
42
|
+
"bedrock:InvokeModelWithResponseStream",
|
|
43
|
+
"bedrock:Converse",
|
|
44
|
+
"bedrock:ConverseStream",
|
|
45
|
+
],
|
|
46
|
+
resources: [
|
|
47
|
+
`arn:aws:bedrock:${region}::foundation-model/*`,
|
|
48
|
+
`arn:aws:bedrock:${region}:*:inference-profile/*`,
|
|
49
|
+
],
|
|
50
|
+
}),
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
executionRole.addToPolicy(
|
|
54
|
+
new iam.PolicyStatement({
|
|
55
|
+
sid: "AgentCoreWorkloadIdentity",
|
|
56
|
+
actions: [
|
|
57
|
+
"bedrock-agentcore:GetWorkloadAccessToken",
|
|
58
|
+
"bedrock-agentcore:GetWorkloadAccessTokenForJWT",
|
|
59
|
+
"bedrock-agentcore:GetWorkloadAccessTokenForUserId",
|
|
60
|
+
],
|
|
61
|
+
resources: ["*"],
|
|
62
|
+
}),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
executionRole.addToPolicy(
|
|
66
|
+
new iam.PolicyStatement({
|
|
67
|
+
sid: "CloudWatchLogs",
|
|
68
|
+
actions: ["logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents"],
|
|
69
|
+
resources: [`arn:aws:logs:${region}:*:log-group:/aws/bedrock-agentcore/*`],
|
|
70
|
+
}),
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
executionRole.addToPolicy(
|
|
74
|
+
new iam.PolicyStatement({
|
|
75
|
+
sid: "Observability",
|
|
76
|
+
actions: ["xray:PutTraceSegments", "xray:PutTelemetryRecords", "cloudwatch:PutMetricData"],
|
|
77
|
+
resources: ["*"],
|
|
78
|
+
}),
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
new CfnOutput(this, "EcrRepositoryUri", { value: repository.repositoryUri });
|
|
82
|
+
new CfnOutput(this, "ExecutionRoleArn", { value: executionRole.roleArn });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const app = new App();
|
|
87
|
+
new AgentCoreStack(app, "AgentCoreStack", {
|
|
88
|
+
env: { region: process.env.AWS_REGION ?? "{aws_region}" },
|
|
89
|
+
});
|
|
90
|
+
app.synth();
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import {
|
|
2
|
+
invocationPayloadSchema,
|
|
3
|
+
type AgentRuntimePort,
|
|
4
|
+
type InvocationResponse,
|
|
5
|
+
} from "../runtime/payload";
|
|
6
|
+
import { readSessionId, withSession } from "../runtime/session";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* AgentCore primary endpoint — `POST /invocations`.
|
|
10
|
+
*
|
|
11
|
+
* Inbound adapter: validate the body, resolve the correlation/session id, run
|
|
12
|
+
* the injected agent use-case (streamed or buffered), and map the result to the
|
|
13
|
+
* AgentCore response contract. Depends only on {@link AgentRuntimePort} — never
|
|
14
|
+
* on a concrete agent — so any agent implementation drops in unchanged.
|
|
15
|
+
*/
|
|
16
|
+
export function createInvocationHandler(
|
|
17
|
+
agent: AgentRuntimePort,
|
|
18
|
+
): (request: Request) => Promise<Response> {
|
|
19
|
+
return async function handleInvocation(request: Request): Promise<Response> {
|
|
20
|
+
const auth = await authenticateInbound(request.headers);
|
|
21
|
+
if (!auth.ok) return auth.response;
|
|
22
|
+
|
|
23
|
+
let body: unknown;
|
|
24
|
+
try {
|
|
25
|
+
body = await request.json();
|
|
26
|
+
} catch {
|
|
27
|
+
return json(400, { error: "Request body must be valid JSON" });
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const parsed = invocationPayloadSchema.safeParse(body);
|
|
31
|
+
if (!parsed.success) {
|
|
32
|
+
return json(400, { error: parsed.error.issues[0]?.message ?? "Invalid payload" });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const { prompt, sessionId: bodySessionId, stream, metadata } = parsed.data;
|
|
36
|
+
const sessionId = readSessionId(request.headers, bodySessionId);
|
|
37
|
+
|
|
38
|
+
// Seed the correlation context (a no-op unless observability is wired) so the
|
|
39
|
+
// whole invocation — including the agent's downstream LLM calls — shares one id.
|
|
40
|
+
return withSession(sessionId, async () => {
|
|
41
|
+
try {
|
|
42
|
+
if (stream && typeof agent.runStream === "function") {
|
|
43
|
+
return streamResponse(agent, { prompt, sessionId, metadata });
|
|
44
|
+
}
|
|
45
|
+
const result = await agent.run({ prompt, sessionId, metadata });
|
|
46
|
+
const payload: InvocationResponse = {
|
|
47
|
+
output: result.output,
|
|
48
|
+
sessionId,
|
|
49
|
+
metadata: result.metadata,
|
|
50
|
+
};
|
|
51
|
+
return json(200, payload);
|
|
52
|
+
} catch (err) {
|
|
53
|
+
// The agent owns its own retry/Result handling; an escape here is an
|
|
54
|
+
// unexpected fault. Don't leak internals to the caller.
|
|
55
|
+
// eslint-disable-next-line no-console
|
|
56
|
+
console.error(`[agentcore] invocation failed (session ${sessionId})`, err);
|
|
57
|
+
return json(500, { error: "Agent invocation failed", sessionId });
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function streamResponse(
|
|
64
|
+
agent: AgentRuntimePort,
|
|
65
|
+
input: { prompt: string; sessionId: string; metadata?: Record<string, unknown> },
|
|
66
|
+
): Response {
|
|
67
|
+
const encoder = new TextEncoder();
|
|
68
|
+
const body = new ReadableStream<Uint8Array>({
|
|
69
|
+
async start(controller) {
|
|
70
|
+
try {
|
|
71
|
+
for await (const chunk of agent.runStream!(input)) {
|
|
72
|
+
controller.enqueue(encoder.encode(`data: ${JSON.stringify({ delta: chunk })}\n\n`));
|
|
73
|
+
}
|
|
74
|
+
controller.enqueue(encoder.encode("data: [DONE]\n\n"));
|
|
75
|
+
} catch (err) {
|
|
76
|
+
controller.enqueue(
|
|
77
|
+
encoder.encode(`event: error\ndata: ${JSON.stringify({ error: "stream failed" })}\n\n`),
|
|
78
|
+
);
|
|
79
|
+
// eslint-disable-next-line no-console
|
|
80
|
+
console.error(`[agentcore] stream failed (session ${input.sessionId})`, err);
|
|
81
|
+
} finally {
|
|
82
|
+
controller.close();
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
return new Response(body, {
|
|
87
|
+
status: 200,
|
|
88
|
+
headers: {
|
|
89
|
+
"content-type": "text/event-stream",
|
|
90
|
+
"cache-control": "no-cache",
|
|
91
|
+
connection: "keep-alive",
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Inbound auth gate. When `AGENTCORE_OAUTH_DISCOVERY_URL` is set (inbound_auth =
|
|
98
|
+
* OAuth) a Bearer token is required on every call. Full JWT signature/audience
|
|
99
|
+
* verification against the discovery document is environment-specific, so it is
|
|
100
|
+
* supplied via {@link setTokenVerifier}. This is **fail-closed**: if OAuth mode
|
|
101
|
+
* is enabled but no verifier has been registered, every call is rejected (rather
|
|
102
|
+
* than silently accepting any token). With no discovery URL the runtime boundary
|
|
103
|
+
* is IAM (SigV4), already enforced by AgentCore upstream, so this is a pass-through.
|
|
104
|
+
*/
|
|
105
|
+
async function authenticateInbound(
|
|
106
|
+
headers: Headers,
|
|
107
|
+
): Promise<{ ok: true } | { ok: false; response: Response }> {
|
|
108
|
+
const discoveryUrl = process.env.AGENTCORE_OAUTH_DISCOVERY_URL;
|
|
109
|
+
if (!discoveryUrl) return { ok: true };
|
|
110
|
+
|
|
111
|
+
const authorization = headers.get("authorization");
|
|
112
|
+
const token = authorization?.toLowerCase().startsWith("bearer ")
|
|
113
|
+
? authorization.slice(7).trim()
|
|
114
|
+
: undefined;
|
|
115
|
+
if (!token) {
|
|
116
|
+
return { ok: false, response: json(401, { error: "Missing bearer token" }) };
|
|
117
|
+
}
|
|
118
|
+
const verifier = verifyToken;
|
|
119
|
+
if (!verifier) {
|
|
120
|
+
// Fail closed: OAuth is on but no real verifier was wired. Accepting the
|
|
121
|
+
// token here would be an auth bypass, so reject and tell the operator.
|
|
122
|
+
// eslint-disable-next-line no-console
|
|
123
|
+
console.error(
|
|
124
|
+
"[agentcore] AGENTCORE_OAUTH_DISCOVERY_URL is set but no token verifier is " +
|
|
125
|
+
"registered — call setTokenVerifier() at startup. Rejecting request.",
|
|
126
|
+
);
|
|
127
|
+
return { ok: false, response: json(500, { error: "Inbound auth is misconfigured" }) };
|
|
128
|
+
}
|
|
129
|
+
if (!(await verifier(token))) {
|
|
130
|
+
return { ok: false, response: json(401, { error: "Invalid bearer token" }) };
|
|
131
|
+
}
|
|
132
|
+
return { ok: true };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
type TokenVerifier = (token: string) => boolean | Promise<boolean>;
|
|
136
|
+
|
|
137
|
+
// No default verifier: OAuth mode is fail-closed until one is registered. Wire
|
|
138
|
+
// real JWKS / audience verification (audience = AGENTCORE_OAUTH_ALLOWED_AUDIENCE)
|
|
139
|
+
// against AGENTCORE_OAUTH_DISCOVERY_URL via setTokenVerifier() at startup.
|
|
140
|
+
let verifyToken: TokenVerifier | null = null;
|
|
141
|
+
|
|
142
|
+
/** Register real inbound-token verification (audience = AGENTCORE_OAUTH_ALLOWED_AUDIENCE). */
|
|
143
|
+
export function setTokenVerifier(verifier: TokenVerifier): void {
|
|
144
|
+
verifyToken = verifier;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function json(status: number, payload: unknown): Response {
|
|
148
|
+
return new Response(JSON.stringify(payload), {
|
|
149
|
+
status,
|
|
150
|
+
headers: { "content-type": "application/json" },
|
|
151
|
+
});
|
|
152
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentCore health endpoint — `GET /ping`.
|
|
3
|
+
*
|
|
4
|
+
* AgentCore Runtime polls this to gate traffic; it must return 200 quickly and
|
|
5
|
+
* cheaply (no model calls, no I/O). The `{"status":"Healthy"}` body matches the
|
|
6
|
+
* shape AgentCore expects. Keep this synchronous and dependency-free.
|
|
7
|
+
*/
|
|
8
|
+
export function handlePing(): Response {
|
|
9
|
+
return new Response(JSON.stringify({ status: "Healthy" }), {
|
|
10
|
+
status: 200,
|
|
11
|
+
headers: { "content-type": "application/json" },
|
|
12
|
+
});
|
|
13
|
+
}
|