@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,44 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
GatewayTool,
|
|
3
|
+
ToolInvocationResult,
|
|
4
|
+
} from "../../../domain/ports/out/tool-gateway.port";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Maps MCP wire shapes (as published by the AgentCore Gateway) onto the
|
|
8
|
+
* framework-neutral {@link GatewayTool} / {@link ToolInvocationResult} domain
|
|
9
|
+
* shapes. Keeping this translation in one place means the port never leaks MCP
|
|
10
|
+
* types and the adapter stays thin.
|
|
11
|
+
*/
|
|
12
|
+
export interface McpToolDescriptor {
|
|
13
|
+
name: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
inputSchema?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface McpContentBlock {
|
|
19
|
+
type: string;
|
|
20
|
+
text?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface McpCallResult {
|
|
24
|
+
content?: McpContentBlock[];
|
|
25
|
+
isError?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function toGatewayTool(descriptor: McpToolDescriptor): GatewayTool {
|
|
29
|
+
return {
|
|
30
|
+
name: descriptor.name,
|
|
31
|
+
description: descriptor.description,
|
|
32
|
+
inputSchema: descriptor.inputSchema,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function toInvocationResult(result: McpCallResult): ToolInvocationResult {
|
|
37
|
+
// Concatenate text blocks; non-text content (images, resources) is dropped
|
|
38
|
+
// from the string view — surface it explicitly if your tools return it.
|
|
39
|
+
const content = (result.content ?? [])
|
|
40
|
+
.filter((block) => block.type === "text")
|
|
41
|
+
.map((block) => block.text ?? "")
|
|
42
|
+
.join("");
|
|
43
|
+
return { content, isError: result.isError };
|
|
44
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// @hexagen-server-only
|
|
2
|
+
import {
|
|
3
|
+
BedrockAgentCoreClient,
|
|
4
|
+
GetWorkloadAccessTokenCommand,
|
|
5
|
+
GetResourceOauth2TokenCommand,
|
|
6
|
+
} from "@aws-sdk/client-bedrock-agentcore";
|
|
7
|
+
import type {
|
|
8
|
+
AgentIdentityPort,
|
|
9
|
+
OutboundCredential,
|
|
10
|
+
WorkloadToken,
|
|
11
|
+
} from "../../../domain/ports/out/agent-identity.port";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* AgentCore Identity adapter — the AWS↔domain boundary for {@link AgentIdentityPort}.
|
|
15
|
+
*
|
|
16
|
+
* `getWorkloadToken()` fetches the agent's workload identity token;
|
|
17
|
+
* `exchangeForOutbound()` trades it for a 3p (OAuth2) credential so the agent can
|
|
18
|
+
* call downstream resources as itself. Region resolves from the
|
|
19
|
+
* AGENTCORE_REGION → AWS_REGION cascade — never hardcoded.
|
|
20
|
+
*
|
|
21
|
+
* NOTE: AgentCore Identity command shapes are still stabilising; adjust field
|
|
22
|
+
* names to your installed @aws-sdk/client-bedrock-agentcore version if they
|
|
23
|
+
* differ. The port contract stays the same.
|
|
24
|
+
*/
|
|
25
|
+
export class AgentCoreIdentityAdapter implements AgentIdentityPort {
|
|
26
|
+
private readonly client: BedrockAgentCoreClient;
|
|
27
|
+
private readonly workloadName: string;
|
|
28
|
+
|
|
29
|
+
constructor(client?: BedrockAgentCoreClient, workloadName?: string) {
|
|
30
|
+
const region = process.env.AGENTCORE_REGION ?? process.env.AWS_REGION;
|
|
31
|
+
this.client = client ?? new BedrockAgentCoreClient(region ? { region } : {});
|
|
32
|
+
// GetWorkloadAccessToken expects the registered workload *name*, not the ARN.
|
|
33
|
+
// Prefer an explicit name; otherwise derive it from the ARN, whose final path
|
|
34
|
+
// segment is the workload identity name (.../workload-identity/<name>).
|
|
35
|
+
const arn = process.env.AGENTCORE_WORKLOAD_IDENTITY_ARN;
|
|
36
|
+
const resolved =
|
|
37
|
+
workloadName ??
|
|
38
|
+
process.env.AGENTCORE_WORKLOAD_NAME ??
|
|
39
|
+
(arn ? workloadNameFromArn(arn) : undefined);
|
|
40
|
+
if (!resolved) {
|
|
41
|
+
throw new Error(
|
|
42
|
+
"Set AGENTCORE_WORKLOAD_NAME (or AGENTCORE_WORKLOAD_IDENTITY_ARN) — provision identity " +
|
|
43
|
+
"and copy the value from `agentcore status` into .env.local.",
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
this.workloadName = resolved;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async getWorkloadToken(): Promise<WorkloadToken> {
|
|
50
|
+
const res = await this.client.send(
|
|
51
|
+
new GetWorkloadAccessTokenCommand({ workloadName: this.workloadName }),
|
|
52
|
+
);
|
|
53
|
+
const token = res.workloadAccessToken;
|
|
54
|
+
if (!token) {
|
|
55
|
+
throw new Error("AgentCore returned no workload access token");
|
|
56
|
+
}
|
|
57
|
+
return { token };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async exchangeForOutbound(resource: string): Promise<OutboundCredential> {
|
|
61
|
+
// The outbound exchange identifies the agent by its workload identity token,
|
|
62
|
+
// not its name — fetch the token first, then trade it for the 3p credential.
|
|
63
|
+
const { token } = await this.getWorkloadToken();
|
|
64
|
+
const res = await this.client.send(
|
|
65
|
+
new GetResourceOauth2TokenCommand({
|
|
66
|
+
workloadIdentityToken: token,
|
|
67
|
+
resourceCredentialProviderName: resource,
|
|
68
|
+
}),
|
|
69
|
+
);
|
|
70
|
+
const accessToken = res.accessToken;
|
|
71
|
+
if (!accessToken) {
|
|
72
|
+
throw new Error(`AgentCore returned no outbound credential for "${resource}"`);
|
|
73
|
+
}
|
|
74
|
+
return { accessToken, scopes: res.scope?.split(" ").filter(Boolean) };
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Extract the workload identity name from its ARN (.../workload-identity/<name>). */
|
|
79
|
+
function workloadNameFromArn(arn: string): string {
|
|
80
|
+
const slash = arn.lastIndexOf("/");
|
|
81
|
+
return slash >= 0 ? arn.slice(slash + 1) : arn;
|
|
82
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IdP → UserContext bridge.
|
|
3
|
+
*
|
|
4
|
+
* Maps the configured identity provider's token claims onto the app's
|
|
5
|
+
* `UserContext` domain type so AgentCore identity and the app's own auth
|
|
6
|
+
* (google-oauth, microsoft-entra, supabase-auth, …) speak the same currency.
|
|
7
|
+
*
|
|
8
|
+
* `UserContext` is declared locally so this template stays self-contained
|
|
9
|
+
* (`shared-types` is a soft dependency). The shape mirrors `shared-types`'
|
|
10
|
+
* `src/domain/value-objects/user-context.ts` exactly, so when that template is
|
|
11
|
+
* installed you can delete this interface and import its `UserContext` instead
|
|
12
|
+
* without touching the mapper:
|
|
13
|
+
*
|
|
14
|
+
* import type { UserContext } from "@/domain/value-objects/user-context";
|
|
15
|
+
*/
|
|
16
|
+
export type IdpProvider = "cognito" | "okta" | "entra" | "auth0" | "none";
|
|
17
|
+
|
|
18
|
+
export interface UserContext {
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly email: string;
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly roles: string[];
|
|
23
|
+
readonly avatarUrl?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** The provider chosen at install time. */
|
|
27
|
+
export const CONFIGURED_IDP = "{identity_idp}" as IdpProvider;
|
|
28
|
+
|
|
29
|
+
// Which claim carries group/role membership differs per IdP.
|
|
30
|
+
const ROLE_CLAIM: Record<IdpProvider, string> = {
|
|
31
|
+
cognito: "cognito:groups",
|
|
32
|
+
okta: "groups",
|
|
33
|
+
entra: "roles",
|
|
34
|
+
auth0: "https://hexagen.dev/roles",
|
|
35
|
+
none: "groups",
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Map a verified token's claims onto `UserContext`. `sub` (or Entra's `oid`)
|
|
40
|
+
* becomes the stable `id`; the IdP-specific role claim becomes `roles`.
|
|
41
|
+
*
|
|
42
|
+
* Throws when neither subject claim is present: `id` is the identity key used for
|
|
43
|
+
* authz, caching, and audit, so minting an empty `""` id would silently collapse
|
|
44
|
+
* distinct callers into one principal. The display-only `email`/`name` fields
|
|
45
|
+
* still default to "" to satisfy the canonical contract.
|
|
46
|
+
*/
|
|
47
|
+
export function claimsToUserContext(
|
|
48
|
+
claims: Record<string, unknown>,
|
|
49
|
+
idp: IdpProvider = CONFIGURED_IDP,
|
|
50
|
+
): UserContext {
|
|
51
|
+
const id = asString(claims.sub) ?? asString(claims.oid);
|
|
52
|
+
if (!id) {
|
|
53
|
+
throw new Error(
|
|
54
|
+
"Token is missing a subject claim (sub/oid) — cannot derive a stable user id.",
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
id,
|
|
59
|
+
email: asString(claims.email) ?? "",
|
|
60
|
+
name: asString(claims.name) ?? asString(claims.preferred_username) ?? "",
|
|
61
|
+
roles: asStringArray(claims[ROLE_CLAIM[idp]]),
|
|
62
|
+
avatarUrl: asString(claims.picture),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function asString(value: unknown): string | undefined {
|
|
67
|
+
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function asStringArray(value: unknown): string[] {
|
|
71
|
+
if (Array.isArray(value)) return value.filter((v): v is string => typeof v === "string");
|
|
72
|
+
if (typeof value === "string" && value.length > 0) return value.split(/[ ,]+/).filter(Boolean);
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// @hexagen-server-only
|
|
2
|
+
import {
|
|
3
|
+
BedrockAgentCoreClient,
|
|
4
|
+
CreateEventCommand,
|
|
5
|
+
RetrieveMemoryRecordsCommand,
|
|
6
|
+
} from "@aws-sdk/client-bedrock-agentcore";
|
|
7
|
+
import type {
|
|
8
|
+
MemoryPort,
|
|
9
|
+
MemoryRecord,
|
|
10
|
+
MemoryTurn,
|
|
11
|
+
} from "../../../domain/ports/out/agent-memory.port";
|
|
12
|
+
import { loadMemoryConfig, type MemoryConfig } from "./memory-config";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* AgentCore Memory adapter — the AWS↔domain translation boundary for {@link MemoryPort}.
|
|
16
|
+
*
|
|
17
|
+
* `store()` writes a turn via CreateEvent; `retrieve()` runs semantic/summary
|
|
18
|
+
* recall via RetrieveMemoryRecords. Region is never hardcoded — it resolves from
|
|
19
|
+
* the AGENTCORE_REGION → AWS_REGION cascade (and otherwise the SDK's own chain).
|
|
20
|
+
*
|
|
21
|
+
* NOTE: AgentCore Memory data-plane command shapes are still stabilising; if your
|
|
22
|
+
* installed @aws-sdk/client-bedrock-agentcore version differs, adjust the field
|
|
23
|
+
* names here — the port contract above stays the same.
|
|
24
|
+
*/
|
|
25
|
+
export class AgentCoreMemoryAdapter implements MemoryPort {
|
|
26
|
+
private readonly client: BedrockAgentCoreClient;
|
|
27
|
+
private readonly config: MemoryConfig;
|
|
28
|
+
|
|
29
|
+
constructor(client?: BedrockAgentCoreClient, config?: MemoryConfig) {
|
|
30
|
+
const region = process.env.AGENTCORE_REGION ?? process.env.AWS_REGION;
|
|
31
|
+
this.client = client ?? new BedrockAgentCoreClient(region ? { region } : {});
|
|
32
|
+
this.config = config ?? loadMemoryConfig();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async store(sessionId: string, turn: MemoryTurn): Promise<void> {
|
|
36
|
+
await this.client.send(
|
|
37
|
+
new CreateEventCommand({
|
|
38
|
+
memoryId: this.config.memoryId,
|
|
39
|
+
sessionId,
|
|
40
|
+
actorId: turn.role,
|
|
41
|
+
eventTimestamp: turn.timestamp ? new Date(turn.timestamp) : new Date(),
|
|
42
|
+
payload: [
|
|
43
|
+
{
|
|
44
|
+
conversational: {
|
|
45
|
+
role: turn.role.toUpperCase(),
|
|
46
|
+
content: { text: turn.content },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
}),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async retrieve(
|
|
55
|
+
sessionId: string,
|
|
56
|
+
query: string,
|
|
57
|
+
limit = 5,
|
|
58
|
+
): Promise<MemoryRecord[]> {
|
|
59
|
+
const res = await this.client.send(
|
|
60
|
+
new RetrieveMemoryRecordsCommand({
|
|
61
|
+
memoryId: this.config.memoryId,
|
|
62
|
+
// Scope recall to the session so long-term records can't bleed across
|
|
63
|
+
// conversations — the MemoryPort contract is session-keyed. AgentCore
|
|
64
|
+
// namespaces are hierarchical; adjust the composition if your strategy's
|
|
65
|
+
// namespace template differs.
|
|
66
|
+
namespace: this.scopedNamespace(sessionId),
|
|
67
|
+
searchCriteria: { searchQuery: query, topK: limit },
|
|
68
|
+
}),
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const summaries = res.memoryRecordSummaries ?? [];
|
|
72
|
+
return summaries.map((r) => ({
|
|
73
|
+
content: r.content?.text ?? "",
|
|
74
|
+
score: r.score,
|
|
75
|
+
kind: r.memoryStrategyType,
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
private scopedNamespace(sessionId: string): string {
|
|
80
|
+
return `${this.config.namespace}/${sessionId}`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentCore Memory configuration, resolved from install answers + environment.
|
|
3
|
+
*
|
|
4
|
+
* `{memory_mode}` and `{memory_strategies}` are interpolated at scaffold time
|
|
5
|
+
* (a multiselect renders as a comma-joined string), while the resource id comes
|
|
6
|
+
* from the environment after provisioning.
|
|
7
|
+
*/
|
|
8
|
+
export type MemoryStrategy = "SEMANTIC" | "SUMMARY" | "USER_PREFERENCE";
|
|
9
|
+
export type MemoryRetention = "shortTerm" | "longAndShortTerm";
|
|
10
|
+
|
|
11
|
+
export interface MemoryConfig {
|
|
12
|
+
readonly memoryId: string;
|
|
13
|
+
readonly namespace: string;
|
|
14
|
+
readonly retention: MemoryRetention;
|
|
15
|
+
readonly strategies: MemoryStrategy[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const RETENTION = "{memory_mode}" as MemoryRetention;
|
|
19
|
+
|
|
20
|
+
// Multiselect answers interpolate to a comma-joined string, e.g. "SEMANTIC,SUMMARY".
|
|
21
|
+
const CONFIGURED_STRATEGIES = "{memory_strategies}"
|
|
22
|
+
.split(",")
|
|
23
|
+
.map((s) => s.trim())
|
|
24
|
+
.filter(Boolean) as MemoryStrategy[];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Build the runtime memory config. Fails fast (a config error) if the resource
|
|
28
|
+
* id is missing — provision Memory and copy AGENTCORE_MEMORY_ID into .env first.
|
|
29
|
+
*/
|
|
30
|
+
export function loadMemoryConfig(): MemoryConfig {
|
|
31
|
+
const memoryId = process.env.AGENTCORE_MEMORY_ID;
|
|
32
|
+
if (!memoryId) {
|
|
33
|
+
throw new Error(
|
|
34
|
+
"AGENTCORE_MEMORY_ID is not set — run `agentcore add memory` then copy the id from " +
|
|
35
|
+
"`agentcore status` into .env.local.",
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
memoryId,
|
|
40
|
+
namespace: process.env.AGENTCORE_MEMORY_NAMESPACE ?? "default",
|
|
41
|
+
retention: RETENTION,
|
|
42
|
+
// Short-term-only retention runs no long-term strategies.
|
|
43
|
+
strategies: RETENTION === "shortTerm" ? [] : CONFIGURED_STRATEGIES,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "bedrock-agentcore-services",
|
|
3
|
+
"name": "Bedrock AgentCore Services",
|
|
4
|
+
"description": "Hexagonal ports + adapters for Amazon Bedrock AgentCore stateful services — Memory (multi-turn + long-term recall), Gateway (APIs/Lambdas/MCP as MCP tools), and Identity (workload token + IdP claim bridge to UserContext). The application layer depends only on the ports; install @aws-sdk/client-bedrock-agentcore.",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"requires": ["env-setup"],
|
|
7
|
+
"conflicts": [],
|
|
8
|
+
"questions": [
|
|
9
|
+
{
|
|
10
|
+
"id": "services",
|
|
11
|
+
"type": "multiselect",
|
|
12
|
+
"prompt": "Which AgentCore services?",
|
|
13
|
+
"options": ["memory", "gateway", "identity"],
|
|
14
|
+
"default": ["memory", "gateway", "identity"]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "memory_mode",
|
|
18
|
+
"type": "select",
|
|
19
|
+
"prompt": "Memory retention?",
|
|
20
|
+
"options": ["shortTerm", "longAndShortTerm"],
|
|
21
|
+
"default": "longAndShortTerm"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "memory_strategies",
|
|
25
|
+
"type": "multiselect",
|
|
26
|
+
"prompt": "Long-term memory strategies?",
|
|
27
|
+
"options": ["SEMANTIC", "SUMMARY", "USER_PREFERENCE"],
|
|
28
|
+
"default": ["SEMANTIC", "SUMMARY"]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "gateway_targets",
|
|
32
|
+
"type": "select",
|
|
33
|
+
"prompt": "Initial gateway tool source?",
|
|
34
|
+
"options": ["lambda", "openapi", "mcp", "none"],
|
|
35
|
+
"default": "lambda"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "identity_idp",
|
|
39
|
+
"type": "select",
|
|
40
|
+
"prompt": "Identity provider to bridge to UserContext?",
|
|
41
|
+
"options": ["cognito", "okta", "entra", "auth0", "none"],
|
|
42
|
+
"default": "cognito"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"envVars": [],
|
|
46
|
+
"outputs": [
|
|
47
|
+
{
|
|
48
|
+
"path": "src/domain/ports/out/agent-memory.port.ts",
|
|
49
|
+
"when": { "answer": "services", "includes": "memory" }
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"path": "src/infrastructure/agentcore/memory/agentcore-memory.adapter.ts",
|
|
53
|
+
"when": { "answer": "services", "includes": "memory" }
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"path": "src/infrastructure/agentcore/memory/memory-config.ts",
|
|
57
|
+
"when": { "answer": "services", "includes": "memory" }
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"path": "src/domain/ports/out/tool-gateway.port.ts",
|
|
61
|
+
"when": { "answer": "services", "includes": "gateway" }
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"path": "src/infrastructure/agentcore/gateway/agentcore-gateway.adapter.ts",
|
|
65
|
+
"when": { "answer": "services", "includes": "gateway" }
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"path": "src/infrastructure/agentcore/gateway/mcp-tool-mapper.ts",
|
|
69
|
+
"when": { "answer": "services", "includes": "gateway" }
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"path": "src/domain/ports/out/agent-identity.port.ts",
|
|
73
|
+
"when": { "answer": "services", "includes": "identity" }
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"path": "src/infrastructure/agentcore/identity/agentcore-identity.adapter.ts",
|
|
77
|
+
"when": { "answer": "services", "includes": "identity" }
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"path": "src/infrastructure/agentcore/identity/idp-bridge.ts",
|
|
81
|
+
"when": { "answer": "services", "includes": "identity" }
|
|
82
|
+
},
|
|
83
|
+
"agentcore/agentcore-services.json",
|
|
84
|
+
".env.agentcore-services.example"
|
|
85
|
+
],
|
|
86
|
+
"checklist": [
|
|
87
|
+
"Install the SDK (no manifest deps field — this is the only channel): npm install @aws-sdk/client-bedrock-agentcore",
|
|
88
|
+
"Provision the resources you enabled: `agentcore add memory --strategies SEMANTIC,SUMMARY` ; `agentcore add gateway` ; then `agentcore deploy`",
|
|
89
|
+
"Copy AGENTCORE_MEMORY_ID / AGENTCORE_GATEWAY_URL / AGENTCORE_WORKLOAD_IDENTITY_ARN from `agentcore status` into .env.local",
|
|
90
|
+
"Grant the runtime execution role access to the new Memory/Gateway resources (extend iam/agentcore-runtime-role.policy.json)",
|
|
91
|
+
"Merge the blocks in agentcore/agentcore-services.json into agentcore/agentcore.json (this template does not overwrite the runtime's file)",
|
|
92
|
+
"If using Identity: set AGENTCORE_IDP_DISCOVERY_URL and confirm idp-bridge.ts maps your IdP's claims onto UserContext (reuse an installed auth provider's mapping if present)",
|
|
93
|
+
"Gateway adapter is a minimal MCP-over-HTTP client — swap in @modelcontextprotocol/sdk if your Gateway needs the full session/initialize handshake",
|
|
94
|
+
"Wire each adapter behind its port at composition root; run your port-fake tests before hitting live AWS"
|
|
95
|
+
],
|
|
96
|
+
"branch": "feature/generator-template-bedrock-agentcore-services"
|
|
97
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Better Auth (`better-auth`)
|
|
2
|
+
|
|
3
|
+
> Standalone Better Auth server: email/password + Google/GitHub social, a magic-link plugin,
|
|
4
|
+
> built-in rate limiting, a typed auth client, and a core DB schema + migration.
|
|
5
|
+
|
|
6
|
+
| | |
|
|
7
|
+
| ------------- | ---------------------------------------------------------- |
|
|
8
|
+
| **ID** | `better-auth` |
|
|
9
|
+
| **Category** | Auth framework (group B) |
|
|
10
|
+
| **Requires** | `env-setup` |
|
|
11
|
+
| **Conflicts** | every other auth provider/framework (one strategy per app) |
|
|
12
|
+
| **Branch** | `feature/generator-template-better-auth` |
|
|
13
|
+
|
|
14
|
+
Author/agent-facing reference, beside `manifest.json` — not emitted into projects.
|
|
15
|
+
|
|
16
|
+
## What it does
|
|
17
|
+
|
|
18
|
+
A self-hosted auth server: email/password plus social providers and an opt-in magic-link plugin,
|
|
19
|
+
backed by a Drizzle/Postgres schema. Ships a typed client and the `[...all]` route handler.
|
|
20
|
+
|
|
21
|
+
## Service & API
|
|
22
|
+
|
|
23
|
+
- **Framework:** Better Auth. Providers activate from env at runtime; magic-link is opt-in via
|
|
24
|
+
`BETTER_AUTH_MAGIC_LINK`.
|
|
25
|
+
- **DB:** Drizzle/Postgres scaffolded (Prisma/Kysely require swapping the adapter + regenerating).
|
|
26
|
+
- **Routes:** `/api/auth/[...all]`.
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
`hexagen add better-auth`. Questions: `providers` (multiselect: email-password/google/github/
|
|
31
|
+
magic-link), `database` (`drizzle`/`prisma`/`kysely`), `session_expiry_days`, `rate_limiting` (bool).
|
|
32
|
+
|
|
33
|
+
Env: `BETTER_AUTH_SECRET`, `BETTER_AUTH_URL`, `DATABASE_URL`. Emits `src/lib/auth.ts`,
|
|
34
|
+
`src/lib/auth-client.ts`, `src/db/index.ts`, the route handler, `src/db/schema/better-auth.ts`,
|
|
35
|
+
`src/db/migrations/0001_better_auth.sql`, `.env.better-auth.example`.
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { auth } from "@/lib/auth"; // server
|
|
41
|
+
import { authClient } from "@/lib/auth-client"; // client
|
|
42
|
+
// GET /api/auth/get-session returns the active session
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Notes for agents
|
|
46
|
+
|
|
47
|
+
- `npm install better-auth drizzle-orm pg` (+ `-D @types/pg`); apply the migration.
|
|
48
|
+
- Social providers activate when both their `GOOGLE_*` / `GITHUB_*` vars are present.
|
|
49
|
+
- Magic-link: implement `sendMagicLink()` delivery, then set `BETTER_AUTH_MAGIC_LINK=true`.
|
|
50
|
+
- If you also install the `rate-limiting` template, reconcile it with Better Auth's built-in.
|
|
51
|
+
- Standalone — conflicts with every other auth template.
|
|
52
|
+
|
|
53
|
+
## Checklist (post-install)
|
|
54
|
+
|
|
55
|
+
Install deps; merge env; generate `BETTER_AUTH_SECRET`; set `BETTER_AUTH_URL` + `DATABASE_URL`;
|
|
56
|
+
apply the migration; set social creds; wire magic-link delivery if used; test sign-up + session.
|
|
57
|
+
|
|
58
|
+
## Related
|
|
59
|
+
|
|
60
|
+
Requires [`env-setup`](../env-setup). Alternatives: [`nextauth`](../nextauth), [`clerk`](../clerk).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Better Auth — copy these into .env.local
|
|
2
|
+
|
|
3
|
+
# Required: signing secret
|
|
4
|
+
# Generate: openssl rand -hex 32
|
|
5
|
+
BETTER_AUTH_SECRET=
|
|
6
|
+
BETTER_AUTH_URL=http://localhost:3000
|
|
7
|
+
|
|
8
|
+
# Required: Postgres connection for the Drizzle adapter
|
|
9
|
+
DATABASE_URL=postgresql://user:password@localhost:5432/app
|
|
10
|
+
|
|
11
|
+
# Social providers (each activates only when both vars are set)
|
|
12
|
+
GOOGLE_CLIENT_ID=
|
|
13
|
+
GOOGLE_CLIENT_SECRET=
|
|
14
|
+
GITHUB_CLIENT_ID=
|
|
15
|
+
GITHUB_CLIENT_SECRET=
|
|
16
|
+
|
|
17
|
+
# Magic link (opt-in): set to true after implementing sendMagicLink() delivery
|
|
18
|
+
# BETTER_AUTH_MAGIC_LINK=true
|
|
19
|
+
# Email transport for the magic-link plugin
|
|
20
|
+
# RESEND_API_KEY=
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { drizzle } from "drizzle-orm/node-postgres";
|
|
2
|
+
import { Pool } from "pg";
|
|
3
|
+
import * as schema from "./schema/better-auth";
|
|
4
|
+
|
|
5
|
+
// PostgreSQL connection for the Better Auth Drizzle adapter.
|
|
6
|
+
// Set DATABASE_URL in .env.local. If you use a different database, swap the
|
|
7
|
+
// driver/dialect here and regenerate the schema accordingly.
|
|
8
|
+
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
|
|
9
|
+
|
|
10
|
+
export const db = drizzle(pool, { schema });
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
-- Better Auth core tables (PostgreSQL).
|
|
2
|
+
-- Regenerate for your adapter/dialect with: npx @better-auth/cli generate
|
|
3
|
+
-- then apply via your migration tool (drizzle-kit, prisma migrate, etc.).
|
|
4
|
+
|
|
5
|
+
CREATE TABLE "user" (
|
|
6
|
+
"id" text PRIMARY KEY,
|
|
7
|
+
"name" text NOT NULL,
|
|
8
|
+
"email" text NOT NULL UNIQUE,
|
|
9
|
+
"email_verified" boolean NOT NULL DEFAULT false,
|
|
10
|
+
"image" text,
|
|
11
|
+
"created_at" timestamp NOT NULL DEFAULT now(),
|
|
12
|
+
"updated_at" timestamp NOT NULL DEFAULT now()
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
CREATE TABLE "session" (
|
|
16
|
+
"id" text PRIMARY KEY,
|
|
17
|
+
"user_id" text NOT NULL REFERENCES "user" ("id") ON DELETE CASCADE,
|
|
18
|
+
"token" text NOT NULL UNIQUE,
|
|
19
|
+
"expires_at" timestamp NOT NULL,
|
|
20
|
+
"ip_address" text,
|
|
21
|
+
"user_agent" text,
|
|
22
|
+
"created_at" timestamp NOT NULL DEFAULT now(),
|
|
23
|
+
"updated_at" timestamp NOT NULL DEFAULT now()
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
CREATE TABLE "account" (
|
|
27
|
+
"id" text PRIMARY KEY,
|
|
28
|
+
"user_id" text NOT NULL REFERENCES "user" ("id") ON DELETE CASCADE,
|
|
29
|
+
"account_id" text NOT NULL,
|
|
30
|
+
"provider_id" text NOT NULL,
|
|
31
|
+
"access_token" text,
|
|
32
|
+
"refresh_token" text,
|
|
33
|
+
"id_token" text,
|
|
34
|
+
"access_token_expires_at" timestamp,
|
|
35
|
+
"refresh_token_expires_at" timestamp,
|
|
36
|
+
"scope" text,
|
|
37
|
+
"password" text,
|
|
38
|
+
"created_at" timestamp NOT NULL DEFAULT now(),
|
|
39
|
+
"updated_at" timestamp NOT NULL DEFAULT now()
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
CREATE TABLE "verification" (
|
|
43
|
+
"id" text PRIMARY KEY,
|
|
44
|
+
"identifier" text NOT NULL,
|
|
45
|
+
"value" text NOT NULL,
|
|
46
|
+
"expires_at" timestamp NOT NULL,
|
|
47
|
+
"created_at" timestamp NOT NULL DEFAULT now(),
|
|
48
|
+
"updated_at" timestamp NOT NULL DEFAULT now()
|
|
49
|
+
);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Better Auth core schema: user, session, account, verification.
|
|
2
|
+
//
|
|
3
|
+
// This is the Drizzle (PostgreSQL) representation. Your selected adapter is
|
|
4
|
+
// "{database}" — for Prisma, add equivalent models to schema.prisma; for Kysely,
|
|
5
|
+
// define matching table types. Regenerate the authoritative schema for your
|
|
6
|
+
// adapter with: npx @better-auth/cli generate
|
|
7
|
+
import { pgTable, text, timestamp, boolean } from "drizzle-orm/pg-core";
|
|
8
|
+
|
|
9
|
+
export const user = pgTable("user", {
|
|
10
|
+
id: text("id").primaryKey(),
|
|
11
|
+
name: text("name").notNull(),
|
|
12
|
+
email: text("email").notNull().unique(),
|
|
13
|
+
emailVerified: boolean("email_verified").notNull().default(false),
|
|
14
|
+
image: text("image"),
|
|
15
|
+
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
16
|
+
updatedAt: timestamp("updated_at").notNull().defaultNow(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const session = pgTable("session", {
|
|
20
|
+
id: text("id").primaryKey(),
|
|
21
|
+
userId: text("user_id")
|
|
22
|
+
.notNull()
|
|
23
|
+
.references(() => user.id, { onDelete: "cascade" }),
|
|
24
|
+
token: text("token").notNull().unique(),
|
|
25
|
+
expiresAt: timestamp("expires_at").notNull(),
|
|
26
|
+
ipAddress: text("ip_address"),
|
|
27
|
+
userAgent: text("user_agent"),
|
|
28
|
+
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
29
|
+
updatedAt: timestamp("updated_at").notNull().defaultNow(),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const account = pgTable("account", {
|
|
33
|
+
id: text("id").primaryKey(),
|
|
34
|
+
userId: text("user_id")
|
|
35
|
+
.notNull()
|
|
36
|
+
.references(() => user.id, { onDelete: "cascade" }),
|
|
37
|
+
accountId: text("account_id").notNull(),
|
|
38
|
+
providerId: text("provider_id").notNull(),
|
|
39
|
+
accessToken: text("access_token"),
|
|
40
|
+
refreshToken: text("refresh_token"),
|
|
41
|
+
idToken: text("id_token"),
|
|
42
|
+
accessTokenExpiresAt: timestamp("access_token_expires_at"),
|
|
43
|
+
refreshTokenExpiresAt: timestamp("refresh_token_expires_at"),
|
|
44
|
+
scope: text("scope"),
|
|
45
|
+
password: text("password"),
|
|
46
|
+
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
47
|
+
updatedAt: timestamp("updated_at").notNull().defaultNow(),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const verification = pgTable("verification", {
|
|
51
|
+
id: text("id").primaryKey(),
|
|
52
|
+
identifier: text("identifier").notNull(),
|
|
53
|
+
value: text("value").notNull(),
|
|
54
|
+
expiresAt: timestamp("expires_at").notNull(),
|
|
55
|
+
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
56
|
+
updatedAt: timestamp("updated_at").notNull().defaultNow(),
|
|
57
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { createAuthClient } from "better-auth/react";
|
|
4
|
+
import { magicLinkClient } from "better-auth/client/plugins";
|
|
5
|
+
|
|
6
|
+
// Typed client for client components — exports the useSession hook. Import
|
|
7
|
+
// { signIn, signUp, signOut, useSession } from here. baseURL defaults to the
|
|
8
|
+
// current origin. For server-side auth, call the server instance in src/lib/auth.ts.
|
|
9
|
+
export const authClient = createAuthClient({
|
|
10
|
+
plugins: [magicLinkClient()],
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const { signIn, signUp, signOut, useSession } = authClient;
|