create-relkit 0.5.6 → 0.7.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/dist/add-name.d.ts +8 -1
- package/dist/add-name.d.ts.map +1 -1
- package/dist/add-name.js +5 -1
- package/dist/add-name.js.map +1 -1
- package/dist/add-options-parser.d.ts +49 -0
- package/dist/add-options-parser.d.ts.map +1 -1
- package/dist/add-options-parser.js +52 -0
- package/dist/add-options-parser.js.map +1 -1
- package/dist/add-options-resource.d.ts +8 -0
- package/dist/add-options-resource.d.ts.map +1 -1
- package/dist/add-options-resource.js +8 -0
- package/dist/add-options-resource.js.map +1 -1
- package/dist/add-options.d.ts +6 -1
- package/dist/add-options.d.ts.map +1 -1
- package/dist/add-options.js +48 -1
- package/dist/add-options.js.map +1 -1
- package/dist/add-output.d.ts +10 -0
- package/dist/add-output.d.ts.map +1 -1
- package/dist/add-output.js +21 -0
- package/dist/add-output.js.map +1 -1
- package/dist/add-plan.d.ts +25 -0
- package/dist/add-plan.d.ts.map +1 -1
- package/dist/add-plan.js +91 -57
- package/dist/add-plan.js.map +1 -1
- package/dist/add-plan.types.d.ts +13 -0
- package/dist/add-plan.types.d.ts.map +1 -0
- package/dist/add-plan.types.js +2 -0
- package/dist/add-plan.types.js.map +1 -0
- package/dist/add-resolution-discovery.d.ts +56 -2
- package/dist/add-resolution-discovery.d.ts.map +1 -1
- package/dist/add-resolution-discovery.js +74 -10
- package/dist/add-resolution-discovery.js.map +1 -1
- package/dist/add-resolution-prompt.d.ts +46 -0
- package/dist/add-resolution-prompt.d.ts.map +1 -0
- package/dist/add-resolution-prompt.js +88 -0
- package/dist/add-resolution-prompt.js.map +1 -0
- package/dist/add-resolution-state-base.d.ts +112 -0
- package/dist/add-resolution-state-base.d.ts.map +1 -0
- package/dist/add-resolution-state-base.js +141 -0
- package/dist/add-resolution-state-base.js.map +1 -0
- package/dist/add-resolution-state.d.ts +66 -11
- package/dist/add-resolution-state.d.ts.map +1 -1
- package/dist/add-resolution-state.js +81 -69
- package/dist/add-resolution-state.js.map +1 -1
- package/dist/add-resolution-state.types.d.ts +6 -0
- package/dist/add-resolution-state.types.d.ts.map +1 -0
- package/dist/add-resolution-state.types.js +2 -0
- package/dist/add-resolution-state.types.js.map +1 -0
- package/dist/add-resolver-domain-execution.d.ts +35 -0
- package/dist/add-resolver-domain-execution.d.ts.map +1 -0
- package/dist/add-resolver-domain-execution.js +101 -0
- package/dist/add-resolver-domain-execution.js.map +1 -0
- package/dist/add-resolver-domain-input.d.ts +30 -0
- package/dist/add-resolver-domain-input.d.ts.map +1 -0
- package/dist/add-resolver-domain-input.js +83 -0
- package/dist/add-resolver-domain-input.js.map +1 -0
- package/dist/add-resolver-domain.d.ts +17 -0
- package/dist/add-resolver-domain.d.ts.map +1 -1
- package/dist/add-resolver-domain.js +36 -136
- package/dist/add-resolver-domain.js.map +1 -1
- package/dist/add-resolver-platform.d.ts +17 -0
- package/dist/add-resolver-platform.d.ts.map +1 -1
- package/dist/add-resolver-platform.js +83 -36
- package/dist/add-resolver-platform.js.map +1 -1
- package/dist/add-resolver-provider.d.ts +15 -0
- package/dist/add-resolver-provider.d.ts.map +1 -0
- package/dist/add-resolver-provider.js +67 -0
- package/dist/add-resolver-provider.js.map +1 -0
- package/dist/add-resolver-resources.d.ts +17 -0
- package/dist/add-resolver-resources.d.ts.map +1 -1
- package/dist/add-resolver-resources.js +79 -85
- package/dist/add-resolver-resources.js.map +1 -1
- package/dist/add-resolver.d.ts +33 -9
- package/dist/add-resolver.d.ts.map +1 -1
- package/dist/add-resolver.js +70 -31
- package/dist/add-resolver.js.map +1 -1
- package/dist/add-resolver.types.d.ts +27 -0
- package/dist/add-resolver.types.d.ts.map +1 -0
- package/dist/add-resolver.types.js +2 -0
- package/dist/add-resolver.types.js.map +1 -0
- package/dist/add-transaction-files-compat.d.ts +33 -0
- package/dist/add-transaction-files-compat.d.ts.map +1 -0
- package/dist/add-transaction-files-compat.js +42 -0
- package/dist/add-transaction-files-compat.js.map +1 -0
- package/dist/add-transaction-files.d.ts +49 -9
- package/dist/add-transaction-files.d.ts.map +1 -1
- package/dist/add-transaction-files.js +122 -74
- package/dist/add-transaction-files.js.map +1 -1
- package/dist/add-transaction-files.types.d.ts +7 -0
- package/dist/add-transaction-files.types.d.ts.map +1 -0
- package/dist/add-transaction-files.types.js +2 -0
- package/dist/add-transaction-files.types.js.map +1 -0
- package/dist/add-transaction-process.d.ts +37 -0
- package/dist/add-transaction-process.d.ts.map +1 -0
- package/dist/add-transaction-process.js +54 -0
- package/dist/add-transaction-process.js.map +1 -0
- package/dist/add-transaction-workflow.d.ts +23 -0
- package/dist/add-transaction-workflow.d.ts.map +1 -0
- package/dist/add-transaction-workflow.js +77 -0
- package/dist/add-transaction-workflow.js.map +1 -0
- package/dist/add-transaction.d.ts +26 -13
- package/dist/add-transaction.d.ts.map +1 -1
- package/dist/add-transaction.js +55 -105
- package/dist/add-transaction.js.map +1 -1
- package/dist/add-transaction.types.d.ts +32 -0
- package/dist/add-transaction.types.d.ts.map +1 -0
- package/dist/add-transaction.types.js +2 -0
- package/dist/add-transaction.types.js.map +1 -0
- package/dist/add-types.d.ts +56 -0
- package/dist/add-types.d.ts.map +1 -1
- package/dist/add-types.js +15 -0
- package/dist/add-types.js.map +1 -1
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +83 -0
- package/dist/bin.js.map +1 -0
- package/dist/bucket-profiles.d.ts +17 -3
- package/dist/bucket-profiles.d.ts.map +1 -1
- package/dist/bucket-profiles.js +27 -5
- package/dist/bucket-profiles.js.map +1 -1
- package/dist/bucket-profiles.types.d.ts +9 -0
- package/dist/bucket-profiles.types.d.ts.map +1 -0
- package/dist/bucket-profiles.types.js +2 -0
- package/dist/bucket-profiles.types.js.map +1 -0
- package/dist/build-catalog.d.ts +14 -0
- package/dist/build-catalog.d.ts.map +1 -0
- package/dist/build-catalog.js +70 -0
- package/dist/build-catalog.js.map +1 -0
- package/dist/catalog-resolution.d.ts +12 -0
- package/dist/catalog-resolution.d.ts.map +1 -0
- package/dist/catalog-resolution.js +43 -0
- package/dist/catalog-resolution.js.map +1 -0
- package/dist/catalog-resolution.types.d.ts +3 -0
- package/dist/catalog-resolution.types.d.ts.map +1 -0
- package/dist/catalog-resolution.types.js +2 -0
- package/dist/catalog-resolution.types.js.map +1 -0
- package/dist/create-preview.d.ts +30 -7
- package/dist/create-preview.d.ts.map +1 -1
- package/dist/create-preview.js +41 -11
- package/dist/create-preview.js.map +1 -1
- package/dist/create-preview.types.d.ts +9 -0
- package/dist/create-preview.types.d.ts.map +1 -0
- package/dist/create-preview.types.js +2 -0
- package/dist/create-preview.types.js.map +1 -0
- package/dist/create-resolver.d.ts +27 -10
- package/dist/create-resolver.d.ts.map +1 -1
- package/dist/create-resolver.js +105 -74
- package/dist/create-resolver.js.map +1 -1
- package/dist/create-resolver.types.d.ts +15 -0
- package/dist/create-resolver.types.d.ts.map +1 -0
- package/dist/create-resolver.types.js +2 -0
- package/dist/create-resolver.types.js.map +1 -0
- package/dist/dependency-patch-installation.d.ts +16 -0
- package/dist/dependency-patch-installation.d.ts.map +1 -0
- package/dist/dependency-patch-installation.js +59 -0
- package/dist/dependency-patch-installation.js.map +1 -0
- package/dist/dependency-patches.d.ts +57 -0
- package/dist/dependency-patches.d.ts.map +1 -0
- package/dist/dependency-patches.js +134 -0
- package/dist/dependency-patches.js.map +1 -0
- package/dist/dependency-patches.types.d.ts +21 -0
- package/dist/dependency-patches.types.d.ts.map +1 -0
- package/dist/dependency-patches.types.js +2 -0
- package/dist/dependency-patches.types.js.map +1 -0
- package/dist/domain-artifact.d.ts +76 -0
- package/dist/domain-artifact.d.ts.map +1 -0
- package/dist/domain-artifact.js +115 -0
- package/dist/domain-artifact.js.map +1 -0
- package/dist/domain-planning.d.ts +36 -20
- package/dist/domain-planning.d.ts.map +1 -1
- package/dist/domain-planning.js +45 -55
- package/dist/domain-planning.js.map +1 -1
- package/dist/domain-planning.types.d.ts +21 -0
- package/dist/domain-planning.types.d.ts.map +1 -0
- package/dist/domain-planning.types.js +2 -0
- package/dist/domain-planning.types.js.map +1 -0
- package/dist/generate-deployment.d.ts +18 -0
- package/dist/generate-deployment.d.ts.map +1 -0
- package/dist/generate-deployment.js +100 -0
- package/dist/generate-deployment.js.map +1 -0
- package/dist/generate-files-compat.d.ts +43 -0
- package/dist/generate-files-compat.d.ts.map +1 -0
- package/dist/generate-files-compat.js +56 -0
- package/dist/generate-files-compat.js.map +1 -0
- package/dist/generate-files-utilities.d.ts +63 -10
- package/dist/generate-files-utilities.d.ts.map +1 -1
- package/dist/generate-files-utilities.js +99 -48
- package/dist/generate-files-utilities.js.map +1 -1
- package/dist/generate-files-utilities.types.d.ts +6 -0
- package/dist/generate-files-utilities.types.d.ts.map +1 -0
- package/dist/generate-files-utilities.types.js +2 -0
- package/dist/generate-files-utilities.types.js.map +1 -0
- package/dist/generate-files.d.ts +30 -1
- package/dist/generate-files.d.ts.map +1 -1
- package/dist/generate-files.js +56 -85
- package/dist/generate-files.js.map +1 -1
- package/dist/generate-output.d.ts +14 -17
- package/dist/generate-output.d.ts.map +1 -1
- package/dist/generate-output.js +27 -0
- package/dist/generate-output.js.map +1 -1
- package/dist/generate-output.types.d.ts +21 -0
- package/dist/generate-output.types.d.ts.map +1 -0
- package/dist/generate-output.types.js +2 -0
- package/dist/generate-output.types.js.map +1 -0
- package/dist/generate-process.d.ts +60 -0
- package/dist/generate-process.d.ts.map +1 -1
- package/dist/generate-process.js +95 -31
- package/dist/generate-process.js.map +1 -1
- package/dist/generate-stage-cleanup.d.ts +17 -0
- package/dist/generate-stage-cleanup.d.ts.map +1 -0
- package/dist/generate-stage-cleanup.js +30 -0
- package/dist/generate-stage-cleanup.js.map +1 -0
- package/dist/generate-types.d.ts +36 -0
- package/dist/generate-types.d.ts.map +1 -1
- package/dist/generate-types.js +16 -0
- package/dist/generate-types.js.map +1 -1
- package/dist/generate-workflow.d.ts +31 -0
- package/dist/generate-workflow.d.ts.map +1 -0
- package/dist/generate-workflow.js +117 -0
- package/dist/generate-workflow.js.map +1 -0
- package/dist/generate.d.ts +29 -1
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +55 -97
- package/dist/generate.js.map +1 -1
- package/dist/generate.service.types.d.ts +15 -0
- package/dist/generate.service.types.d.ts.map +1 -0
- package/dist/generate.service.types.js +2 -0
- package/dist/generate.service.types.js.map +1 -0
- package/dist/generator-cleanup.d.ts +27 -0
- package/dist/generator-cleanup.d.ts.map +1 -0
- package/dist/generator-cleanup.js +64 -0
- package/dist/generator-cleanup.js.map +1 -0
- package/dist/generator-cleanup.types.d.ts +6 -0
- package/dist/generator-cleanup.types.d.ts.map +1 -0
- package/dist/generator-cleanup.types.js +2 -0
- package/dist/generator-cleanup.types.js.map +1 -0
- package/dist/generator-errors.d.ts +74 -0
- package/dist/generator-errors.d.ts.map +1 -0
- package/dist/generator-errors.js +89 -0
- package/dist/generator-errors.js.map +1 -0
- package/dist/generator-filesystem.d.ts +25 -0
- package/dist/generator-filesystem.d.ts.map +1 -0
- package/dist/generator-filesystem.js +68 -0
- package/dist/generator-filesystem.js.map +1 -0
- package/dist/generator-filesystem.types.d.ts +112 -0
- package/dist/generator-filesystem.types.d.ts.map +1 -0
- package/dist/generator-filesystem.types.js +2 -0
- package/dist/generator-filesystem.types.js.map +1 -0
- package/dist/generator-paths.d.ts +13 -0
- package/dist/generator-paths.d.ts.map +1 -0
- package/dist/generator-paths.js +45 -0
- package/dist/generator-paths.js.map +1 -0
- package/dist/generator-paths.types.d.ts +40 -0
- package/dist/generator-paths.types.d.ts.map +1 -0
- package/dist/generator-paths.types.js +2 -0
- package/dist/generator-paths.types.js.map +1 -0
- package/dist/generator-process.d.ts +25 -0
- package/dist/generator-process.d.ts.map +1 -0
- package/dist/generator-process.js +124 -0
- package/dist/generator-process.js.map +1 -0
- package/dist/generator-process.types.d.ts +27 -0
- package/dist/generator-process.types.d.ts.map +1 -0
- package/dist/generator-process.types.js +2 -0
- package/dist/generator-process.types.js.map +1 -0
- package/dist/generator-prompt.d.ts +22 -0
- package/dist/generator-prompt.d.ts.map +1 -0
- package/dist/generator-prompt.js +58 -0
- package/dist/generator-prompt.js.map +1 -0
- package/dist/generator-prompt.types.d.ts +38 -0
- package/dist/generator-prompt.types.d.ts.map +1 -0
- package/dist/generator-prompt.types.js +2 -0
- package/dist/generator-prompt.types.js.map +1 -0
- package/dist/generator-runtime.d.ts +22 -0
- package/dist/generator-runtime.d.ts.map +1 -0
- package/dist/generator-runtime.js +31 -0
- package/dist/generator-runtime.js.map +1 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -79
- package/dist/index.js.map +1 -1
- package/dist/options.d.ts +50 -1
- package/dist/options.d.ts.map +1 -1
- package/dist/options.js +48 -1
- package/dist/options.js.map +1 -1
- package/dist/patches/drizzle-orm.patch +692 -0
- package/dist/plan-builder-effects.d.ts +124 -0
- package/dist/plan-builder-effects.d.ts.map +1 -0
- package/dist/plan-builder-effects.js +172 -0
- package/dist/plan-builder-effects.js.map +1 -0
- package/dist/plan-builder-files.d.ts +12 -0
- package/dist/plan-builder-files.d.ts.map +1 -0
- package/dist/plan-builder-files.js +99 -0
- package/dist/plan-builder-files.js.map +1 -0
- package/dist/plan-builder-files.types.d.ts +49 -0
- package/dist/plan-builder-files.types.d.ts.map +1 -0
- package/dist/plan-builder-files.types.js +2 -0
- package/dist/plan-builder-files.types.js.map +1 -0
- package/dist/plan-builder-manifest.d.ts +11 -0
- package/dist/plan-builder-manifest.d.ts.map +1 -0
- package/dist/plan-builder-manifest.js +37 -0
- package/dist/plan-builder-manifest.js.map +1 -0
- package/dist/plan-builder.d.ts +78 -18
- package/dist/plan-builder.d.ts.map +1 -1
- package/dist/plan-builder.js +105 -126
- package/dist/plan-builder.js.map +1 -1
- package/dist/plan-builder.types.d.ts +22 -0
- package/dist/plan-builder.types.d.ts.map +1 -0
- package/dist/plan-builder.types.js +2 -0
- package/dist/plan-builder.types.js.map +1 -0
- package/dist/plan-manifest.d.ts +16 -4
- package/dist/plan-manifest.d.ts.map +1 -1
- package/dist/plan-manifest.js +60 -3
- package/dist/plan-manifest.js.map +1 -1
- package/dist/plan-manifest.types.d.ts +13 -0
- package/dist/plan-manifest.types.d.ts.map +1 -0
- package/dist/plan-manifest.types.js +2 -0
- package/dist/plan-manifest.types.js.map +1 -0
- package/dist/project-catalog.d.ts +17 -0
- package/dist/project-catalog.d.ts.map +1 -0
- package/dist/project-catalog.js +69 -0
- package/dist/project-catalog.js.map +1 -0
- package/dist/project-discovery-app.d.ts +7 -0
- package/dist/project-discovery-app.d.ts.map +1 -1
- package/dist/project-discovery-app.js +71 -0
- package/dist/project-discovery-app.js.map +1 -1
- package/dist/project-discovery-database.d.ts +10 -0
- package/dist/project-discovery-database.d.ts.map +1 -1
- package/dist/project-discovery-database.js +18 -0
- package/dist/project-discovery-database.js.map +1 -1
- package/dist/project-discovery-facts.d.ts +13 -0
- package/dist/project-discovery-facts.d.ts.map +1 -0
- package/dist/project-discovery-facts.js +170 -0
- package/dist/project-discovery-facts.js.map +1 -0
- package/dist/project-discovery-types.d.ts +15 -0
- package/dist/project-discovery-types.d.ts.map +1 -1
- package/dist/project-discovery.d.ts +31 -1
- package/dist/project-discovery.d.ts.map +1 -1
- package/dist/project-discovery.js +51 -147
- package/dist/project-discovery.js.map +1 -1
- package/dist/project-discovery.service.types.d.ts +13 -0
- package/dist/project-discovery.service.types.d.ts.map +1 -0
- package/dist/project-discovery.service.types.js +2 -0
- package/dist/project-discovery.service.types.js.map +1 -0
- package/dist/project-manifest.schemas.d.ts +22 -0
- package/dist/project-manifest.schemas.d.ts.map +1 -0
- package/dist/project-manifest.schemas.js +22 -0
- package/dist/project-manifest.schemas.js.map +1 -0
- package/dist/prompt-driver.d.ts +7 -30
- package/dist/prompt-driver.d.ts.map +1 -1
- package/dist/prompt-driver.js +25 -4
- package/dist/prompt-driver.js.map +1 -1
- package/dist/prompt-driver.types.d.ts +92 -0
- package/dist/prompt-driver.types.d.ts.map +1 -0
- package/dist/prompt-driver.types.js +2 -0
- package/dist/prompt-driver.types.js.map +1 -0
- package/dist/provider-planning-definitions.d.ts +43 -0
- package/dist/provider-planning-definitions.d.ts.map +1 -1
- package/dist/provider-planning-definitions.js +43 -0
- package/dist/provider-planning-definitions.js.map +1 -1
- package/dist/provider-planning.d.ts +37 -7
- package/dist/provider-planning.d.ts.map +1 -1
- package/dist/provider-planning.js +69 -76
- package/dist/provider-planning.js.map +1 -1
- package/dist/provider-planning.types.d.ts +14 -0
- package/dist/provider-planning.types.d.ts.map +1 -0
- package/dist/provider-planning.types.js +2 -0
- package/dist/provider-planning.types.js.map +1 -0
- package/dist/provider-profile-definition.d.ts +45 -0
- package/dist/provider-profile-definition.d.ts.map +1 -0
- package/dist/provider-profile-definition.js +93 -0
- package/dist/provider-profile-definition.js.map +1 -0
- package/dist/render-ai-sources.d.ts +20 -0
- package/dist/render-ai-sources.d.ts.map +1 -1
- package/dist/render-ai-sources.js +21 -0
- package/dist/render-ai-sources.js.map +1 -1
- package/dist/render-ai.d.ts +49 -0
- package/dist/render-ai.d.ts.map +1 -1
- package/dist/render-ai.js +62 -12
- package/dist/render-ai.js.map +1 -1
- package/dist/render-auth-schema.d.ts +5 -0
- package/dist/render-auth-schema.d.ts.map +1 -1
- package/dist/render-auth-schema.js +8 -0
- package/dist/render-auth-schema.js.map +1 -1
- package/dist/render-auth-sources.d.ts +8 -0
- package/dist/render-auth-sources.d.ts.map +1 -1
- package/dist/render-auth-sources.js +8 -0
- package/dist/render-auth-sources.js.map +1 -1
- package/dist/render-auth.d.ts +21 -0
- package/dist/render-auth.d.ts.map +1 -1
- package/dist/render-auth.js +86 -24
- package/dist/render-auth.js.map +1 -1
- package/dist/render-database-sources.d.ts +15 -0
- package/dist/render-database-sources.d.ts.map +1 -1
- package/dist/render-database-sources.js +15 -0
- package/dist/render-database-sources.js.map +1 -1
- package/dist/render-database.d.ts +24 -0
- package/dist/render-database.d.ts.map +1 -1
- package/dist/render-database.js +37 -17
- package/dist/render-database.js.map +1 -1
- package/dist/render-domain-callables.d.ts +67 -0
- package/dist/render-domain-callables.d.ts.map +1 -0
- package/dist/render-domain-callables.js +99 -0
- package/dist/render-domain-callables.js.map +1 -0
- package/dist/render-domain-events.d.ts +59 -0
- package/dist/render-domain-events.d.ts.map +1 -0
- package/dist/render-domain-events.js +92 -0
- package/dist/render-domain-events.js.map +1 -0
- package/dist/render-domain-jobs.d.ts +56 -0
- package/dist/render-domain-jobs.d.ts.map +1 -0
- package/dist/render-domain-jobs.js +84 -0
- package/dist/render-domain-jobs.js.map +1 -0
- package/dist/render-domain-register.d.ts +18 -0
- package/dist/render-domain-register.d.ts.map +1 -1
- package/dist/render-domain-register.js +27 -7
- package/dist/render-domain-register.js.map +1 -1
- package/dist/render-domain-sources.d.ts +63 -0
- package/dist/render-domain-sources.d.ts.map +1 -1
- package/dist/render-domain-sources.js +65 -0
- package/dist/render-domain-sources.js.map +1 -1
- package/dist/render-domain.d.ts +4 -25
- package/dist/render-domain.d.ts.map +1 -1
- package/dist/render-domain.js +3 -97
- package/dist/render-domain.js.map +1 -1
- package/dist/render-domain.types.d.ts +15 -0
- package/dist/render-domain.types.d.ts.map +1 -0
- package/dist/render-domain.types.js +2 -0
- package/dist/render-domain.types.js.map +1 -0
- package/dist/render-resource-sources.d.ts +12 -0
- package/dist/render-resource-sources.d.ts.map +1 -1
- package/dist/render-resource-sources.js +12 -0
- package/dist/render-resource-sources.js.map +1 -1
- package/dist/render-resources.d.ts +47 -0
- package/dist/render-resources.d.ts.map +1 -1
- package/dist/render-resources.js +62 -15
- package/dist/render-resources.js.map +1 -1
- package/dist/render-route-sources.d.ts +19 -0
- package/dist/render-route-sources.d.ts.map +1 -1
- package/dist/render-route-sources.js +19 -0
- package/dist/render-route-sources.js.map +1 -1
- package/dist/render-routes.d.ts +57 -0
- package/dist/render-routes.d.ts.map +1 -1
- package/dist/render-routes.js +72 -10
- package/dist/render-routes.js.map +1 -1
- package/dist/render-service.d.ts +23 -1
- package/dist/render-service.d.ts.map +1 -1
- package/dist/render-service.js +65 -20
- package/dist/render-service.js.map +1 -1
- package/dist/scaffold-catalog.d.ts +7 -6
- package/dist/scaffold-catalog.d.ts.map +1 -1
- package/dist/scaffold-catalog.js +11 -5
- package/dist/scaffold-catalog.js.map +1 -1
- package/dist/scaffold-catalog.types.d.ts +11 -0
- package/dist/scaffold-catalog.types.d.ts.map +1 -0
- package/dist/scaffold-catalog.types.js +2 -0
- package/dist/scaffold-catalog.types.js.map +1 -0
- package/dist/source-edit.d.ts +38 -2
- package/dist/source-edit.d.ts.map +1 -1
- package/dist/source-edit.js +39 -94
- package/dist/source-edit.js.map +1 -1
- package/dist/source-factory-edit.d.ts +78 -0
- package/dist/source-factory-edit.d.ts.map +1 -0
- package/dist/source-factory-edit.js +156 -0
- package/dist/source-factory-edit.js.map +1 -0
- package/dist/source-import-edit.d.ts +7 -1
- package/dist/source-import-edit.d.ts.map +1 -1
- package/dist/source-import-edit.js +20 -1
- package/dist/source-import-edit.js.map +1 -1
- package/dist/template-root.d.ts +15 -4
- package/dist/template-root.d.ts.map +1 -1
- package/dist/template-root.js +22 -5
- package/dist/template-root.js.map +1 -1
- package/dist/templates/default/README.md +1 -1
- package/dist/templates/default/v1/agent/package.json +4 -4
- package/dist/templates/default/v1/api/package.json +3 -3
- package/dist/templates/default/v1/fullstack/package.json +6 -6
- package/dist/templates/default/v1/minimal/package.json +3 -3
- package/dist/templates/default/v1/tasks/package.json +3 -3
- package/dist/validate-errors.d.ts +12 -0
- package/dist/validate-errors.d.ts.map +1 -0
- package/dist/validate-errors.js +16 -0
- package/dist/validate-errors.js.map +1 -0
- package/dist/validate-paths.d.ts +43 -0
- package/dist/validate-paths.d.ts.map +1 -0
- package/dist/validate-paths.js +105 -0
- package/dist/validate-paths.js.map +1 -0
- package/dist/validate.d.ts +56 -17
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +89 -130
- package/dist/validate.js.map +1 -1
- package/dist/validate.types.d.ts +19 -0
- package/dist/validate.types.d.ts.map +1 -0
- package/dist/validate.types.js +2 -0
- package/dist/validate.types.js.map +1 -0
- package/package.json +67 -5
- package/src/catalog-resolution.ts +55 -0
- package/src/catalog-resolution.types.ts +2 -0
- package/dist/create-additions.d.ts +0 -7
- package/dist/create-additions.d.ts.map +0 -1
- package/dist/create-additions.js +0 -27
- package/dist/create-additions.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-filesystem.js","sourceRoot":"","sources":["../src/generator-filesystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMjF;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,mBAAoB,SAAQ,OAAO,CAAC,OAAO,EAGrD,CAAC,mCAAmC,CAAC;CAAG;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC,MAAM,CACjD,mBAAmB,EACnB,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,OAAO,mBAAmB,CAAC,EAAE,CAAC;QAC5B,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,8BAA8B,CAAC,CACjD,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,EACrF,CAAC,MAAM,EAAE,EAAE,CAAC,gBAAgB,CAAC,WAAW,E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AAI,gBAAgB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;KAC3F,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,SAAS,SAAS,CAAC,KAIlB;IACC,OAAO,KAAK,CAAC,cAAc,EAAE;QAC3B,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE;YACnB,CAAC,CAAC,WAAW;YACb,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;gBACd,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,OAAO,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { Effect } from "effect";
|
|
2
|
+
import type { GeneratorIoError } from "./generator-errors.js";
|
|
3
|
+
/** Native entry classification without following symlinks. */
|
|
4
|
+
export type GeneratorEntryKind = "file" | "directory" | "symlink" | "other";
|
|
5
|
+
/** Filesystem metadata needed for safe mutation and mode restoration. */
|
|
6
|
+
export interface GeneratorFileMetadata {
|
|
7
|
+
readonly kind: GeneratorEntryKind;
|
|
8
|
+
readonly mode: number;
|
|
9
|
+
}
|
|
10
|
+
/** A directory entry read without following symlinks. */
|
|
11
|
+
export interface GeneratorDirectoryEntry {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly kind: GeneratorEntryKind;
|
|
14
|
+
}
|
|
15
|
+
/** Explicit native filesystem authority for generator workflows. */
|
|
16
|
+
export interface GeneratorFileSystemService {
|
|
17
|
+
/**
|
|
18
|
+
* Reads UTF-8 file contents with interruptible native read authority.
|
|
19
|
+
* @param path - Path inside the current project or owned resource.
|
|
20
|
+
* @returns File contents, or a typed native read failure.
|
|
21
|
+
*/
|
|
22
|
+
readonly readText: (path: string) => Effect.Effect<string, GeneratorIoError>;
|
|
23
|
+
/**
|
|
24
|
+
* Reads original file bytes for exact rollback snapshots.
|
|
25
|
+
* @param path - Path inside the current project or owned resource.
|
|
26
|
+
* @returns File bytes, or a typed native read failure.
|
|
27
|
+
*/
|
|
28
|
+
readonly readBytes: (path: string) => Effect.Effect<Uint8Array, GeneratorIoError>;
|
|
29
|
+
/**
|
|
30
|
+
* Checks native accessibility without granting file mutation.
|
|
31
|
+
* @param path - Path inside the current project or owned resource.
|
|
32
|
+
* @returns Completion when the destination is accessible.
|
|
33
|
+
*/
|
|
34
|
+
readonly access: (path: string) => Effect.Effect<void, GeneratorIoError>;
|
|
35
|
+
/**
|
|
36
|
+
* Reads kind and permissions without dereferencing symlinks.
|
|
37
|
+
* @param path - Path inside the current project or owned resource.
|
|
38
|
+
* @returns Entry kind and mode, undefined when absent; symlinks are not followed.
|
|
39
|
+
*/
|
|
40
|
+
readonly metadata: (path: string) => Effect.Effect<GeneratorFileMetadata | undefined, GeneratorIoError>;
|
|
41
|
+
/**
|
|
42
|
+
* Reads directory entries for deterministic declaration traversal.
|
|
43
|
+
* @param path - Path inside the current project or owned resource.
|
|
44
|
+
* @returns Directory entries without following symlinks.
|
|
45
|
+
*/
|
|
46
|
+
readonly entries: (path: string) => Effect.Effect<readonly GeneratorDirectoryEntry[], GeneratorIoError>;
|
|
47
|
+
/**
|
|
48
|
+
* Writes complete content and waits for physical native settlement.
|
|
49
|
+
* @param path - Path inside the current project or owned resource.
|
|
50
|
+
* @param content - Complete bytes or text planned for the destination.
|
|
51
|
+
* @param options - Explicit options retaining existing defaults.
|
|
52
|
+
* @returns Completion after native bytes physically settle, before rollback can run.
|
|
53
|
+
*/
|
|
54
|
+
readonly write: (path: string, content: string | Uint8Array, options?: {
|
|
55
|
+
readonly mode?: number;
|
|
56
|
+
readonly flag?: "wx";
|
|
57
|
+
}) => Effect.Effect<void, GeneratorIoError>;
|
|
58
|
+
/**
|
|
59
|
+
* Creates owned directories and waits for physical native settlement.
|
|
60
|
+
* @param path - Path inside the current project or owned resource.
|
|
61
|
+
* @param options - Explicit options retaining existing defaults.
|
|
62
|
+
* @returns Completion after native directory creation physically settles.
|
|
63
|
+
*/
|
|
64
|
+
readonly mkdir: (path: string, options?: {
|
|
65
|
+
readonly recursive?: boolean;
|
|
66
|
+
readonly mode?: number;
|
|
67
|
+
}) => Effect.Effect<void, GeneratorIoError>;
|
|
68
|
+
/**
|
|
69
|
+
* Acquires a unique staging directory from its literal prefix.
|
|
70
|
+
* @param prefix - Literal sibling-stage prefix owned by this invocation.
|
|
71
|
+
* @returns The owned staging path after creation settles.
|
|
72
|
+
*/
|
|
73
|
+
readonly temporaryDirectory: (prefix: string) => Effect.Effect<string, GeneratorIoError>;
|
|
74
|
+
/**
|
|
75
|
+
* Atomically moves an owned native path and waits for settlement.
|
|
76
|
+
* @param from - Owned source path.
|
|
77
|
+
* @param to - Validated destination path.
|
|
78
|
+
* @returns Completion after the atomic native handoff settles.
|
|
79
|
+
*/
|
|
80
|
+
readonly rename: (from: string, to: string) => Effect.Effect<void, GeneratorIoError>;
|
|
81
|
+
/**
|
|
82
|
+
* Removes an owned native path with explicit recursive and force policy.
|
|
83
|
+
* @param path - Path inside the current project or owned resource.
|
|
84
|
+
* @param options - Explicit options retaining existing defaults.
|
|
85
|
+
* @returns Completion after owned path removal settles.
|
|
86
|
+
*/
|
|
87
|
+
readonly remove: (path: string, options?: {
|
|
88
|
+
readonly recursive?: boolean;
|
|
89
|
+
readonly force?: boolean;
|
|
90
|
+
}) => Effect.Effect<void, GeneratorIoError>;
|
|
91
|
+
/**
|
|
92
|
+
* Removes an owned directory only when it is empty.
|
|
93
|
+
* @param path - Path inside the current project or owned resource.
|
|
94
|
+
* @returns Completion after removing an owned empty directory.
|
|
95
|
+
*/
|
|
96
|
+
readonly removeDirectory: (path: string) => Effect.Effect<void, GeneratorIoError>;
|
|
97
|
+
/**
|
|
98
|
+
* Restores or sets native permission bits after content settlement.
|
|
99
|
+
* @param path - Path inside the current project or owned resource.
|
|
100
|
+
* @param mode - Optional restored or generated permission mode.
|
|
101
|
+
* @returns Completion after native permission restoration settles.
|
|
102
|
+
*/
|
|
103
|
+
readonly chmod: (path: string, mode: number) => Effect.Effect<void, GeneratorIoError>;
|
|
104
|
+
/**
|
|
105
|
+
* Enumerates sorted source paths with a declaration-owned glob pattern.
|
|
106
|
+
* @param root - Absolute project or owned resource root.
|
|
107
|
+
* @param pattern - Declaration-owned glob or ignore pattern.
|
|
108
|
+
* @returns Sorted source-relative paths matching the declaration pattern.
|
|
109
|
+
*/
|
|
110
|
+
readonly glob: (root: string, pattern: string) => Effect.Effect<readonly string[], GeneratorIoError>;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=generator-filesystem.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-filesystem.types.d.ts","sourceRoot":"","sources":["../src/generator-filesystem.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,8DAA8D;AAC9D,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;AAE5E,yEAAyE;AACzE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,yDAAyD;AACzD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;CACnC;AAED,oEAAoE;AACpE,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7E;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,UAA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AE,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IACrF;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,CACf,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,KACjE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAClF;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IACtF;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,CACb,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,KACZ,MAAM,CAAC,MAAM,CAAC,SAAS,MAAM,EAAE,EAAE,gBAAgB,CAAC,CAAC;CACzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-filesystem.types.js","sourceRoot":"","sources":["../src/generator-filesystem.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Context, Layer } from "effect";
|
|
2
|
+
import type { GeneratorPathsService } from "./generator-paths.types.js";
|
|
3
|
+
declare const GeneratorPaths_base: Context.ServiceClass<GeneratorPaths, "create-relkit/GeneratorPaths", GeneratorPathsService>;
|
|
4
|
+
/** Read-only path authority; synchronous compatibility does not grant filesystem mutation. */
|
|
5
|
+
export declare class GeneratorPaths extends GeneratorPaths_base {
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Native read-only path adapter used by both Effect workflows and synchronous public validators.
|
|
9
|
+
* @returns A native read-only GeneratorPaths Layer with no external service requirements.
|
|
10
|
+
*/
|
|
11
|
+
export declare const generatorPathsLive: Layer.Layer<GeneratorPaths, never, never>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=generator-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-paths.d.ts","sourceRoot":"","sources":["../src/generator-paths.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAU,KAAK,EAAE,MAAM,QAAQ,CAAC;AAGhD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;;AAExE,8FAA8F;AAC9F,qBAAa,cAAe,SAAQ,mBAEnC;CAAG;AAEJ;;;GAGG;AACH,eAAO,MAAM,kBAAkB,2CA+C9B,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { lstatSync, readdirSync, realpathSync } from "node:fs";
|
|
2
|
+
import { homedir, tmpdir } from "node:os";
|
|
3
|
+
import { Context, Effect, Layer } from "effect";
|
|
4
|
+
import { observeExecution } from "@relkit/contracts/operation";
|
|
5
|
+
import { GeneratorIoError, errorMessage, hasErrno } from "./generator-errors.js";
|
|
6
|
+
/** Read-only path authority; synchronous compatibility does not grant filesystem mutation. */
|
|
7
|
+
export class GeneratorPaths extends Context.Service()("create-relkit/GeneratorPaths") {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Native read-only path adapter used by both Effect workflows and synchronous public validators.
|
|
11
|
+
* @returns A native read-only GeneratorPaths Layer with no external service requirements.
|
|
12
|
+
*/
|
|
13
|
+
export const generatorPathsLive = Layer.effect(GeneratorPaths, Effect.gen(function* () {
|
|
14
|
+
return GeneratorPaths.of({
|
|
15
|
+
metadata: Effect.fn("GeneratorPaths.metadata")((path) => native("pathMetadata", () => lstatSync(path)).pipe(Effect.map((info) => ({
|
|
16
|
+
kind: info.isSymbolicLink()
|
|
17
|
+
? "symlink"
|
|
18
|
+
: info.isDirectory()
|
|
19
|
+
? "directory"
|
|
20
|
+
: info.isFile()
|
|
21
|
+
? "file"
|
|
22
|
+
: "other",
|
|
23
|
+
mode: info.mode & 0o777,
|
|
24
|
+
})), Effect.catchIf((error) => hasErrno(error, "ENOENT"), () => Effect.succeed(undefined))), (effect) => observeExecution("generator", "filesystem.metadata", effect)),
|
|
25
|
+
entries: Effect.fn("GeneratorPaths.entries")((path) => native("pathEntries", () => readdirSync(path)), (effect) => observeExecution("generator", "filesystem.entries", effect)),
|
|
26
|
+
realpath: Effect.fn("GeneratorPaths.realpath")((path) => native("realpath", () => realpathSync.native(path)), (effect) => observeExecution("generator", "filesystem.realpath", effect)),
|
|
27
|
+
cwd: Effect.fn("GeneratorPaths.cwd")(() => observeExecution("generator", "filesystem.cwd", Effect.sync(() => process.cwd()))),
|
|
28
|
+
home: Effect.fn("GeneratorPaths.home")(() => observeExecution("generator", "filesystem.home", Effect.sync(homedir))),
|
|
29
|
+
temporaryRoot: Effect.fn("GeneratorPaths.temporaryRoot")(() => observeExecution("generator", "filesystem.temporaryRoot", Effect.sync(tmpdir))),
|
|
30
|
+
});
|
|
31
|
+
}));
|
|
32
|
+
/**
|
|
33
|
+
* Adapts one synchronous native reader without hiding its expected failure or authority.
|
|
34
|
+
* @typeParam A - Successful native read value.
|
|
35
|
+
* @param operation - Fixed bounded operation label.
|
|
36
|
+
* @param read - Synchronous read-only native operation.
|
|
37
|
+
* @returns The native read's value or a GeneratorIoError retaining its original rejection.
|
|
38
|
+
*/
|
|
39
|
+
function native(operation, read) {
|
|
40
|
+
return Effect.try({
|
|
41
|
+
try: read,
|
|
42
|
+
catch: (cause) => new GeneratorIoError({ operation, cause, message: errorMessage(cause) }),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=generator-paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator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WAAW,EAAE,0BAA0B,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAC/E;KACF,CAAC,CAAC;AACL,CAAC,CAAC,CACH,CAAC;AAEF;;;;;;GAMG;AACH,SAAS,MAAM,CAAI,SAAiB,EAAE,IAAa;IACjD,OAAO,MAAM,CAAC,GAAG,CAAC;QAChB,GAAG,EAAE,IAAI;QACT,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,gBAAgB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;KAC3F,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Effect } from "effect";
|
|
2
|
+
import type { GeneratorIoError } from "./generator-errors.js";
|
|
3
|
+
import type { GeneratorFileMetadata } from "./generator-filesystem.types.js";
|
|
4
|
+
/** Read-only native path authority that preserves existing synchronous validation APIs. */
|
|
5
|
+
export interface GeneratorPathsService {
|
|
6
|
+
/**
|
|
7
|
+
* Reads kind and permissions without dereferencing symlinks.
|
|
8
|
+
* @param path - Path inside the current project or owned resource.
|
|
9
|
+
* @returns Entry kind and mode, undefined when absent; symlinks are not followed.
|
|
10
|
+
*/
|
|
11
|
+
readonly metadata: (path: string) => Effect.Effect<GeneratorFileMetadata | undefined, GeneratorIoError>;
|
|
12
|
+
/**
|
|
13
|
+
* Reads directory entries for deterministic declaration traversal.
|
|
14
|
+
* @param path - Path inside the current project or owned resource.
|
|
15
|
+
* @returns Directory entries without following symlinks.
|
|
16
|
+
*/
|
|
17
|
+
readonly entries: (path: string) => Effect.Effect<readonly string[], GeneratorIoError>;
|
|
18
|
+
/**
|
|
19
|
+
* Canonicalizes an existing path for safe destination validation.
|
|
20
|
+
* @param path - Path inside the current project or owned resource.
|
|
21
|
+
* @returns Canonical existing path, or a typed native failure.
|
|
22
|
+
*/
|
|
23
|
+
readonly realpath: (path: string) => Effect.Effect<string, GeneratorIoError>;
|
|
24
|
+
/**
|
|
25
|
+
* Reads the composition root's native current directory.
|
|
26
|
+
* @returns Current native working directory.
|
|
27
|
+
*/
|
|
28
|
+
readonly cwd: () => Effect.Effect<string>;
|
|
29
|
+
/**
|
|
30
|
+
* Reads the user's native home directory for destination safety.
|
|
31
|
+
* @returns Native user home directory.
|
|
32
|
+
*/
|
|
33
|
+
readonly home: () => Effect.Effect<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Reads the native temporary root for destination safety.
|
|
36
|
+
* @returns Native temporary directory root.
|
|
37
|
+
*/
|
|
38
|
+
readonly temporaryRoot: () => Effect.Effect<string>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=generator-paths.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-paths.types.d.ts","sourceRoot":"","sources":["../src/generator-paths.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE7E,2FAA2F;AAC3F,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,CACjB,IAAI,EAAE,MAAM,KACT,MAAM,CAAC,MAAM,CAAC,qBAAqB,GAAG,SAAS,EAAE,gBAAgB,CAAC,CAAC;IACxE;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,SAAS,MAAM,EAAE,EAAE,gBAAgB,CAAC,CAAC;IACvF;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7E;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1C;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;CACrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-paths.types.js","sourceRoot":"","sources":["../src/generator-paths.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Context, Layer } from "effect";
|
|
2
|
+
import type { GeneratorCommandRunner, GeneratorProcessService } from "./generator-process.types.js";
|
|
3
|
+
declare const GeneratorProcess_base: Context.ServiceClass<GeneratorProcess, "create-relkit/GeneratorProcess", GeneratorProcessService>;
|
|
4
|
+
/**
|
|
5
|
+
* Child-process authority, replaceable at the same Layer boundary in tests.
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { Effect } from "effect";
|
|
9
|
+
* import { GeneratorProcess, generatorProcessLive } from "create-relkit";
|
|
10
|
+
* const locate = GeneratorProcess.use((process) => process.which("bun"));
|
|
11
|
+
* const supplied = locate.pipe(Effect.provide(generatorProcessLive));
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare class GeneratorProcess extends GeneratorProcess_base {
|
|
15
|
+
}
|
|
16
|
+
/** Live scoped Bun child-process implementation. */
|
|
17
|
+
export declare const generatorProcessLive: Layer.Layer<GeneratorProcess, never, never>;
|
|
18
|
+
/**
|
|
19
|
+
* Constructs a live process adapter or adapts an existing injected command runner.
|
|
20
|
+
* @param runner - Optional compatibility runner; it receives the fiber-owned signal.
|
|
21
|
+
* @returns A process Layer with identical result and cancellation contracts.
|
|
22
|
+
*/
|
|
23
|
+
export declare function generatorProcessLayer(runner?: GeneratorCommandRunner): Layer.Layer<GeneratorProcess>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=generator-process.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-process.d.ts","sourceRoot":"","sources":["../src/generator-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,OAAO,EAAgB,KAAK,EAAE,MAAM,QAAQ,CAAC;AAG7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;;AAGpG;;;;;;;;;GASG;AACH,qBAAa,gBAAiB,SAAQ,qBAErC;CAAG;AAEJ,oDAAoD;AACpD,eAAO,MAAM,oBAAoB,6CAA0B,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,CAAC,EAAE,sBAAsB,GAC9B,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,CA0B/B"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Cause, Context, Effect, Exit, Layer } from "effect";
|
|
2
|
+
import { observeExecution } from "@relkit/contracts/operation";
|
|
3
|
+
import { GeneratorProcessError, errorMessage } from "./generator-errors.js";
|
|
4
|
+
import { recordCleanupFailure } from "./generator-cleanup.js";
|
|
5
|
+
/**
|
|
6
|
+
* Child-process authority, replaceable at the same Layer boundary in tests.
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { Effect } from "effect";
|
|
10
|
+
* import { GeneratorProcess, generatorProcessLive } from "create-relkit";
|
|
11
|
+
* const locate = GeneratorProcess.use((process) => process.which("bun"));
|
|
12
|
+
* const supplied = locate.pipe(Effect.provide(generatorProcessLive));
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export class GeneratorProcess extends Context.Service()("create-relkit/GeneratorProcess") {
|
|
16
|
+
}
|
|
17
|
+
/** Live scoped Bun child-process implementation. */
|
|
18
|
+
export const generatorProcessLive = generatorProcessLayer();
|
|
19
|
+
/**
|
|
20
|
+
* Constructs a live process adapter or adapts an existing injected command runner.
|
|
21
|
+
* @param runner - Optional compatibility runner; it receives the fiber-owned signal.
|
|
22
|
+
* @returns A process Layer with identical result and cancellation contracts.
|
|
23
|
+
*/
|
|
24
|
+
export function generatorProcessLayer(runner) {
|
|
25
|
+
return Layer.effect(GeneratorProcess, Effect.gen(function* () {
|
|
26
|
+
return GeneratorProcess.of({
|
|
27
|
+
run: Effect.fn("GeneratorProcess.run")((command, cwd) => observeExecution("generator", "process.run", runner === undefined ? nativeRun(command, cwd) : injectedRun(runner, command, cwd), () => ({ commands: 1 }))),
|
|
28
|
+
which: Effect.fn("GeneratorProcess.which")((executable) => observeExecution("generator", "process.which", Effect.try({
|
|
29
|
+
try: () => Bun.which(executable),
|
|
30
|
+
catch: (cause) => processError("which", cause),
|
|
31
|
+
}))),
|
|
32
|
+
});
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Owns an injected runner until its physical Promise settles, including after interruption.
|
|
37
|
+
* @param runner - Existing Promise runner, expected to honor cancellation and settle promptly.
|
|
38
|
+
* @param command - Literal executable and argument vector.
|
|
39
|
+
* @param cwd - Child working directory.
|
|
40
|
+
* @returns The runner result after its scope's settlement barrier.
|
|
41
|
+
* @remarks Interruption aborts the runner signal, then awaits its settlement before rollback.
|
|
42
|
+
*/
|
|
43
|
+
const injectedRun = Effect.fn("GeneratorProcess.injectedRun")((runner, command, cwd) => Effect.scoped(Effect.gen(function* () {
|
|
44
|
+
const owned = yield* Effect.acquireRelease(Effect.try({
|
|
45
|
+
try: () => {
|
|
46
|
+
const controller = new AbortController();
|
|
47
|
+
const result = runner(command, cwd, controller.signal);
|
|
48
|
+
return {
|
|
49
|
+
controller,
|
|
50
|
+
result,
|
|
51
|
+
settled: result.then(() => undefined, () => undefined),
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
catch: (cause) => processError("run", cause),
|
|
55
|
+
}), (owned, exit) => Effect.gen(function* () {
|
|
56
|
+
if (Exit.isFailure(exit))
|
|
57
|
+
owned.controller.abort(Cause.squash(exit.cause));
|
|
58
|
+
yield* Effect.promise(() => owned.settled);
|
|
59
|
+
}));
|
|
60
|
+
return yield* Effect.tryPromise({
|
|
61
|
+
try: () => owned.result,
|
|
62
|
+
catch: (cause) => processError("run", cause),
|
|
63
|
+
});
|
|
64
|
+
})));
|
|
65
|
+
/**
|
|
66
|
+
* Spawns, drains, and awaits a child inside one resource scope.
|
|
67
|
+
* @param command - Executable and literal argument vector.
|
|
68
|
+
* @param cwd - Child working directory.
|
|
69
|
+
* @returns Captured output and exit status after the child and both native drains have settled.
|
|
70
|
+
* @remarks Scope release kills the child and joins inherited pipes before transaction rollback.
|
|
71
|
+
*/
|
|
72
|
+
const nativeRun = Effect.fn("GeneratorProcess.nativeRun")((command, cwd) => Effect.scoped(Effect.gen(function* () {
|
|
73
|
+
const child = yield* Effect.acquireRelease(Effect.try({
|
|
74
|
+
try: () => {
|
|
75
|
+
const process = Bun.spawn([...command], { cwd, stdout: "pipe", stderr: "pipe" });
|
|
76
|
+
const stdout = Promise.resolve().then(() => new Response(process.stdout).text());
|
|
77
|
+
const stderr = Promise.resolve().then(() => new Response(process.stderr).text());
|
|
78
|
+
return {
|
|
79
|
+
process,
|
|
80
|
+
stdout,
|
|
81
|
+
stderr,
|
|
82
|
+
settled: Promise.allSettled([process.exited, stdout, stderr]),
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
catch: (cause) => processError("spawn", cause),
|
|
86
|
+
}), (child, exit) => Effect.gen(function* () {
|
|
87
|
+
const process = child.process;
|
|
88
|
+
if (process.exitCode === null)
|
|
89
|
+
yield* Effect.try({
|
|
90
|
+
try: () => process.kill("SIGKILL"),
|
|
91
|
+
catch: (cause) => processError("kill", cause),
|
|
92
|
+
}).pipe(Effect.catch((cause) => recordCleanupFailure(exit, "process", cause)));
|
|
93
|
+
yield* Effect.tryPromise({
|
|
94
|
+
try: () => process.exited,
|
|
95
|
+
catch: (cause) => processError("release", cause),
|
|
96
|
+
}).pipe(Effect.asVoid, Effect.catch((cause) => recordCleanupFailure(exit, "process", cause)));
|
|
97
|
+
yield* Effect.promise(() => child.settled);
|
|
98
|
+
}));
|
|
99
|
+
const [exitCode, stdout, stderr] = yield* Effect.all([
|
|
100
|
+
Effect.tryPromise({
|
|
101
|
+
try: () => child.process.exited,
|
|
102
|
+
catch: (cause) => processError("wait", cause),
|
|
103
|
+
}),
|
|
104
|
+
Effect.tryPromise({
|
|
105
|
+
try: () => child.stdout,
|
|
106
|
+
catch: (cause) => processError("stdout", cause),
|
|
107
|
+
}),
|
|
108
|
+
Effect.tryPromise({
|
|
109
|
+
try: () => child.stderr,
|
|
110
|
+
catch: (cause) => processError("stderr", cause),
|
|
111
|
+
}),
|
|
112
|
+
], { concurrency: "unbounded" });
|
|
113
|
+
return { exitCode, stdout, stderr };
|
|
114
|
+
})));
|
|
115
|
+
/**
|
|
116
|
+
* Carries a native process rejection through the typed adapter.
|
|
117
|
+
* @param operation - Fixed process operation label.
|
|
118
|
+
* @param cause - Original rejection.
|
|
119
|
+
* @returns An identity-preserving process diagnostic.
|
|
120
|
+
*/
|
|
121
|
+
function processError(operation, cause) {
|
|
122
|
+
return new GeneratorProcessError({ operation, cause, message: errorMessage(cause) });
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=generator-process.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-process.js","sourceRoot":"","sources":["../src/generator-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;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,QAAQ,EAAE,KAAK,CAAC;SAChD,CAAC;QACF,MAAM,CAAC,UAAU,CAAC;YAChB,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM;YACvB,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC;SAChD,CAAC;KACH,EACD,EAAE,WAAW,EAAE,WAAW,EAAE,CAC7B,CAAC;IACF,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACtC,CAAC,CAAC,CACH,CACJ,CAAC;AAEF;;;;;GAKG;AACH,SAAS,YAAY,CAAC,SAAiB,EAAE,KAAc;IACrD,OAAO,IAAI,qBAAqB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACvF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Effect } from "effect";
|
|
2
|
+
import type { GeneratorProcessError } from "./generator-errors.js";
|
|
3
|
+
/** Captured process result, matching both existing command-runner compatibility contracts. */
|
|
4
|
+
export interface GeneratorCommandResult {
|
|
5
|
+
readonly exitCode: number;
|
|
6
|
+
readonly stdout?: string;
|
|
7
|
+
readonly stderr?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Explicit process-spawning authority. Each invocation owns its child through completion. */
|
|
10
|
+
export interface GeneratorProcessService {
|
|
11
|
+
/**
|
|
12
|
+
* Owns one command, output drains and child settlement through scope release.
|
|
13
|
+
* @param command - Literal executable and argument vector.
|
|
14
|
+
* @param cwd - Working directory for the operation.
|
|
15
|
+
* @returns Captured output and exit status after child settlement and scoped cleanup.
|
|
16
|
+
*/
|
|
17
|
+
readonly run: (command: readonly string[], cwd: string) => Effect.Effect<GeneratorCommandResult, GeneratorProcessError>;
|
|
18
|
+
/**
|
|
19
|
+
* Locates an executable through the native process adapter.
|
|
20
|
+
* @param executable - Executable name resolved through the native search path.
|
|
21
|
+
* @returns Executable path, or null when unavailable.
|
|
22
|
+
*/
|
|
23
|
+
readonly which: (executable: string) => Effect.Effect<string | null, GeneratorProcessError>;
|
|
24
|
+
}
|
|
25
|
+
/** Existing external runner adapter; its signal is aborted when the owning fiber is interrupted. */
|
|
26
|
+
export type GeneratorCommandRunner = (command: readonly string[], cwd: string, signal?: AbortSignal) => Promise<GeneratorCommandResult>;
|
|
27
|
+
//# sourceMappingURL=generator-process.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-process.types.d.ts","sourceRoot":"","sources":["../src/generator-process.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,8FAA8F;AAC9F,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,8FAA8F;AAC9F,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,CACZ,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,GAAG,EAAE,MAAM,KACR,MAAM,CAAC,MAAM,CAAC,sBAAsB,EAAE,qBAAqB,CAAC,CAAC;IAClE;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,EAAE,qBAAqB,CAAC,CAAC;CAC7F;AAED,oGAAoG;AACpG,MAAM,MAAM,sBAAsB,GAAG,CACnC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-process.types.js","sourceRoot":"","sources":["../src/generator-process.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Context, Layer } from "effect";
|
|
2
|
+
import type { GeneratorPromptService } from "./generator-prompt.types.js";
|
|
3
|
+
import type { PromptDriver } from "./prompt-driver.types.js";
|
|
4
|
+
declare const GeneratorPrompt_base: Context.ServiceClass<GeneratorPrompt, "create-relkit/GeneratorPrompt", GeneratorPromptService>;
|
|
5
|
+
/** Prompt authority; interactive workflows cannot run without an explicit live or test adapter. */
|
|
6
|
+
export declare class GeneratorPrompt extends GeneratorPrompt_base {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Adapts the existing public prompt driver to typed, interruptible operations.
|
|
10
|
+
* @param driver - Clack or caller-owned deterministic prompt implementation.
|
|
11
|
+
* @returns An interchangeable prompt Layer; answers are decoded at the adapter boundary.
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { Effect } from "effect";
|
|
15
|
+
* import { GeneratorPrompt, generatorPromptLayer, createClackPromptDriver } from "create-relkit";
|
|
16
|
+
* const confirmed = GeneratorPrompt.use((prompt) => prompt.confirm({ message: "Continue?" }));
|
|
17
|
+
* const run = confirmed.pipe(Effect.provide(generatorPromptLayer(createClackPromptDriver())));
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function generatorPromptLayer(driver: PromptDriver): Layer.Layer<GeneratorPrompt>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=generator-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-prompt.d.ts","sourceRoot":"","sources":["../src/generator-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,KAAK,EAAU,MAAM,QAAQ,CAAC;AAGxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;;AAE7D,mGAAmG;AACnG,qBAAa,eAAgB,SAAQ,oBAEpC;CAAG;AAEJ;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,CA4DvF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
2
|
+
import { observeExecution } from "@relkit/contracts/operation";
|
|
3
|
+
import { GeneratorPromptError, errorMessage } from "./generator-errors.js";
|
|
4
|
+
/** Prompt authority; interactive workflows cannot run without an explicit live or test adapter. */
|
|
5
|
+
export class GeneratorPrompt extends Context.Service()("create-relkit/GeneratorPrompt") {
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Adapts the existing public prompt driver to typed, interruptible operations.
|
|
9
|
+
* @param driver - Clack or caller-owned deterministic prompt implementation.
|
|
10
|
+
* @returns An interchangeable prompt Layer; answers are decoded at the adapter boundary.
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { Effect } from "effect";
|
|
14
|
+
* import { GeneratorPrompt, generatorPromptLayer, createClackPromptDriver } from "create-relkit";
|
|
15
|
+
* const confirmed = GeneratorPrompt.use((prompt) => prompt.confirm({ message: "Continue?" }));
|
|
16
|
+
* const run = confirmed.pipe(Effect.provide(generatorPromptLayer(createClackPromptDriver())));
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export function generatorPromptLayer(driver) {
|
|
20
|
+
return Layer.effect(GeneratorPrompt, Effect.gen(function* () {
|
|
21
|
+
return GeneratorPrompt.of({
|
|
22
|
+
text: Effect.fn("GeneratorPrompt.text")((options) => observed("text", ask((signal) => driver.text(options, signal)).pipe(Effect.flatMap((answer) => Schema.decodeUnknownEffect(Schema.String)(answer)), Effect.mapError(promptError)))),
|
|
23
|
+
select: Effect.fn("GeneratorPrompt.select")((options) => observed("select", ask((signal) => driver.select(options, signal)).pipe(Effect.flatMap((answer) => Schema.decodeUnknownEffect(Schema.Literals(options.options.map((option) => option.value)))(answer)), Effect.mapError(promptError)))),
|
|
24
|
+
multiselect: Effect.fn("GeneratorPrompt.multiselect")((options) => observed("multiselect", ask((signal) => driver.multiselect(options, signal)).pipe(Effect.flatMap((answer) => Schema.decodeUnknownEffect(Schema.Array(Schema.Literals(options.options.map((option) => option.value))))(answer)), Effect.mapError(promptError)))),
|
|
25
|
+
confirm: Effect.fn("GeneratorPrompt.confirm")((options) => observed("confirm", ask((signal) => driver.confirm(options, signal)).pipe(Effect.flatMap((answer) => Schema.decodeUnknownEffect(Schema.Boolean)(answer)), Effect.mapError(promptError)))),
|
|
26
|
+
});
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Adapts one prompt; questions and answers never become telemetry attributes.
|
|
31
|
+
* @typeParam A - Decoded prompt answer type.
|
|
32
|
+
* @param operation - Fixed bounded operation label.
|
|
33
|
+
* @param effect - Decoded prompt operation to observe.
|
|
34
|
+
* @returns The same prompt Effect with bounded outcome/duration observation.
|
|
35
|
+
*/
|
|
36
|
+
function observed(operation, effect) {
|
|
37
|
+
return observeExecution("generator", `prompt.${operation}`, effect, () => ({ questions: 1 }));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Adapts one Promise prompt at the explicit cancellation boundary.
|
|
41
|
+
* @typeParam A - Native driver answer type.
|
|
42
|
+
* @param run - Promise prompt adapter receiving the fiber's AbortSignal.
|
|
43
|
+
* @returns A cancellable Effect returning the driver's answer or its typed prompt failure.
|
|
44
|
+
*/
|
|
45
|
+
function ask(run) {
|
|
46
|
+
return Effect.tryPromise({ try: run, catch: promptError });
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Preserves prompt cancellation identity through its typed adapter.
|
|
50
|
+
* @param cause - Original rejection retained for explicit diagnostics.
|
|
51
|
+
* @returns The existing GeneratorPromptError or a new wrapper retaining the original rejection.
|
|
52
|
+
*/
|
|
53
|
+
function promptError(cause) {
|
|
54
|
+
return cause instanceof GeneratorPromptError
|
|
55
|
+
? cause
|
|
56
|
+
: new GeneratorPromptError({ cause, message: errorMessage(cause) });
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=generator-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-prompt.js","sourceRoot":"","sources":["../src/generator-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAI3E,mGAAmG;AACnG,MAAM,OAAO,eAAgB,SAAQ,OAAO,CAAC,OAAO,EAA2C,CAC7F,+BAA+B,CAChC;CAAG;AAEJ;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAoB;IACvD,OAAO,KAAK,CAAC,MAAM,CACjB,eAAe,EACf,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAClB,OAAO,eAAe,CAAC,EAAE,CAAC;YACxB,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CAClD,QAAQ,CACN,MAAM,EACN,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAChD,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,EAC7E,MAAM,CAAC,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AAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CACnD,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,EAC9E,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAC7B,CACF,CACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAS,QAAQ,CACf,SAAiB,EACjB,MAA8C;IAE9C,OAAO,gBAAgB,CAAC,WAAW,EAAE,UAAU,SAAS,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAChG,CAAC;AAED;;;;;GAKG;AACH,SAAS,GAAG,CAAI,GAAwC;IACtD,OAAO,MAAM,CAAC,UAAU,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;AAC7D,CAAC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,KAAK,YAAY,oBAAoB;QAC1C,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,IAAI,oBAAoB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Effect } from "effect";
|
|
2
|
+
import type { GeneratorPromptError } from "./generator-errors.js";
|
|
3
|
+
import type { ChoicePromptOptions, TextPromptOptions } from "./prompt-driver.types.js";
|
|
4
|
+
/** Explicit interactive input authority, shared by Clack and deterministic test drivers. */
|
|
5
|
+
export interface GeneratorPromptService {
|
|
6
|
+
/**
|
|
7
|
+
* Asks for text through the explicit, cancellation-aware native driver.
|
|
8
|
+
* @param options - Explicit options retaining existing defaults.
|
|
9
|
+
* @returns Decoded text; prompt interruption propagates to the native driver.
|
|
10
|
+
*/
|
|
11
|
+
readonly text: (options: TextPromptOptions) => Effect.Effect<string, GeneratorPromptError>;
|
|
12
|
+
/**
|
|
13
|
+
* Asks for one declared option and decodes the native answer.
|
|
14
|
+
* @typeParam Value - Union of declared prompt option values.
|
|
15
|
+
* @param options - Question, declared choices and optional initial selection.
|
|
16
|
+
* @returns One decoded declared option; invalid native answers fail.
|
|
17
|
+
*/
|
|
18
|
+
readonly select: <Value extends string>(options: ChoicePromptOptions<Value>) => Effect.Effect<Value, GeneratorPromptError>;
|
|
19
|
+
/**
|
|
20
|
+
* Asks for declared options and decodes their ordered native answers.
|
|
21
|
+
* @typeParam Value - Union of declared prompt option values.
|
|
22
|
+
* @param options - Question, declared choices and optional required-selection policy.
|
|
23
|
+
* @returns Decoded declared options in driver order.
|
|
24
|
+
*/
|
|
25
|
+
readonly multiselect: <Value extends string>(options: ChoicePromptOptions<Value> & {
|
|
26
|
+
readonly required?: boolean;
|
|
27
|
+
}) => Effect.Effect<readonly Value[], GeneratorPromptError>;
|
|
28
|
+
/**
|
|
29
|
+
* Asks for boolean consent and decodes the native answer.
|
|
30
|
+
* @param options - Explicit options retaining existing defaults.
|
|
31
|
+
* @returns Decoded consent; cancellation retains its original rejection.
|
|
32
|
+
*/
|
|
33
|
+
readonly confirm: (options: {
|
|
34
|
+
readonly message: string;
|
|
35
|
+
readonly initialValue?: boolean;
|
|
36
|
+
}) => Effect.Effect<boolean, GeneratorPromptError>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=generator-prompt.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-prompt.types.d.ts","sourceRoot":"","sources":["../src/generator-prompt.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAEvF,4FAA4F;AAC5F,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC3F;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,SAAS,MAAM,EACpC,OAAO,EAAE,mBAAmB,CAAC,KAAK,CAAC,KAChC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAC;IAChD;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,SAAS,MAAM,EACzC,OAAO,EAAE,mBAAmB,CAAC,KAAK,CAAC,GAAG;QAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,KAClE,MAAM,CAAC,MAAM,CAAC,SAAS,KAAK,EAAE,EAAE,oBAAoB,CAAC,CAAC;IAC3D;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE;QAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;KACjC,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;CACpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-prompt.types.js","sourceRoot":"","sources":["../src/generator-prompt.types.ts"],"names":[],"mappings":""}
|