@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,84 @@
|
|
|
1
|
+
import type { BaseCheckpointSaver } from "@langchain/langgraph";
|
|
2
|
+
import { createMemoryCheckpointer } from "./memory-checkpointer";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Resolve the configured checkpointer at boot. Each non-memory backend is
|
|
6
|
+
* imported lazily so projects that didn't generate that template file (or
|
|
7
|
+
* didn't install the matching driver package) don't blow up at module
|
|
8
|
+
* load — the import only runs when LANGGRAPH_CHECKPOINTER actually
|
|
9
|
+
* selects it.
|
|
10
|
+
*
|
|
11
|
+
* The cache lives on `globalThis` rather than as a plain module-scoped
|
|
12
|
+
* `let` so Next.js Fast Refresh / HMR (which reloads modules but keeps
|
|
13
|
+
* the process alive) reuses the same connection pool across reloads.
|
|
14
|
+
* The PrismaClient-in-dev pattern, applied here. Without it, every code
|
|
15
|
+
* edit in dev would leak a fresh PostgresSaver / RedisSaver and you'd
|
|
16
|
+
* exhaust the database connection limit within a handful of saves.
|
|
17
|
+
*
|
|
18
|
+
* The install-time question wires the matching template file into the
|
|
19
|
+
* project; if you change LANGGRAPH_CHECKPOINTER later you must also add
|
|
20
|
+
* the corresponding driver package and template file by re-running the
|
|
21
|
+
* generator with the new answer, otherwise the import will fail with a
|
|
22
|
+
* clear "module not found" instead of a silent fallback.
|
|
23
|
+
*/
|
|
24
|
+
const CACHE_KEY = Symbol.for("hexagen.langgraph.checkpointer");
|
|
25
|
+
|
|
26
|
+
// Cache the *promise* of the checkpointer (not the resolved instance).
|
|
27
|
+
// The dynamic import + setup() inside each factory is async, so two
|
|
28
|
+
// concurrent first-callers would otherwise both pass the `if` guard,
|
|
29
|
+
// both `await import(...)`, and both run setup() — opening duplicate
|
|
30
|
+
// connection pools or registering duplicate Redis indexes. Holding the
|
|
31
|
+
// in-flight promise serialises them onto one resolution.
|
|
32
|
+
type GlobalCache = typeof globalThis & {
|
|
33
|
+
[CACHE_KEY]?: Promise<BaseCheckpointSaver>;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
async function resolveCheckpointer(): Promise<BaseCheckpointSaver> {
|
|
37
|
+
const choice = (process.env.LANGGRAPH_CHECKPOINTER ?? "memory").toLowerCase();
|
|
38
|
+
switch (choice) {
|
|
39
|
+
case "memory":
|
|
40
|
+
return createMemoryCheckpointer();
|
|
41
|
+
case "supabase": {
|
|
42
|
+
const { createSupabaseCheckpointer } = await import(
|
|
43
|
+
"./supabase-checkpointer"
|
|
44
|
+
);
|
|
45
|
+
return createSupabaseCheckpointer();
|
|
46
|
+
}
|
|
47
|
+
case "postgres": {
|
|
48
|
+
const { createPostgresCheckpointer } = await import(
|
|
49
|
+
"./postgres-checkpointer"
|
|
50
|
+
);
|
|
51
|
+
return createPostgresCheckpointer();
|
|
52
|
+
}
|
|
53
|
+
case "redis": {
|
|
54
|
+
const { createRedisCheckpointer } = await import("./redis-checkpointer");
|
|
55
|
+
return createRedisCheckpointer();
|
|
56
|
+
}
|
|
57
|
+
default:
|
|
58
|
+
// Unknown values used to fall through to the memory branch, which
|
|
59
|
+
// silently dropped persistence in production for typos like
|
|
60
|
+
// "postgress". Fail loud instead — the env var is operator-set, so
|
|
61
|
+
// misconfiguration should be obvious at boot.
|
|
62
|
+
throw new Error(
|
|
63
|
+
`Unknown LANGGRAPH_CHECKPOINTER value "${process.env.LANGGRAPH_CHECKPOINTER}". Expected one of: memory, supabase, postgres, redis.`,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function getCheckpointer(): Promise<BaseCheckpointSaver> {
|
|
69
|
+
const g = globalThis as GlobalCache;
|
|
70
|
+
if (g[CACHE_KEY]) return g[CACHE_KEY];
|
|
71
|
+
g[CACHE_KEY] = resolveCheckpointer().catch((err) => {
|
|
72
|
+
// Drop the failed promise so the next caller can retry on a freshly
|
|
73
|
+
// applied env var instead of replaying the original boot-time error.
|
|
74
|
+
delete g[CACHE_KEY];
|
|
75
|
+
throw err;
|
|
76
|
+
});
|
|
77
|
+
return g[CACHE_KEY];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Test/dev hook: drop the cached checkpointer so the next call resolves fresh. */
|
|
81
|
+
export function resetCheckpointerCache(): void {
|
|
82
|
+
const g = globalThis as GlobalCache;
|
|
83
|
+
delete g[CACHE_KEY];
|
|
84
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MemorySaver } from "@langchain/langgraph";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* In-process checkpoint store. Fine for tests, local dev, and
|
|
5
|
+
* stateless production deployments where you don't need cross-request
|
|
6
|
+
* resume — pick redis / supabase / postgres for those. Memory state is
|
|
7
|
+
* lost on restart and not shared between Node processes, which is the
|
|
8
|
+
* right default for a "Hello, world" graph.
|
|
9
|
+
*/
|
|
10
|
+
export function createMemoryCheckpointer(): MemorySaver {
|
|
11
|
+
return new MemorySaver();
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PostgresSaver } from "@langchain/langgraph-checkpoint-postgres";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Direct-Postgres checkpointer (no Supabase indirection). Reads
|
|
5
|
+
* `DATABASE_URL` — bring your own pooler, connection limits, and SSL
|
|
6
|
+
* config in the URL. The underlying `PostgresSaver` will create its
|
|
7
|
+
* `checkpoints` / `checkpoint_writes` tables on first use via
|
|
8
|
+
* `setup()`, called once at boot in checkpointers/index.ts.
|
|
9
|
+
*/
|
|
10
|
+
export async function createPostgresCheckpointer(): Promise<PostgresSaver> {
|
|
11
|
+
const url = process.env.DATABASE_URL;
|
|
12
|
+
if (!url) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
"Postgres checkpointer selected but DATABASE_URL is not set.",
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
const checkpointer = PostgresSaver.fromConnString(url);
|
|
18
|
+
await checkpointer.setup();
|
|
19
|
+
return checkpointer;
|
|
20
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RedisSaver } from "@langchain/langgraph-checkpoint-redis";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Redis-backed checkpointer. Useful when you've already installed the
|
|
5
|
+
* bullmq template (which provisions a Redis connection + URL) and want
|
|
6
|
+
* graph state to share that infrastructure. Cheap to read, but writes
|
|
7
|
+
* fan out per checkpoint — keep an eye on Redis memory if you store
|
|
8
|
+
* heavy intermediate state in `messages` or similar reducers.
|
|
9
|
+
*/
|
|
10
|
+
export async function createRedisCheckpointer(): Promise<RedisSaver> {
|
|
11
|
+
const url = process.env.REDIS_URL;
|
|
12
|
+
if (!url) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
"Redis checkpointer selected but REDIS_URL is not set. Install the bullmq template (which sets REDIS_URL) or define it manually.",
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
// RedisSaver.fromUrl is async — it connects + creates the indexes
|
|
18
|
+
// internally — so the result must be awaited before .setup() runs.
|
|
19
|
+
// Calling .setup() on the un-awaited Promise was a silent bug that
|
|
20
|
+
// would surface as "checkpointer.setup is not a function" the moment
|
|
21
|
+
// the cold-start path hit Redis instead of memory.
|
|
22
|
+
const checkpointer = await RedisSaver.fromUrl(url);
|
|
23
|
+
await checkpointer.setup();
|
|
24
|
+
return checkpointer;
|
|
25
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PostgresSaver } from "@langchain/langgraph-checkpoint-postgres";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Supabase-hosted Postgres checkpointer. Uses the same `PostgresSaver`
|
|
5
|
+
* as the plain-postgres backend — Supabase is just managed Postgres —
|
|
6
|
+
* but reads the connection URL from `SUPABASE_DB_URL`, which the
|
|
7
|
+
* Supabase template already exports in env.server. This keeps the two
|
|
8
|
+
* connection strings (your app's data DB vs the checkpointer's DB)
|
|
9
|
+
* intentionally separate so you can point them at different databases
|
|
10
|
+
* or schemas if needed.
|
|
11
|
+
*
|
|
12
|
+
* Run `await checkpointer.setup()` once at boot (see
|
|
13
|
+
* checkpointers/index.ts) — PostgresSaver creates the underlying
|
|
14
|
+
* `checkpoints` / `checkpoint_writes` tables on first use.
|
|
15
|
+
*/
|
|
16
|
+
export async function createSupabaseCheckpointer(): Promise<PostgresSaver> {
|
|
17
|
+
const url = process.env.SUPABASE_DB_URL ?? process.env.DATABASE_URL;
|
|
18
|
+
if (!url) {
|
|
19
|
+
throw new Error(
|
|
20
|
+
"Supabase checkpointer selected but neither SUPABASE_DB_URL nor DATABASE_URL is set. Set SUPABASE_DB_URL=postgresql://… in your env.",
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
const checkpointer = PostgresSaver.fromConnString(url);
|
|
24
|
+
await checkpointer.setup();
|
|
25
|
+
return checkpointer;
|
|
26
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { END } from "@langchain/langgraph";
|
|
2
|
+
import type { GraphState } from "../state/graph-state";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Routing helpers used by `addConditionalEdges()` in the graph builder.
|
|
6
|
+
* Keep them small and pure — same state in, same routing decision out —
|
|
7
|
+
* so they can be unit-tested without spinning up a graph.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export type AfterNodeDecision = "continue" | "error" | typeof END;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Generic "did the previous node error out?" decision. Most nodes can use
|
|
14
|
+
* this directly; specialised nodes should write their own routing function
|
|
15
|
+
* alongside the node file rather than overloading this with branches.
|
|
16
|
+
*/
|
|
17
|
+
export function routeAfterError(state: GraphState): AfterNodeDecision {
|
|
18
|
+
if (state.errorMessage) return "error";
|
|
19
|
+
return "continue";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Used after the terminal node (typically output-formatter) to either
|
|
24
|
+
* finish or short-circuit on error. Distinct from `routeAfterError` so the
|
|
25
|
+
* graph reads top-to-bottom in one direction — error always exits, output
|
|
26
|
+
* always ends.
|
|
27
|
+
*/
|
|
28
|
+
export function routeAfterOutput(state: GraphState): typeof END | "error" {
|
|
29
|
+
if (state.errorMessage) return "error";
|
|
30
|
+
return END;
|
|
31
|
+
}
|
package/dist/templates/langgraph/files/src/infrastructure/langgraph/graphs/research-agent.graph.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { END, START, StateGraph } from "@langchain/langgraph";
|
|
2
|
+
import type { BaseCheckpointSaver } from "@langchain/langgraph";
|
|
3
|
+
import { GraphStateAnnotation } from "../state/graph-state";
|
|
4
|
+
import { routeAfterError } from "../edges/routing";
|
|
5
|
+
import { plannerNode } from "../nodes/planner.node";
|
|
6
|
+
import { researcherNode } from "../nodes/researcher.node";
|
|
7
|
+
import { synthesiserNode } from "../nodes/synthesiser.node";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Research-agent example graph: planner decomposes the question, the
|
|
11
|
+
* researcher answers each sub-question in parallel, the synthesiser
|
|
12
|
+
* stitches them into a final answer. Errors at any step propagate via
|
|
13
|
+
* `errorMessage` and exit through the synthesiser (which knows how to
|
|
14
|
+
* render the failure into the final output), keeping the success and
|
|
15
|
+
* failure paths converged on one terminal node.
|
|
16
|
+
*
|
|
17
|
+
* START
|
|
18
|
+
* │
|
|
19
|
+
* ▼
|
|
20
|
+
* planner
|
|
21
|
+
* │
|
|
22
|
+
* ▼
|
|
23
|
+
* researcher
|
|
24
|
+
* ╱ ╲
|
|
25
|
+
* error continue
|
|
26
|
+
* ╲ ╱
|
|
27
|
+
* (human-review) ← inserted only if LANGGRAPH_HITL_ENABLED=true
|
|
28
|
+
* │
|
|
29
|
+
* ▼
|
|
30
|
+
* synthesiser
|
|
31
|
+
* │
|
|
32
|
+
* ▼
|
|
33
|
+
* END
|
|
34
|
+
*
|
|
35
|
+
* The human-review node is dynamic-imported only when the env var is
|
|
36
|
+
* set so projects that didn't install the HITL scaffolding (the file
|
|
37
|
+
* isn't emitted unless `human_in_loop=true` at install) don't pay an
|
|
38
|
+
* unresolved-import cost.
|
|
39
|
+
*/
|
|
40
|
+
export async function buildMainGraph(checkpointer: BaseCheckpointSaver) {
|
|
41
|
+
const builder = new StateGraph(GraphStateAnnotation)
|
|
42
|
+
.addNode("planner", plannerNode)
|
|
43
|
+
.addNode("researcher", researcherNode)
|
|
44
|
+
.addNode("synthesiser", synthesiserNode);
|
|
45
|
+
|
|
46
|
+
const interruptBefore: string[] = [];
|
|
47
|
+
|
|
48
|
+
if (process.env.LANGGRAPH_HITL_ENABLED === "true") {
|
|
49
|
+
let humanReviewNode: typeof import("../nodes/human-review.node").humanReviewNode;
|
|
50
|
+
try {
|
|
51
|
+
({ humanReviewNode } = await import("../nodes/human-review.node"));
|
|
52
|
+
} catch (err) {
|
|
53
|
+
throw new Error(
|
|
54
|
+
"LANGGRAPH_HITL_ENABLED=true but ../nodes/human-review.node is not present. Re-run the template generator with human_in_loop=true (or unset LANGGRAPH_HITL_ENABLED to disable the interrupt).",
|
|
55
|
+
{ cause: err },
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
builder
|
|
59
|
+
.addNode("human-review", humanReviewNode)
|
|
60
|
+
.addEdge(START, "planner")
|
|
61
|
+
.addEdge("planner", "researcher")
|
|
62
|
+
.addConditionalEdges("researcher", routeAfterError, {
|
|
63
|
+
continue: "human-review",
|
|
64
|
+
error: "synthesiser",
|
|
65
|
+
})
|
|
66
|
+
.addEdge("human-review", "synthesiser")
|
|
67
|
+
.addEdge("synthesiser", END);
|
|
68
|
+
interruptBefore.push("human-review");
|
|
69
|
+
} else {
|
|
70
|
+
builder
|
|
71
|
+
.addEdge(START, "planner")
|
|
72
|
+
.addEdge("planner", "researcher")
|
|
73
|
+
.addConditionalEdges("researcher", routeAfterError, {
|
|
74
|
+
continue: "synthesiser",
|
|
75
|
+
error: "synthesiser",
|
|
76
|
+
})
|
|
77
|
+
.addEdge("synthesiser", END);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return builder.compile({ checkpointer, interruptBefore });
|
|
81
|
+
}
|
package/dist/templates/langgraph/files/src/infrastructure/langgraph/graphs/simple-chain.graph.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { END, START, StateGraph } from "@langchain/langgraph";
|
|
2
|
+
import type { BaseCheckpointSaver } from "@langchain/langgraph";
|
|
3
|
+
import { GraphStateAnnotation } from "../state/graph-state";
|
|
4
|
+
import { routeAfterError } from "../edges/routing";
|
|
5
|
+
import { inputProcessorNode } from "../nodes/input-processor.node";
|
|
6
|
+
import { llmCallNode } from "../nodes/llm-call.node";
|
|
7
|
+
import { outputFormatterNode } from "../nodes/output-formatter.node";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Linear example graph: input-processor → llm-call → output-formatter.
|
|
11
|
+
* Errors short-circuit straight to output-formatter so the failure mode
|
|
12
|
+
* goes through the same exit path as success — keeps the API contract
|
|
13
|
+
* (always returns a string output + steps audit) consistent for callers.
|
|
14
|
+
*
|
|
15
|
+
* START
|
|
16
|
+
* │
|
|
17
|
+
* ▼
|
|
18
|
+
* input-processor
|
|
19
|
+
* │
|
|
20
|
+
* ▼
|
|
21
|
+
* llm-call
|
|
22
|
+
* ╱ ╲
|
|
23
|
+
* error continue
|
|
24
|
+
* ╲ ╱
|
|
25
|
+
* (human-review) ← inserted only if LANGGRAPH_HITL_ENABLED=true
|
|
26
|
+
* │
|
|
27
|
+
* ▼
|
|
28
|
+
* output-formatter
|
|
29
|
+
* │
|
|
30
|
+
* ▼
|
|
31
|
+
* END
|
|
32
|
+
*
|
|
33
|
+
* The human-review node is dynamic-imported only when the env var is
|
|
34
|
+
* set so projects that didn't install the HITL scaffolding (the file
|
|
35
|
+
* isn't emitted unless `human_in_loop=true` at install) don't pay an
|
|
36
|
+
* unresolved-import cost. If the env var is on but the file is missing,
|
|
37
|
+
* we throw a clear "re-run the generator with human_in_loop=true"
|
|
38
|
+
* message instead of bubbling up Node's raw ERR_MODULE_NOT_FOUND.
|
|
39
|
+
*/
|
|
40
|
+
export async function buildMainGraph(checkpointer: BaseCheckpointSaver) {
|
|
41
|
+
const builder = new StateGraph(GraphStateAnnotation)
|
|
42
|
+
.addNode("input-processor", inputProcessorNode)
|
|
43
|
+
.addNode("llm-call", llmCallNode)
|
|
44
|
+
.addNode("output-formatter", outputFormatterNode);
|
|
45
|
+
|
|
46
|
+
const interruptBefore: string[] = [];
|
|
47
|
+
|
|
48
|
+
if (process.env.LANGGRAPH_HITL_ENABLED === "true") {
|
|
49
|
+
let humanReviewNode: typeof import("../nodes/human-review.node").humanReviewNode;
|
|
50
|
+
try {
|
|
51
|
+
({ humanReviewNode } = await import("../nodes/human-review.node"));
|
|
52
|
+
} catch (err) {
|
|
53
|
+
throw new Error(
|
|
54
|
+
"LANGGRAPH_HITL_ENABLED=true but ../nodes/human-review.node is not present. Re-run the template generator with human_in_loop=true (or unset LANGGRAPH_HITL_ENABLED to disable the interrupt).",
|
|
55
|
+
{ cause: err },
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
builder
|
|
59
|
+
.addNode("human-review", humanReviewNode)
|
|
60
|
+
.addEdge(START, "input-processor")
|
|
61
|
+
.addEdge("input-processor", "llm-call")
|
|
62
|
+
.addConditionalEdges("llm-call", routeAfterError, {
|
|
63
|
+
continue: "human-review",
|
|
64
|
+
error: "output-formatter",
|
|
65
|
+
})
|
|
66
|
+
.addEdge("human-review", "output-formatter")
|
|
67
|
+
.addEdge("output-formatter", END);
|
|
68
|
+
interruptBefore.push("human-review");
|
|
69
|
+
} else {
|
|
70
|
+
builder
|
|
71
|
+
.addEdge(START, "input-processor")
|
|
72
|
+
.addEdge("input-processor", "llm-call")
|
|
73
|
+
.addConditionalEdges("llm-call", routeAfterError, {
|
|
74
|
+
continue: "output-formatter",
|
|
75
|
+
error: "output-formatter",
|
|
76
|
+
})
|
|
77
|
+
.addEdge("output-formatter", END);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return builder.compile({ checkpointer, interruptBefore });
|
|
81
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Barrel — the consumer-facing surface for the LangGraph integration.
|
|
2
|
+
// App code imports `langGraphAdapter` (or the `AgentGraphPort` type) from
|
|
3
|
+
// here; the underlying graph file, node files, and checkpointer choice
|
|
4
|
+
// stay internal and can be reshuffled without breaking callers.
|
|
5
|
+
|
|
6
|
+
export type {
|
|
7
|
+
AgentGraphPort,
|
|
8
|
+
GraphConfig,
|
|
9
|
+
GraphError,
|
|
10
|
+
GraphEvent,
|
|
11
|
+
GraphInput,
|
|
12
|
+
GraphInvokeResult,
|
|
13
|
+
GraphOutput,
|
|
14
|
+
GraphStateSnapshot,
|
|
15
|
+
} from "../../domain/ports/out/agent-graph.port";
|
|
16
|
+
|
|
17
|
+
export { LangGraphAdapter, langGraphAdapter } from "./adapters/langgraph.adapter";
|
|
18
|
+
export { getCheckpointer, resetCheckpointerCache } from "./checkpointers";
|
|
19
|
+
export {
|
|
20
|
+
GraphStateAnnotation,
|
|
21
|
+
type GraphState,
|
|
22
|
+
type GraphStateUpdate,
|
|
23
|
+
} from "./state/graph-state";
|
package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/human-review.node.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { GraphState, GraphStateUpdate } from "../state/graph-state";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Human-in-the-loop pause point. Wire this into your graph BEFORE the
|
|
5
|
+
* node you want a human to approve, and compile with
|
|
6
|
+
* `interruptBefore: ["human-review"]` so LangGraph pauses execution
|
|
7
|
+
* when control reaches this node. The graph state is checkpointed at
|
|
8
|
+
* the pause; the /api/agent/resume route calls
|
|
9
|
+
* `adapter.resume(threadId, humanInput)`, which writes ONLY humanInput
|
|
10
|
+
* as a partial state update — the original `input` prompt stays intact.
|
|
11
|
+
*
|
|
12
|
+
* Downstream nodes can read state.humanInput AND state.input as two
|
|
13
|
+
* distinct values: the original user question vs the reviewer's
|
|
14
|
+
* feedback. This node intentionally does not fold humanInput into
|
|
15
|
+
* input — that would erase the original prompt and surprise any
|
|
16
|
+
* subsequent node that re-reads it.
|
|
17
|
+
*
|
|
18
|
+
* Toggle the interrupt at runtime via `LANGGRAPH_HITL_ENABLED` if you
|
|
19
|
+
* want a single graph definition that can run with or without the
|
|
20
|
+
* pause depending on environment.
|
|
21
|
+
*/
|
|
22
|
+
export async function humanReviewNode(
|
|
23
|
+
state: GraphState,
|
|
24
|
+
): Promise<GraphStateUpdate> {
|
|
25
|
+
if (typeof state.humanInput === "string" && state.humanInput.length > 0) {
|
|
26
|
+
// Tag the audit trail so downstream nodes and `/getState` consumers
|
|
27
|
+
// can tell a resumed run from a first-pass one. The humanInput stays
|
|
28
|
+
// on state for downstream nodes to read; clearing it would silently
|
|
29
|
+
// drop the reviewer's signal between this node and the next.
|
|
30
|
+
return { steps: ["human-review:resumed"] };
|
|
31
|
+
}
|
|
32
|
+
// Resumed without input — treat as "approve unchanged" and continue.
|
|
33
|
+
return { steps: ["human-review:approved-noop"] };
|
|
34
|
+
}
|
package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/input-processor.node.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { GraphState, GraphStateUpdate } from "../state/graph-state";
|
|
2
|
+
|
|
3
|
+
const MAX_INPUT_CHARS = 8_000;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Validate + sanitise the user prompt before any LLM call. This is the
|
|
7
|
+
* first node — if it sets `errorMessage`, downstream nodes can use the
|
|
8
|
+
* shared error-routing helper to short-circuit straight to the output
|
|
9
|
+
* formatter, so each example graph stays readable.
|
|
10
|
+
*/
|
|
11
|
+
export async function inputProcessorNode(
|
|
12
|
+
state: GraphState,
|
|
13
|
+
): Promise<GraphStateUpdate> {
|
|
14
|
+
const raw = state.input?.trim() ?? "";
|
|
15
|
+
if (raw.length === 0) {
|
|
16
|
+
return {
|
|
17
|
+
errorMessage: "prompt cannot be empty",
|
|
18
|
+
steps: ["input-processor:rejected:empty"],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
if (raw.length > MAX_INPUT_CHARS) {
|
|
22
|
+
return {
|
|
23
|
+
errorMessage: `prompt exceeds ${MAX_INPUT_CHARS} chars`,
|
|
24
|
+
steps: ["input-processor:rejected:too-long"],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
input: raw,
|
|
29
|
+
steps: ["input-processor:ok"],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AIMessage, HumanMessage } from "@langchain/core/messages";
|
|
2
|
+
import type { GraphState, GraphStateUpdate } from "../state/graph-state";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Dispatches the prompt to the project's LLM adapter and stores both the
|
|
6
|
+
* Human + AI messages on state. Reads through the `llmClient` instance
|
|
7
|
+
* the llm-adapter template emits — swap the import below if you've
|
|
8
|
+
* structured your DI differently.
|
|
9
|
+
*
|
|
10
|
+
* The error case sets `errorMessage` so `routeAfterError` can fork to
|
|
11
|
+
* the output formatter (and then END) without each subsequent node
|
|
12
|
+
* needing to defensively check.
|
|
13
|
+
*/
|
|
14
|
+
import { llmClient } from "../../llm";
|
|
15
|
+
|
|
16
|
+
export async function llmCallNode(
|
|
17
|
+
state: GraphState,
|
|
18
|
+
): Promise<GraphStateUpdate> {
|
|
19
|
+
if (state.errorMessage) {
|
|
20
|
+
// Earlier node failed; pass through so the formatter can render it.
|
|
21
|
+
return { steps: ["llm-call:skipped"] };
|
|
22
|
+
}
|
|
23
|
+
const response = await llmClient.call(state.input);
|
|
24
|
+
if (!response.ok) {
|
|
25
|
+
return {
|
|
26
|
+
errorMessage: `llm-call failed: ${response.error.message}`,
|
|
27
|
+
steps: [`llm-call:error:${response.error.kind}`],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
messages: [
|
|
32
|
+
new HumanMessage(state.input),
|
|
33
|
+
new AIMessage(response.value.content),
|
|
34
|
+
],
|
|
35
|
+
output: response.value.content,
|
|
36
|
+
steps: ["llm-call:ok"],
|
|
37
|
+
};
|
|
38
|
+
}
|
package/dist/templates/langgraph/files/src/infrastructure/langgraph/nodes/output-formatter.node.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { GraphState, GraphStateUpdate } from "../state/graph-state";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Terminal node — turns whatever the LLM produced (or whatever the
|
|
5
|
+
* error path captured) into the final `output` string. Kept deliberately
|
|
6
|
+
* thin: real formatting concerns (markdown rendering, length capping,
|
|
7
|
+
* citations…) belong in dedicated nodes downstream, not here.
|
|
8
|
+
*/
|
|
9
|
+
export async function outputFormatterNode(
|
|
10
|
+
state: GraphState,
|
|
11
|
+
): Promise<GraphStateUpdate> {
|
|
12
|
+
if (state.errorMessage) {
|
|
13
|
+
return {
|
|
14
|
+
output: `Sorry, the request failed: ${state.errorMessage}`,
|
|
15
|
+
steps: ["output-formatter:error-rendered"],
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
if (state.output) {
|
|
19
|
+
// LLM already produced a final string; pass it through unmodified
|
|
20
|
+
// and mark the step so the audit trail is complete.
|
|
21
|
+
return { steps: ["output-formatter:passthrough"] };
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
output: "(no output produced)",
|
|
25
|
+
steps: ["output-formatter:empty"],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { AIMessage } from "@langchain/core/messages";
|
|
2
|
+
import type { GraphState, GraphStateUpdate } from "../state/graph-state";
|
|
3
|
+
import { llmClient } from "../../llm";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Breaks the user prompt into a short list of sub-questions the
|
|
7
|
+
* researcher node will tackle in parallel. The plan itself is stored
|
|
8
|
+
* on state via the `messages` channel so downstream nodes can read it
|
|
9
|
+
* without us widening the GraphState schema for one example graph.
|
|
10
|
+
*
|
|
11
|
+
* The "plan" is intentionally a newline-separated list rather than a
|
|
12
|
+
* structured array — keeps the demo template free of a Zod dependency
|
|
13
|
+
* just for parsing.
|
|
14
|
+
*/
|
|
15
|
+
const PLANNER_SYSTEM_PROMPT = [
|
|
16
|
+
"You are a research planner.",
|
|
17
|
+
"Given a user question, output 3-5 concise sub-questions that, if",
|
|
18
|
+
"answered, would let you write a thorough response.",
|
|
19
|
+
"Output one sub-question per line. No numbering. No commentary.",
|
|
20
|
+
].join("\n");
|
|
21
|
+
|
|
22
|
+
export async function plannerNode(
|
|
23
|
+
state: GraphState,
|
|
24
|
+
): Promise<GraphStateUpdate> {
|
|
25
|
+
if (state.errorMessage) return { steps: ["planner:skipped"] };
|
|
26
|
+
const response = await llmClient.call(state.input, {
|
|
27
|
+
systemPrompt: PLANNER_SYSTEM_PROMPT,
|
|
28
|
+
});
|
|
29
|
+
if (!response.ok) {
|
|
30
|
+
return {
|
|
31
|
+
errorMessage: `planner failed: ${response.error.message}`,
|
|
32
|
+
steps: [`planner:error:${response.error.kind}`],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const subQuestions = response.value.content
|
|
36
|
+
.split("\n")
|
|
37
|
+
.map((s) => s.trim())
|
|
38
|
+
.filter(Boolean);
|
|
39
|
+
// The downstream researcher node reads the sub-questions back out via
|
|
40
|
+
// the last AI message — we tag it so the synthesiser can identify it.
|
|
41
|
+
// Construct a real AIMessage instance (rather than a plain { type, content }
|
|
42
|
+
// object cast through `as never`) so the messages array stays homogeneous
|
|
43
|
+
// and downstream `instanceof BaseMessage` checks succeed.
|
|
44
|
+
const planMessage = new AIMessage(
|
|
45
|
+
`<plan>\n${subQuestions.join("\n")}\n</plan>`,
|
|
46
|
+
);
|
|
47
|
+
return {
|
|
48
|
+
messages: response.value.content ? [planMessage] : [],
|
|
49
|
+
steps: [`planner:ok:${subQuestions.length}-questions`],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { AIMessage } from "@langchain/core/messages";
|
|
2
|
+
import type { GraphState, GraphStateUpdate } from "../state/graph-state";
|
|
3
|
+
import { llmClient } from "../../llm";
|
|
4
|
+
|
|
5
|
+
const RESEARCHER_SYSTEM_PROMPT = [
|
|
6
|
+
"You are answering one sub-question that's part of a larger research task.",
|
|
7
|
+
"Be precise. Cite caveats. 3-4 sentences max.",
|
|
8
|
+
].join("\n");
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Iterates the sub-questions emitted by the planner and asks the LLM
|
|
12
|
+
* each one. Calls are issued in parallel via `Promise.all`; for many
|
|
13
|
+
* sub-questions you'd want a concurrency limiter or BullMQ fan-out,
|
|
14
|
+
* but the example stays simple to keep the graph readable.
|
|
15
|
+
*
|
|
16
|
+
* The combined answers are appended as a single message tagged
|
|
17
|
+
* `<answers>…</answers>` so the synthesiser can grep it out without
|
|
18
|
+
* needing a new state field.
|
|
19
|
+
*/
|
|
20
|
+
export async function researcherNode(
|
|
21
|
+
state: GraphState,
|
|
22
|
+
): Promise<GraphStateUpdate> {
|
|
23
|
+
if (state.errorMessage) return { steps: ["researcher:skipped"] };
|
|
24
|
+
// The planner node emitted its plan as the last AI message wrapped in
|
|
25
|
+
// <plan> tags; extract the sub-questions back out.
|
|
26
|
+
const lastMessage = state.messages[state.messages.length - 1];
|
|
27
|
+
const rawContent =
|
|
28
|
+
typeof lastMessage?.content === "string"
|
|
29
|
+
? lastMessage.content
|
|
30
|
+
: JSON.stringify(lastMessage?.content ?? "");
|
|
31
|
+
const planMatch = rawContent.match(/<plan>\s*([\s\S]*?)\s*<\/plan>/);
|
|
32
|
+
const subQuestions = (planMatch?.[1] ?? "")
|
|
33
|
+
.split("\n")
|
|
34
|
+
.map((s) => s.trim())
|
|
35
|
+
.filter(Boolean);
|
|
36
|
+
if (subQuestions.length === 0) {
|
|
37
|
+
return {
|
|
38
|
+
errorMessage: "researcher: no sub-questions in plan",
|
|
39
|
+
steps: ["researcher:error:no-plan"],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const answers = await Promise.all(
|
|
43
|
+
subQuestions.map(async (q) => {
|
|
44
|
+
const response = await llmClient.call(q, {
|
|
45
|
+
systemPrompt: RESEARCHER_SYSTEM_PROMPT,
|
|
46
|
+
});
|
|
47
|
+
if (!response.ok) {
|
|
48
|
+
return `Q: ${q}\nA: (failed: ${response.error.message})`;
|
|
49
|
+
}
|
|
50
|
+
return `Q: ${q}\nA: ${response.value.content}`;
|
|
51
|
+
}),
|
|
52
|
+
);
|
|
53
|
+
// Real AIMessage instance so the messages array stays type-correct;
|
|
54
|
+
// downstream nodes (and any consumer that does `instanceof BaseMessage`)
|
|
55
|
+
// see a uniform shape instead of a plain object cast through `as never`.
|
|
56
|
+
const answersMessage = new AIMessage(
|
|
57
|
+
`<answers>\n${answers.join("\n\n")}\n</answers>`,
|
|
58
|
+
);
|
|
59
|
+
return {
|
|
60
|
+
messages: [answersMessage],
|
|
61
|
+
steps: [`researcher:ok:${answers.length}-answered`],
|
|
62
|
+
};
|
|
63
|
+
}
|