@wildo-ai/wildo-cli 1.1.14 → 1.1.16
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/src/commands/context/journey.command.d.ts.map +1 -1
- package/dist/src/commands/context/journey.command.js +12 -0
- package/dist/src/commands/context/journey.command.js.map +1 -1
- package/dist/src/commands/creation/drive.command.d.ts.map +1 -1
- package/dist/src/commands/creation/drive.command.js +2 -1
- package/dist/src/commands/creation/drive.command.js.map +1 -1
- package/dist/src/commands/generate/email-command.utils.d.ts +2 -0
- package/dist/src/commands/generate/email-command.utils.d.ts.map +1 -1
- package/dist/src/commands/generate/email-command.utils.js +5 -0
- package/dist/src/commands/generate/email-command.utils.js.map +1 -1
- package/dist/src/commands/init.command.d.ts.map +1 -1
- package/dist/src/commands/init.command.js +7 -2
- package/dist/src/commands/init.command.js.map +1 -1
- package/dist/src/commands/local/deregister.command.d.ts.map +1 -1
- package/dist/src/commands/local/deregister.command.js +4 -0
- package/dist/src/commands/local/deregister.command.js.map +1 -1
- package/dist/src/commands/local/dev.command.d.ts +50 -0
- package/dist/src/commands/local/dev.command.d.ts.map +1 -1
- package/dist/src/commands/local/dev.command.js +144 -1
- package/dist/src/commands/local/dev.command.js.map +1 -1
- package/dist/src/commands/local/jobs-command.utils.d.ts +24 -0
- package/dist/src/commands/local/jobs-command.utils.d.ts.map +1 -0
- package/dist/src/commands/local/jobs-command.utils.js +44 -0
- package/dist/src/commands/local/jobs-command.utils.js.map +1 -0
- package/dist/src/commands/local/jobs-run.command.d.ts +7 -0
- package/dist/src/commands/local/jobs-run.command.d.ts.map +1 -0
- package/dist/src/commands/local/jobs-run.command.js +92 -0
- package/dist/src/commands/local/jobs-run.command.js.map +1 -0
- package/dist/src/commands/local/jobs.command.d.ts +7 -0
- package/dist/src/commands/local/jobs.command.d.ts.map +1 -0
- package/dist/src/commands/local/jobs.command.js +59 -0
- package/dist/src/commands/local/jobs.command.js.map +1 -0
- package/dist/src/commands/local/tunnel.command.d.ts +84 -0
- package/dist/src/commands/local/tunnel.command.d.ts.map +1 -0
- package/dist/src/commands/local/tunnel.command.js +274 -0
- package/dist/src/commands/local/tunnel.command.js.map +1 -0
- package/dist/src/commands/providers/grant-export.command.d.ts +16 -0
- package/dist/src/commands/providers/grant-export.command.d.ts.map +1 -0
- package/dist/src/commands/providers/grant-export.command.js +78 -0
- package/dist/src/commands/providers/grant-export.command.js.map +1 -0
- package/dist/src/commands/providers/grant-import.command.d.ts +15 -0
- package/dist/src/commands/providers/grant-import.command.d.ts.map +1 -0
- package/dist/src/commands/providers/grant-import.command.js +78 -0
- package/dist/src/commands/providers/grant-import.command.js.map +1 -0
- package/dist/src/kernel/command-runner.d.ts.map +1 -1
- package/dist/src/kernel/command-runner.js +4 -6
- package/dist/src/kernel/command-runner.js.map +1 -1
- package/dist/src/kernel/hooks.d.ts.map +1 -1
- package/dist/src/kernel/hooks.js +2 -1
- package/dist/src/kernel/hooks.js.map +1 -1
- package/dist/src/kernel/json-document-output.d.ts +7 -0
- package/dist/src/kernel/json-document-output.d.ts.map +1 -1
- package/dist/src/kernel/json-document-output.js +8 -0
- package/dist/src/kernel/json-document-output.js.map +1 -1
- package/dist/src/kernel/types.d.ts +8 -0
- package/dist/src/kernel/types.d.ts.map +1 -1
- package/dist/src/kernel/types.js.map +1 -1
- package/dist/src/services/application/app-bootstrap.service.d.ts +65 -7
- package/dist/src/services/application/app-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/app-bootstrap.service.js +94 -15
- package/dist/src/services/application/app-bootstrap.service.js.map +1 -1
- package/dist/src/services/application/app-local-runtime-addresses.service.d.ts +1 -1
- package/dist/src/services/application/app-local-runtime-addresses.service.d.ts.map +1 -1
- package/dist/src/services/application/app-local-runtime-addresses.service.js.map +1 -1
- package/dist/src/services/application/app-runtime-targets.service.d.ts.map +1 -1
- package/dist/src/services/application/app-runtime-targets.service.js +16 -2
- package/dist/src/services/application/app-runtime-targets.service.js.map +1 -1
- package/dist/src/services/application/application-dependency-alignment.service.d.ts +20 -0
- package/dist/src/services/application/application-dependency-alignment.service.d.ts.map +1 -1
- package/dist/src/services/application/application-dependency-alignment.service.js +32 -2
- package/dist/src/services/application/application-dependency-alignment.service.js.map +1 -1
- package/dist/src/services/application/application-runtime-bootstrap.service.d.ts +13 -0
- package/dist/src/services/application/application-runtime-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/application/application-runtime-bootstrap.service.js +32 -0
- package/dist/src/services/application/application-runtime-bootstrap.service.js.map +1 -1
- package/dist/src/services/application/environment-provider-configurations.service.d.ts +7 -0
- package/dist/src/services/application/environment-provider-configurations.service.d.ts.map +1 -1
- package/dist/src/services/application/environment-provider-configurations.service.js +1 -1
- package/dist/src/services/application/environment-provider-configurations.service.js.map +1 -1
- package/dist/src/services/application/local-tunnel.service.d.ts +153 -0
- package/dist/src/services/application/local-tunnel.service.d.ts.map +1 -0
- package/dist/src/services/application/local-tunnel.service.js +295 -0
- package/dist/src/services/application/local-tunnel.service.js.map +1 -0
- package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
- package/dist/src/services/application/provider-runtime-sync.service.js +3 -0
- package/dist/src/services/application/provider-runtime-sync.service.js.map +1 -1
- package/dist/src/services/application/saas-skeleton.service.d.ts +7 -0
- package/dist/src/services/application/saas-skeleton.service.d.ts.map +1 -1
- package/dist/src/services/application/saas-skeleton.service.js +2 -0
- package/dist/src/services/application/saas-skeleton.service.js.map +1 -1
- package/dist/src/services/catalog/service-address-resolver.service.d.ts +7 -1
- package/dist/src/services/catalog/service-address-resolver.service.d.ts.map +1 -1
- package/dist/src/services/catalog/service-address-resolver.service.js +6 -3
- package/dist/src/services/catalog/service-address-resolver.service.js.map +1 -1
- package/dist/src/services/companion/companion-client.service.d.ts +17 -0
- package/dist/src/services/companion/companion-client.service.d.ts.map +1 -1
- package/dist/src/services/companion/companion-client.service.js +21 -0
- package/dist/src/services/companion/companion-client.service.js.map +1 -1
- package/dist/src/services/companion/creation-drive.service.d.ts +18 -0
- package/dist/src/services/companion/creation-drive.service.d.ts.map +1 -1
- package/dist/src/services/companion/creation-drive.service.js +70 -1
- package/dist/src/services/companion/creation-drive.service.js.map +1 -1
- package/dist/src/services/credentials/application-secrets.service.d.ts +6 -0
- package/dist/src/services/credentials/application-secrets.service.d.ts.map +1 -1
- package/dist/src/services/credentials/application-secrets.service.js +1 -1
- package/dist/src/services/credentials/application-secrets.service.js.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.js +3 -1
- package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
- package/dist/src/services/credentials/secrets-writer.service.d.ts +11 -2
- package/dist/src/services/credentials/secrets-writer.service.d.ts.map +1 -1
- package/dist/src/services/credentials/secrets-writer.service.js +12 -3
- package/dist/src/services/credentials/secrets-writer.service.js.map +1 -1
- package/dist/src/services/deployment/ci-deploy-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/ci-deploy-generator.service.js +3 -3
- package/dist/src/services/deployment/ci-deploy-generator.service.js.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts +12 -3
- package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js +40 -22
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
- package/dist/src/services/deployment/framework-pod-network-membership.d.ts +6 -0
- package/dist/src/services/deployment/framework-pod-network-membership.d.ts.map +1 -1
- package/dist/src/services/deployment/framework-pod-network-membership.js +17 -3
- package/dist/src/services/deployment/framework-pod-network-membership.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts +4 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js +17 -7
- package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts +7 -0
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-manifest.schemas.js.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js +15 -9
- package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js.map +1 -1
- package/dist/src/services/deployment/k8s/kind-pod-host-gateway.d.ts +43 -0
- package/dist/src/services/deployment/k8s/kind-pod-host-gateway.d.ts.map +1 -0
- package/dist/src/services/deployment/k8s/kind-pod-host-gateway.js +12 -0
- package/dist/src/services/deployment/k8s/kind-pod-host-gateway.js.map +1 -0
- package/dist/src/services/deployment/k8s/off-cluster-backing-services.d.ts +3 -1
- package/dist/src/services/deployment/k8s/off-cluster-backing-services.d.ts.map +1 -1
- package/dist/src/services/deployment/k8s/off-cluster-backing-services.js.map +1 -1
- package/dist/src/services/deployment/local-dev-late-workspace-members.service.d.ts +163 -0
- package/dist/src/services/deployment/local-dev-late-workspace-members.service.d.ts.map +1 -0
- package/dist/src/services/deployment/local-dev-late-workspace-members.service.js +356 -0
- package/dist/src/services/deployment/local-dev-late-workspace-members.service.js.map +1 -0
- package/dist/src/services/environment/authored-infra-config.utils.d.ts +13 -3
- package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
- package/dist/src/services/environment/authored-infra-config.utils.js +24 -4
- package/dist/src/services/environment/authored-infra-config.utils.js.map +1 -1
- package/dist/src/services/environment/container-host-gateway-listen-host.d.ts +6 -0
- package/dist/src/services/environment/container-host-gateway-listen-host.d.ts.map +1 -1
- package/dist/src/services/environment/container-host-gateway-listen-host.js +6 -0
- package/dist/src/services/environment/container-host-gateway-listen-host.js.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.d.ts +12 -0
- package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.js +37 -5
- package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.d.ts +2 -1
- package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.js +47 -32
- package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
- package/dist/src/services/environment/environment-lifecycle.service.d.ts +7 -4
- package/dist/src/services/environment/environment-lifecycle.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-lifecycle.service.js +14 -18
- package/dist/src/services/environment/environment-lifecycle.service.js.map +1 -1
- package/dist/src/services/environment/environment-setup.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment-setup.service.js +17 -6
- package/dist/src/services/environment/environment-setup.service.js.map +1 -1
- package/dist/src/services/environment/environment.service.d.ts +4 -3
- package/dist/src/services/environment/environment.service.d.ts.map +1 -1
- package/dist/src/services/environment/environment.service.js +0 -1
- package/dist/src/services/environment/environment.service.js.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.d.ts +55 -15
- package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.js +115 -25
- package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
- package/dist/src/services/framework/package-install.service.d.ts +7 -0
- package/dist/src/services/framework/package-install.service.d.ts.map +1 -1
- package/dist/src/services/framework/package-install.service.js +8 -1
- package/dist/src/services/framework/package-install.service.js.map +1 -1
- package/dist/src/services/registry/application-provider-connection.service.d.ts +16 -1
- package/dist/src/services/registry/application-provider-connection.service.d.ts.map +1 -1
- package/dist/src/services/registry/application-provider-connection.service.js +23 -0
- package/dist/src/services/registry/application-provider-connection.service.js.map +1 -1
- package/dist/src/services/registry/provider-grant-transfer.service.d.ts +48 -0
- package/dist/src/services/registry/provider-grant-transfer.service.d.ts.map +1 -0
- package/dist/src/services/registry/provider-grant-transfer.service.js +144 -0
- package/dist/src/services/registry/provider-grant-transfer.service.js.map +1 -0
- package/dist/src/services/registry/provider-module-scaffold.service.d.ts.map +1 -1
- package/dist/src/services/registry/provider-module-scaffold.service.js +10 -3
- package/dist/src/services/registry/provider-module-scaffold.service.js.map +1 -1
- package/dist/src/services/security/csp-sync.service.d.ts.map +1 -1
- package/dist/src/services/security/csp-sync.service.js +21 -2
- package/dist/src/services/security/csp-sync.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +19 -19
- package/templates/infra/docker-compose/docker-compose.wildo-platform.yml.hbs +16 -7
- package/templates/infra/k8s/platform/platform-crontabs-batches-manager/deployment.yaml.hbs +13 -0
- package/templates/saas/i18n/email/system/remote-agent-task-updated/labels.en.ts +11 -0
- package/templates/saas/i18n/email/system/remote-agent-task-updated/template.tsx +56 -0
- package/templates/saas/i18n/engine/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.en.ts +61 -0
- package/templates/saas/i18n/engine/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.fr.ts +61 -0
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/docusaurus.config.ts.hbs +5 -4
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/package.json.hbs +1 -1
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/scripts/substitute-api-origin.mjs +97 -32
- package/templates/saas/scenarios/add-technical-doc/files/technical-doc/src/plugins/api-reference-pages.ts +7 -6
- package/templates/saas/skeleton/.wildo-saas/wildo-dev-companion/scripts/dev-supervised.sh +18 -4
- package/templates/saas/skeleton/frontend/nginx-config/default.conf.hbs +1 -1
- package/templates/saas/skeleton/frontend/src/generated/csp.generated.json.hbs +4 -4
- package/templates/saas/skeleton/infrastructure/local/wildo.infra.local.config.ts.hbs +2 -0
- package/wildo-framework.info.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drive.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/creation/drive.command.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"drive.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/creation/drive.command.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAe1F,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,sDAAsD,CAAC;AAM9D;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,WAAW;IAC3D,QAAQ,CAAC,IAAI,EAAE,WAAW,CAcxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAsDvD;AAED,mGAAmG;AACnG,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,EAAE,CASjF"}
|
|
@@ -4,7 +4,7 @@ import { CommandCategory } from '../../kernel/types.js';
|
|
|
4
4
|
import { ensureSaasAppScope } from '../../kernel/command-scope-utils.js';
|
|
5
5
|
import { writeJsonDocument } from '../../kernel/json-document-output.js';
|
|
6
6
|
import { ErrorUtils } from '../../infrastructure/errors/error.utils.js';
|
|
7
|
-
import { CompanionClient, CompanionRefusalError, CompanionRequestTimeoutError, companionFailureExitCode, readCompanionProviderAccountRefusal, } from '../../services/companion/companion-client.service.js';
|
|
7
|
+
import { CompanionClient, CompanionRefusalError, CompanionRequestTimeoutError, companionFailureExitCode, isCompanionConnectionClosedBeforeAnswer, readCompanionProviderAccountRefusal, } from '../../services/companion/companion-client.service.js';
|
|
8
8
|
import { resolveCompanionClientOptionsFromContext } from '../../services/companion/companion-client-options.utils.js';
|
|
9
9
|
import { CreationConsoleClient } from '../../services/companion/creation-console.service.js';
|
|
10
10
|
import { CONSOLE_READ_TIMEOUT_MS, CONSOLE_WRITE_TIMEOUT_MS } from '../../services/companion/console-verb.utils.js';
|
|
@@ -72,6 +72,7 @@ export default class CreationDriveCommand extends BaseCommand {
|
|
|
72
72
|
isCompanionUnreachable: (error) => companionFailureExitCode(error) === 2,
|
|
73
73
|
isClientTimeout: (error) => error instanceof CompanionRequestTimeoutError,
|
|
74
74
|
isNotReadyYet: (error) => error instanceof CompanionRefusalError && error.status === 503,
|
|
75
|
+
isConnectionClosedBeforeAnswer: isCompanionConnectionClosedBeforeAnswer,
|
|
75
76
|
isAlreadyRunning: (error) => error instanceof CompanionRefusalError && error.status === 409,
|
|
76
77
|
readProviderAccountRefusal: readCompanionProviderAccountRefusal,
|
|
77
78
|
now: () => Date.now(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drive.command.js","sourceRoot":"","sources":["../../../../src/commands/creation/drive.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG/D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,4BAA4B,EAC5B,wBAAwB,EACxB,mCAAmC,GACpC,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,wCAAwC,EAAE,MAAM,8DAA8D,CAAC;AACxH,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC;AACrH,OAAO,EACL,qBAAqB,EACrB,kBAA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,KAAK,EAAE,QAAQ,EAAE,wBAAwB,CAAC,KAAK,CAAC,EAAE,CAAC;QACvE,CAAC;QACD,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI;YAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;;YAClD,KAAK,MAAM,IAAI,IAAI,2BAA2B,CAAC,MAAM,CAAC;gBAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF;AAED,mGAAmG;AACnG,MAAM,UAAU,2BAA2B,CAAC,MAA2B;IACrE,OAAO;QACL,sBAAsB,MAAM,CAAC,SAAS,GAAG;QACzC,kBAAkB,MAAM,CAAC,UAAU,EAAE;QACrC,KAAK,MAAM,CAAC,KAAK,aAAa,MAAM,CAAC,MAAM,cAAc,MAAM,CAAC,QAAQ,8BAA8B,MAAM,CAAC,iBAAiB,8BAA8B;cACxJ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,GAAG;QACzI,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,mFAAmF,CAAC,CAAC;QACtH,sFAAsF;KACvF,CAAC;AACJ,CAAC","sourcesContent":["import { WorkspaceScope } from '@wildo-ai/platform-config-lib';\nimport type { CreationConsole_Feed, CreationDrive_AcceptOutcome, CreationDrive_RequirementsStanding, CreationDrive_Status } from '@wildo-ai/platform-core-shared';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandContext, CommandMeta, CommandResult } from '~wildo-cli/kernel/types';\nimport { ensureSaasAppScope } from '~wildo-cli/kernel/command-scope-utils';\nimport { writeJsonDocument } from '~wildo-cli/kernel/json-document-output';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport {\n CompanionClient,\n CompanionRefusalError,\n CompanionRequestTimeoutError,\n companionFailureExitCode,\n readCompanionProviderAccountRefusal,\n} from '~wildo-cli/services/companion/companion-client.service';\nimport { resolveCompanionClientOptionsFromContext } from '~wildo-cli/services/companion/companion-client-options.utils';\nimport { CreationConsoleClient } from '~wildo-cli/services/companion/creation-console.service';\nimport { CONSOLE_READ_TIMEOUT_MS, CONSOLE_WRITE_TIMEOUT_MS } from '~wildo-cli/services/companion/console-verb.utils';\nimport {\n CreationDriveStopRule,\n CreationDriveUntil,\n runCreationDrive,\n type CreationDriveResult,\n} from '~wildo-cli/services/companion/creation-drive.service';\nimport { SKIP_PREFLIGHT_FLAG, admitCreationRunAfterPreflight } from '~wildo-cli/services/application/creation-preflight.service';\n\n/** The longest one loop request is waited on. A loop may run a build lane for hours; past this the drive reads the state again. */\nconst CREATION_DRIVE_LOOP_REQUEST_TIMEOUT_MS = 6 * 60 * 60 * 1000;\n\n/**\n * `wildo creation drive --goal \"<goal>\" --until stuck --max-hours <h> --max-usd <n>` — run a creation unattended until a\n * stop rule fires (#2233): loops of rounds and the build they choose, accepted under the autonomy posture, through\n * companion restarts, usage-limit pauses and network losses, stopping on the first thing that needs the creator and\n * naming it. See `creation-drive.service.ts` for the rules.\n *\n * Both ceilings are REQUIRED and the person's, as `loop`'s iteration ceiling is: an unattended drive over the\n * application's source stops where the person said, never where this command guessed.\n */\nexport default class CreationDriveCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'creation drive',\n description: 'Drive the creation unattended until a stop rule fires: rounds, the build, acceptance, restarts.',\n category: CommandCategory.Local,\n minimumScope: WorkspaceScope.SAAS_APP,\n flags: {\n goal: { type: 'string', description: 'What the creation should achieve, in a sentence' },\n until: { type: 'string', description: 'When to stop: `stuck` (the first stop rule that fires)', default: CreationDriveUntil.STUCK },\n 'max-hours': { type: 'string', description: 'The wall-clock ceiling, in hours (required)' },\n 'max-usd': { type: 'string', description: 'The spend ceiling, in US dollars of measured spend (required)' },\n 'fan-out': { type: 'string', description: 'The most playbooks one round may run at once, 1 to 5' },\n json: { type: 'boolean', description: 'Emit the drive\\'s result document.', default: false },\n [SKIP_PREFLIGHT_FLAG]: { type: 'boolean', description: 'Start even when `wildo creation preflight` reports a FAIL.', default: false },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const goal = typeof ctx.flags.goal === 'string' ? ctx.flags.goal.trim() : '';\n const until = String(ctx.flags.until ?? CreationDriveUntil.STUCK);\n const maximumHours = Number(ctx.flags['max-hours']);\n const maximumUsd = Number(ctx.flags['max-usd']);\n const fanOut = ctx.flags['fan-out'] === undefined ? undefined : Number(ctx.flags['fan-out']);\n if (goal.length === 0 || !(Object.values(CreationDriveUntil) as string[]).includes(until)\n || !(maximumHours > 0) || !(maximumUsd > 0) || (fanOut !== undefined && !(Number.isSafeInteger(fanOut) && fanOut >= 1 && fanOut <= 5))) {\n ctx.log.error('Usage: wildo creation drive --goal \"<what the creation should achieve>\" --until stuck --max-hours <h> --max-usd <n> [--fan-out <1-5>]');\n return { success: false };\n }\n if (!ensureSaasAppScope(ctx)) return { success: false };\n // Once, before the first round (#2229); every loop request is checked again by the companion.\n if (!await admitCreationRunAfterPreflight(ctx, 'wildo creation drive')) {\n if (ctx.flags.json === true) writeJsonDocument({ stoppedBy: CreationDriveStopRule.PREFLIGHT_FAILED, waitingFor: 'wildo creation preflight' });\n return { success: false };\n }\n const options = await resolveCompanionClientOptionsFromContext(ctx, CONSOLE_READ_TIMEOUT_MS);\n const loopOptions = { ...options, timeoutMs: CREATION_DRIVE_LOOP_REQUEST_TIMEOUT_MS };\n let result: CreationDriveResult;\n try {\n result = await runCreationDrive({\n readFeed: () => CreationConsoleClient.readFeed(options) as Promise<CreationConsole_Feed>,\n readStatus: () => CompanionClient.get<CreationDrive_Status>('/api/companion/creation/drive/status', options),\n // Derives the maturity reading (the landing probe, the follow-ups), so it gets the console's write deadline (#3701).\n readRequirementsStanding: () => CompanionClient.get<CreationDrive_RequirementsStanding>('/api/companion/creation/requirements/standing', { ...options, timeoutMs: CONSOLE_WRITE_TIMEOUT_MS }),\n readSpentUsd: async () => (await CreationConsoleClient.report(options)).spend.total.cost['USD'],\n runLoop: (request) => CreationConsoleClient.loop(loopOptions, request),\n // The accept waits for the worktree lock (up to about ten minutes), so it gets the console's write deadline.\n accept: () => CompanionClient.post<CreationDrive_AcceptOutcome>('/api/companion/creation/drive/accept', {}, { ...options, timeoutMs: CONSOLE_WRITE_TIMEOUT_MS }),\n isCompanionUnreachable: (error) => companionFailureExitCode(error) === 2,\n isClientTimeout: (error) => error instanceof CompanionRequestTimeoutError,\n isNotReadyYet: (error) => error instanceof CompanionRefusalError && error.status === 503,\n isAlreadyRunning: (error) => error instanceof CompanionRefusalError && error.status === 409,\n readProviderAccountRefusal: readCompanionProviderAccountRefusal,\n now: () => Date.now(),\n sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),\n progress: (line) => { if (ctx.flags.json !== true) ctx.log.info(line); },\n }, {\n goal,\n maximumMs: maximumHours * 3_600_000,\n maximumUsd,\n ...(fanOut !== undefined ? { fanOut } : {}),\n ...(ctx.flags[SKIP_PREFLIGHT_FLAG] === true ? { skipPreflight: true } : {}),\n });\n } catch (error) {\n ctx.log.error(`The creation drive stopped on an error: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false, exitCode: companionFailureExitCode(error) };\n }\n if (ctx.flags.json === true) writeJsonDocument(result);\n else for (const line of describeCreationDriveResult(result)) ctx.log.info(line);\n return { success: true };\n }\n}\n\n/** The drive's end, for a person: the rule that stopped it, what it waits for, and what it did. */\nexport function describeCreationDriveResult(result: CreationDriveResult): string[] {\n return [\n `The drive stopped: ${result.stoppedBy}.`,\n ` Waiting for: ${result.waitingFor}`,\n ` ${result.loops} loop(s), ${result.rounds} round(s), ${result.accepted} playbook run(s) accepted, ${result.companionRestarts} companion restart(s) seen, `\n + `${Math.round(result.elapsedMs / 60_000)} min${result.spentUsd === undefined ? '' : `, USD ${result.spentUsd.toFixed(2)} measured`}.`,\n ...(result.spendMeasured ? [] : [' The spend ceiling was not applied: the run report stated no measured USD spend.']),\n ' What a person did along the way, and the independence score: wildo creation report',\n ];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"drive.command.js","sourceRoot":"","sources":["../../../../src/commands/creation/drive.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG/D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,4BAA4B,EAC5B,wBAAwB,EACxB,uCAAuC,EACvC,mCAAmC,GACpC,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,wCAAwC,EAAE,MAAM,8DAA8D,CAAC;AACxH,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC;AACrH,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,GAEjB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,4DAA4D,CAAC;AAEjI,mIAAmI;AACnI,MAAM,sCAAsC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAElE;;;;;;;;GAQG;AACH,MAAM,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B,CAAC,MAAM,CAAC;gBAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF;AAED,mGAAmG;AACnG,MAAM,UAAU,2BAA2B,CAAC,MAA2B;IACrE,OAAO;QACL,sBAAsB,MAAM,CAAC,SAAS,GAAG;QACzC,kBAAkB,MAAM,CAAC,UAAU,EAAE;QACrC,KAAK,MAAM,CAAC,KAAK,aAAa,MAAM,CAAC,MAAM,cAAc,MAAM,CAAC,QAAQ,8BAA8B,MAAM,CAAC,iBAAiB,8BAA8B;cACxJ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,GAAG;QACzI,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,mFAAmF,CAAC,CAAC;QACtH,sFAAsF;KACvF,CAAC;AACJ,CAAC","sourcesContent":["import { WorkspaceScope } from '@wildo-ai/platform-config-lib';\nimport type { CreationConsole_Feed, CreationDrive_AcceptOutcome, CreationDrive_RequirementsStanding, CreationDrive_Status } from '@wildo-ai/platform-core-shared';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandContext, CommandMeta, CommandResult } from '~wildo-cli/kernel/types';\nimport { ensureSaasAppScope } from '~wildo-cli/kernel/command-scope-utils';\nimport { writeJsonDocument } from '~wildo-cli/kernel/json-document-output';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport {\n CompanionClient,\n CompanionRefusalError,\n CompanionRequestTimeoutError,\n companionFailureExitCode,\n isCompanionConnectionClosedBeforeAnswer,\n readCompanionProviderAccountRefusal,\n} from '~wildo-cli/services/companion/companion-client.service';\nimport { resolveCompanionClientOptionsFromContext } from '~wildo-cli/services/companion/companion-client-options.utils';\nimport { CreationConsoleClient } from '~wildo-cli/services/companion/creation-console.service';\nimport { CONSOLE_READ_TIMEOUT_MS, CONSOLE_WRITE_TIMEOUT_MS } from '~wildo-cli/services/companion/console-verb.utils';\nimport {\n CreationDriveStopRule,\n CreationDriveUntil,\n runCreationDrive,\n type CreationDriveResult,\n} from '~wildo-cli/services/companion/creation-drive.service';\nimport { SKIP_PREFLIGHT_FLAG, admitCreationRunAfterPreflight } from '~wildo-cli/services/application/creation-preflight.service';\n\n/** The longest one loop request is waited on. A loop may run a build lane for hours; past this the drive reads the state again. */\nconst CREATION_DRIVE_LOOP_REQUEST_TIMEOUT_MS = 6 * 60 * 60 * 1000;\n\n/**\n * `wildo creation drive --goal \"<goal>\" --until stuck --max-hours <h> --max-usd <n>` — run a creation unattended until a\n * stop rule fires (#2233): loops of rounds and the build they choose, accepted under the autonomy posture, through\n * companion restarts, usage-limit pauses and network losses, stopping on the first thing that needs the creator and\n * naming it. See `creation-drive.service.ts` for the rules.\n *\n * Both ceilings are REQUIRED and the person's, as `loop`'s iteration ceiling is: an unattended drive over the\n * application's source stops where the person said, never where this command guessed.\n */\nexport default class CreationDriveCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'creation drive',\n description: 'Drive the creation unattended until a stop rule fires: rounds, the build, acceptance, restarts.',\n category: CommandCategory.Local,\n minimumScope: WorkspaceScope.SAAS_APP,\n flags: {\n goal: { type: 'string', description: 'What the creation should achieve, in a sentence' },\n until: { type: 'string', description: 'When to stop: `stuck` (the first stop rule that fires)', default: CreationDriveUntil.STUCK },\n 'max-hours': { type: 'string', description: 'The wall-clock ceiling, in hours (required)' },\n 'max-usd': { type: 'string', description: 'The spend ceiling, in US dollars of measured spend (required)' },\n 'fan-out': { type: 'string', description: 'The most playbooks one round may run at once, 1 to 5' },\n json: { type: 'boolean', description: 'Emit the drive\\'s result document.', default: false },\n [SKIP_PREFLIGHT_FLAG]: { type: 'boolean', description: 'Start even when `wildo creation preflight` reports a FAIL.', default: false },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const goal = typeof ctx.flags.goal === 'string' ? ctx.flags.goal.trim() : '';\n const until = String(ctx.flags.until ?? CreationDriveUntil.STUCK);\n const maximumHours = Number(ctx.flags['max-hours']);\n const maximumUsd = Number(ctx.flags['max-usd']);\n const fanOut = ctx.flags['fan-out'] === undefined ? undefined : Number(ctx.flags['fan-out']);\n if (goal.length === 0 || !(Object.values(CreationDriveUntil) as string[]).includes(until)\n || !(maximumHours > 0) || !(maximumUsd > 0) || (fanOut !== undefined && !(Number.isSafeInteger(fanOut) && fanOut >= 1 && fanOut <= 5))) {\n ctx.log.error('Usage: wildo creation drive --goal \"<what the creation should achieve>\" --until stuck --max-hours <h> --max-usd <n> [--fan-out <1-5>]');\n return { success: false };\n }\n if (!ensureSaasAppScope(ctx)) return { success: false };\n // Once, before the first round (#2229); every loop request is checked again by the companion.\n if (!await admitCreationRunAfterPreflight(ctx, 'wildo creation drive')) {\n if (ctx.flags.json === true) writeJsonDocument({ stoppedBy: CreationDriveStopRule.PREFLIGHT_FAILED, waitingFor: 'wildo creation preflight' });\n return { success: false };\n }\n const options = await resolveCompanionClientOptionsFromContext(ctx, CONSOLE_READ_TIMEOUT_MS);\n const loopOptions = { ...options, timeoutMs: CREATION_DRIVE_LOOP_REQUEST_TIMEOUT_MS };\n let result: CreationDriveResult;\n try {\n result = await runCreationDrive({\n readFeed: () => CreationConsoleClient.readFeed(options) as Promise<CreationConsole_Feed>,\n readStatus: () => CompanionClient.get<CreationDrive_Status>('/api/companion/creation/drive/status', options),\n // Derives the maturity reading (the landing probe, the follow-ups), so it gets the console's write deadline (#3701).\n readRequirementsStanding: () => CompanionClient.get<CreationDrive_RequirementsStanding>('/api/companion/creation/requirements/standing', { ...options, timeoutMs: CONSOLE_WRITE_TIMEOUT_MS }),\n readSpentUsd: async () => (await CreationConsoleClient.report(options)).spend.total.cost['USD'],\n runLoop: (request) => CreationConsoleClient.loop(loopOptions, request),\n // The accept waits for the worktree lock (up to about ten minutes), so it gets the console's write deadline.\n accept: () => CompanionClient.post<CreationDrive_AcceptOutcome>('/api/companion/creation/drive/accept', {}, { ...options, timeoutMs: CONSOLE_WRITE_TIMEOUT_MS }),\n isCompanionUnreachable: (error) => companionFailureExitCode(error) === 2,\n isClientTimeout: (error) => error instanceof CompanionRequestTimeoutError,\n isNotReadyYet: (error) => error instanceof CompanionRefusalError && error.status === 503,\n isConnectionClosedBeforeAnswer: isCompanionConnectionClosedBeforeAnswer,\n isAlreadyRunning: (error) => error instanceof CompanionRefusalError && error.status === 409,\n readProviderAccountRefusal: readCompanionProviderAccountRefusal,\n now: () => Date.now(),\n sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),\n progress: (line) => { if (ctx.flags.json !== true) ctx.log.info(line); },\n }, {\n goal,\n maximumMs: maximumHours * 3_600_000,\n maximumUsd,\n ...(fanOut !== undefined ? { fanOut } : {}),\n ...(ctx.flags[SKIP_PREFLIGHT_FLAG] === true ? { skipPreflight: true } : {}),\n });\n } catch (error) {\n ctx.log.error(`The creation drive stopped on an error: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false, exitCode: companionFailureExitCode(error) };\n }\n if (ctx.flags.json === true) writeJsonDocument(result);\n else for (const line of describeCreationDriveResult(result)) ctx.log.info(line);\n return { success: true };\n }\n}\n\n/** The drive's end, for a person: the rule that stopped it, what it waits for, and what it did. */\nexport function describeCreationDriveResult(result: CreationDriveResult): string[] {\n return [\n `The drive stopped: ${result.stoppedBy}.`,\n ` Waiting for: ${result.waitingFor}`,\n ` ${result.loops} loop(s), ${result.rounds} round(s), ${result.accepted} playbook run(s) accepted, ${result.companionRestarts} companion restart(s) seen, `\n + `${Math.round(result.elapsedMs / 60_000)} min${result.spentUsd === undefined ? '' : `, USD ${result.spentUsd.toFixed(2)} measured`}.`,\n ...(result.spendMeasured ? [] : [' The spend ceiling was not applied: the run report stated no measured USD spend.']),\n ' What a person did along the way, and the independence score: wildo creation report',\n ];\n}\n"]}
|
|
@@ -79,6 +79,8 @@ export interface EmailTemplateStatusCliResult {
|
|
|
79
79
|
exists: boolean;
|
|
80
80
|
updatedAt: string;
|
|
81
81
|
}>;
|
|
82
|
+
/** Why the template has no place: its owner registers templates from no folder the companion can read (#3904). */
|
|
83
|
+
notPlacedBecause?: string;
|
|
82
84
|
}
|
|
83
85
|
export declare function requireStringFlag(ctx: CommandContext, flagName: string, label: string): string | null;
|
|
84
86
|
export declare function printWarnings(ctx: CommandContext, warnings?: string[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-command.utils.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/email-command.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAIpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAI9D,wDAAwD;AACxD,eAAO,MAAM,0BAA0B,QAAS,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,QAAgB,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,QAAiB,CAAC;AAE1D,MAAM,WAAW,+BAA+B;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,CAAC,E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AAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,KAAK,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,OAAO,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"email-command.utils.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/email-command.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAIpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAI9D,wDAAwD;AACxD,eAAO,MAAM,0BAA0B,QAAS,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,QAAgB,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,QAAiB,CAAC;AAE1D,MAAM,WAAW,+BAA+B;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,EAA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}
|
|
72
72
|
for (const status of statuses) {
|
|
73
|
+
if (status.notPlacedBecause !== undefined) {
|
|
74
|
+
ctx.log.info(` ${chalk.red('not-placed')} ${status.templateRef} (${status.ownerId})`);
|
|
75
|
+
ctx.log.info(chalk.dim(` ${status.notPlacedBecause}`));
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
73
78
|
const templateState = status.templateExists ? chalk.green('template') : chalk.yellow('missing-template');
|
|
74
79
|
ctx.log.info(` ${templateState} ${status.templateRef} (${status.ownerId})`);
|
|
75
80
|
ctx.log.info(chalk.dim(` path: ${status.templatePath}`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-command.utils.js","sourceRoot":"","sources":["../../../../src/commands/generate/email-command.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AAEzF,OAAO,EAAE,mCAAmC,EAAE,MAAM,qEAAqE,CAAC;AAG1H,wDAAwD;AACxD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAEzD;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAyE1D,MAAM,UAAU,iBAAiB,CAAC,GAAmB,EAAE,QAAgB,EAAE,KAAa;IACpF,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC;IAED,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,2BAA2B,QAAQ,KAAK,KAAK,I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1B,IAAI,EAAE,YAAY,EAAE,IAAI;QACxB,SAAS;KACV,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAI,GAAmB,EAAE,IAAY,EAAE,YAAoB,0BAA0B;IACrH,OAAO,eAAe,CAAC,GAAG,CAAI,IAAI,EAAE,MAAM,6BAA6B,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;AAC3F,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAI,GAAmB,EAAE,IAAY,EAAE,IAAc,EAAE,YAAoB,0BAA0B;IACtI,OAAO,eAAe,CAAC,IAAI,CAAI,IAAI,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;AAClG,CAAC","sourcesContent":["import type { EmailSubmissionOutcome } from '@wildo-ai/saas-models';\nimport chalk from 'chalk';\n\nimport { CompanionClient } from '~wildo-cli/services/companion/companion-client.service';\nimport type { CommandContext } from '~wildo-cli/kernel/types';\nimport { loadAppLocalRuntimeServiceAddresses } from '~wildo-cli/services/application/app-local-runtime-addresses.service';\nimport type { CompanionClientOptions } from '~wildo-cli/services/companion/companion.schemas';\n\n/** Preview and test-send: one template, no planning. */\nexport const EMAIL_COMPANION_TIMEOUT_MS = 60_000;\n\n/**\n * Status: no model call, but it asks the backend's email-template placement through an introspection, and a COLD one\n * took about two minutes on Wonder Ledger (#3156, measured 2026-10-29, the companion just restarted). The 60 s bound\n * answered \"timed out\" while the companion went on and answered. Same reasoning as `LABELLING_INSPECTION_TIMEOUT_MS`.\n */\nexport const EMAIL_INSPECTION_TIMEOUT_MS = 5 * 60 * 1000;\n\n/**\n * Generate and translate: the same placement introspection, then up to one model call per template. Measured on Wonder\n * Ledger (#3156): `wildo generate email` failed with \"timed out after 60000ms\" while the companion delivered all 17\n * missing templates a minute later. Same bound as `LABELLING_COMPANION_TIMEOUT_MS`, for the same kind of run.\n */\nexport const EMAIL_GENERATION_TIMEOUT_MS = 30 * 60 * 1000;\n\nexport interface GenerateEmailTemplatesCliResult {\n generated?: number;\n skipped?: number;\n failed?: number;\n warnings?: string[];\n generatedAt?: string;\n details?: Array<{\n ownerId: string;\n templateRef: string;\n locale: string;\n success: boolean;\n skipped?: boolean;\n templatePath?: string;\n labelsPath?: string;\n errors?: string[];\n }>;\n}\n\nexport interface TranslateEmailTemplatesCliResult {\n translatedFiles?: number;\n skipped?: number;\n failed?: number;\n warnings?: string[];\n completedAt?: string;\n details?: Array<{\n ownerId: string;\n templateRef: string;\n targetLocale: string;\n success: boolean;\n outputPath?: string;\n error?: string;\n }>;\n}\n\nexport interface PreviewEmailTemplateCliResult {\n templateRef: string;\n locale: string;\n resolvedLocale?: string;\n subject: string;\n bodyHtml: string;\n bodyText?: string;\n previewedAt: string;\n}\n\nexport interface TestSendEmailCliResult {\n success: boolean;\n submissionId: string;\n outcome: EmailSubmissionOutcome;\n retryable: boolean;\n deduplicated?: boolean;\n templateRef: string;\n locale: string;\n recipientEmail: string;\n providerMessageIds: string[];\n error?: string;\n sentAt: string;\n}\n\nexport interface EmailTemplateStatusCliResult {\n ownerId: string;\n templateRef: string;\n templatePath: string;\n templateExists: boolean;\n locales: Array<{\n locale: string;\n labelsPath: string;\n exists: boolean;\n updatedAt: string;\n }>;\n}\n\nexport function requireStringFlag(ctx: CommandContext, flagName: string, label: string): string | null {\n const value = ctx.flags[flagName];\n if (typeof value === 'string' && value.trim().length > 0) {\n return value.trim();\n }\n\n ctx.log.error(`Missing required flag --${flagName} (${label}).`);\n return null;\n}\n\nexport function printWarnings(ctx: CommandContext, warnings?: string[]): void {\n if (!warnings?.length) {\n return;\n }\n\n for (const warning of warnings) {\n ctx.log.warn(` Warning: ${warning}`);\n }\n}\n\nexport function printGenerateDetails(\n ctx: CommandContext,\n details?: GenerateEmailTemplatesCliResult['details'],\n): void {\n if (!details?.length) {\n return;\n }\n\n for (const detail of details) {\n const status = detail.success\n ? detail.skipped ? chalk.yellow('skipped') : chalk.green('generated')\n : chalk.red('failed');\n ctx.log.info(` ${status} ${detail.templateRef} (${detail.ownerId}, ${detail.locale})`);\n if (detail.templatePath) ctx.log.info(chalk.dim(` template: ${detail.templatePath}`));\n if (detail.labelsPath) ctx.log.info(chalk.dim(` labels: ${detail.labelsPath}`));\n if (detail.errors?.length) {\n for (const error of detail.errors) {\n ctx.log.error(` ${error}`);\n }\n }\n }\n}\n\nexport function printTranslateDetails(\n ctx: CommandContext,\n details?: TranslateEmailTemplatesCliResult['details'],\n): void {\n if (!details?.length) {\n return;\n }\n\n for (const detail of details) {\n const status = detail.success ? chalk.green('translated') : chalk.red('failed');\n ctx.log.info(` ${status} ${detail.templateRef} (${detail.ownerId}, ${detail.targetLocale})`);\n if (detail.outputPath) ctx.log.info(chalk.dim(` output: ${detail.outputPath}`));\n if (detail.error) ctx.log.error(` ${detail.error}`);\n }\n}\n\nexport function printStatusDetails(\n ctx: CommandContext,\n statuses: EmailTemplateStatusCliResult[],\n): void {\n if (statuses.length === 0) {\n ctx.log.info(chalk.dim(' No email template artifacts found.'));\n return;\n }\n\n for (const status of statuses) {\n const templateState = status.templateExists ? chalk.green('template') : chalk.yellow('missing-template');\n ctx.log.info(` ${templateState} ${status.templateRef} (${status.ownerId})`);\n ctx.log.info(chalk.dim(` path: ${status.templatePath}`));\n\n if (status.locales.length === 0) {\n ctx.log.info(chalk.dim(' locales: none'));\n continue;\n }\n\n for (const locale of status.locales) {\n ctx.log.info(chalk.dim(` ${locale.locale}: ${locale.labelsPath} (${locale.updatedAt})`));\n }\n }\n}\n\nasync function resolveCompanionClientOptions(ctx: CommandContext, timeoutMs: number): Promise<CompanionClientOptions> {\n const saasRoot = ctx.cliContext.resolvedHomes.app.declarationRoot;\n if (!saasRoot) {\n return { timeoutMs };\n }\n\n const serviceAddresses = await loadAppLocalRuntimeServiceAddresses(saasRoot);\n const devCompanion = serviceAddresses?.devCompanion;\n\n return {\n appRoot: saasRoot,\n baseUrl: devCompanion?.url,\n port: devCompanion?.port,\n timeoutMs,\n };\n}\n\nexport async function companionGet<T>(ctx: CommandContext, path: string, timeoutMs: number = EMAIL_COMPANION_TIMEOUT_MS): Promise<T> {\n return CompanionClient.get<T>(path, await resolveCompanionClientOptions(ctx, timeoutMs));\n}\n\nexport async function companionPost<T>(ctx: CommandContext, path: string, body?: unknown, timeoutMs: number = EMAIL_COMPANION_TIMEOUT_MS): Promise<T> {\n return CompanionClient.post<T>(path, body, await resolveCompanionClientOptions(ctx, timeoutMs));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"email-command.utils.js","sourceRoot":"","sources":["../../../../src/commands/generate/email-command.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AAEzF,OAAO,EAAE,mCAAmC,EAAE,MAAM,qEAAqE,CAAC;AAG1H,wDAAwD;AACxD,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAEzD;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AA2E1D,MAAM,UAAU,iBAAiB,CAAC,GAAmB,EAAE,QAAgB,EAAE,KAAa;IACpF,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC;IAED,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,2BAA2B,QAAQ,KAAK,KAAK,IAAI,CAAC,CAAC;IACjE,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,aAAa,CAAC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I,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,EAAE,SAAS,EAAE,CAAC;IACvB,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,mCAAmC,CAAC,QAAQ,CAAC,CAAC;IAC7E,MAAM,YAAY,GAAG,gBAAgB,EAAE,YAAY,CAAC;IAEpD,OAAO;QACL,OAAO,EAAE,QAAQ;QACjB,OAAO,EAAE,YAAY,EAAE,GAAG;QAC1B,IAAI,EAAE,YAAY,EAAE,IAAI;QACxB,SAAS;KACV,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAI,GAAmB,EAAE,IAAY,EAAE,YAAoB,0BAA0B;IACrH,OAAO,eAAe,CAAC,GAAG,CAAI,IAAI,EAAE,MAAM,6BAA6B,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;AAC3F,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAI,GAAmB,EAAE,IAAY,EAAE,IAAc,EAAE,YAAoB,0BAA0B;IACtI,OAAO,eAAe,CAAC,IAAI,CAAI,IAAI,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;AAClG,CAAC","sourcesContent":["import type { EmailSubmissionOutcome } from '@wildo-ai/saas-models';\nimport chalk from 'chalk';\n\nimport { CompanionClient } from '~wildo-cli/services/companion/companion-client.service';\nimport type { CommandContext } from '~wildo-cli/kernel/types';\nimport { loadAppLocalRuntimeServiceAddresses } from '~wildo-cli/services/application/app-local-runtime-addresses.service';\nimport type { CompanionClientOptions } from '~wildo-cli/services/companion/companion.schemas';\n\n/** Preview and test-send: one template, no planning. */\nexport const EMAIL_COMPANION_TIMEOUT_MS = 60_000;\n\n/**\n * Status: no model call, but it asks the backend's email-template placement through an introspection, and a COLD one\n * took about two minutes on Wonder Ledger (#3156, measured 2026-10-29, the companion just restarted). The 60 s bound\n * answered \"timed out\" while the companion went on and answered. Same reasoning as `LABELLING_INSPECTION_TIMEOUT_MS`.\n */\nexport const EMAIL_INSPECTION_TIMEOUT_MS = 5 * 60 * 1000;\n\n/**\n * Generate and translate: the same placement introspection, then up to one model call per template. Measured on Wonder\n * Ledger (#3156): `wildo generate email` failed with \"timed out after 60000ms\" while the companion delivered all 17\n * missing templates a minute later. Same bound as `LABELLING_COMPANION_TIMEOUT_MS`, for the same kind of run.\n */\nexport const EMAIL_GENERATION_TIMEOUT_MS = 30 * 60 * 1000;\n\nexport interface GenerateEmailTemplatesCliResult {\n generated?: number;\n skipped?: number;\n failed?: number;\n warnings?: string[];\n generatedAt?: string;\n details?: Array<{\n ownerId: string;\n templateRef: string;\n locale: string;\n success: boolean;\n skipped?: boolean;\n templatePath?: string;\n labelsPath?: string;\n errors?: string[];\n }>;\n}\n\nexport interface TranslateEmailTemplatesCliResult {\n translatedFiles?: number;\n skipped?: number;\n failed?: number;\n warnings?: string[];\n completedAt?: string;\n details?: Array<{\n ownerId: string;\n templateRef: string;\n targetLocale: string;\n success: boolean;\n outputPath?: string;\n error?: string;\n }>;\n}\n\nexport interface PreviewEmailTemplateCliResult {\n templateRef: string;\n locale: string;\n resolvedLocale?: string;\n subject: string;\n bodyHtml: string;\n bodyText?: string;\n previewedAt: string;\n}\n\nexport interface TestSendEmailCliResult {\n success: boolean;\n submissionId: string;\n outcome: EmailSubmissionOutcome;\n retryable: boolean;\n deduplicated?: boolean;\n templateRef: string;\n locale: string;\n recipientEmail: string;\n providerMessageIds: string[];\n error?: string;\n sentAt: string;\n}\n\nexport interface EmailTemplateStatusCliResult {\n ownerId: string;\n templateRef: string;\n templatePath: string;\n templateExists: boolean;\n locales: Array<{\n locale: string;\n labelsPath: string;\n exists: boolean;\n updatedAt: string;\n }>;\n /** Why the template has no place: its owner registers templates from no folder the companion can read (#3904). */\n notPlacedBecause?: string;\n}\n\nexport function requireStringFlag(ctx: CommandContext, flagName: string, label: string): string | null {\n const value = ctx.flags[flagName];\n if (typeof value === 'string' && value.trim().length > 0) {\n return value.trim();\n }\n\n ctx.log.error(`Missing required flag --${flagName} (${label}).`);\n return null;\n}\n\nexport function printWarnings(ctx: CommandContext, warnings?: string[]): void {\n if (!warnings?.length) {\n return;\n }\n\n for (const warning of warnings) {\n ctx.log.warn(` Warning: ${warning}`);\n }\n}\n\nexport function printGenerateDetails(\n ctx: CommandContext,\n details?: GenerateEmailTemplatesCliResult['details'],\n): void {\n if (!details?.length) {\n return;\n }\n\n for (const detail of details) {\n const status = detail.success\n ? detail.skipped ? chalk.yellow('skipped') : chalk.green('generated')\n : chalk.red('failed');\n ctx.log.info(` ${status} ${detail.templateRef} (${detail.ownerId}, ${detail.locale})`);\n if (detail.templatePath) ctx.log.info(chalk.dim(` template: ${detail.templatePath}`));\n if (detail.labelsPath) ctx.log.info(chalk.dim(` labels: ${detail.labelsPath}`));\n if (detail.errors?.length) {\n for (const error of detail.errors) {\n ctx.log.error(` ${error}`);\n }\n }\n }\n}\n\nexport function printTranslateDetails(\n ctx: CommandContext,\n details?: TranslateEmailTemplatesCliResult['details'],\n): void {\n if (!details?.length) {\n return;\n }\n\n for (const detail of details) {\n const status = detail.success ? chalk.green('translated') : chalk.red('failed');\n ctx.log.info(` ${status} ${detail.templateRef} (${detail.ownerId}, ${detail.targetLocale})`);\n if (detail.outputPath) ctx.log.info(chalk.dim(` output: ${detail.outputPath}`));\n if (detail.error) ctx.log.error(` ${detail.error}`);\n }\n}\n\nexport function printStatusDetails(\n ctx: CommandContext,\n statuses: EmailTemplateStatusCliResult[],\n): void {\n if (statuses.length === 0) {\n ctx.log.info(chalk.dim(' No email template artifacts found.'));\n return;\n }\n\n for (const status of statuses) {\n if (status.notPlacedBecause !== undefined) {\n ctx.log.info(` ${chalk.red('not-placed')} ${status.templateRef} (${status.ownerId})`);\n ctx.log.info(chalk.dim(` ${status.notPlacedBecause}`));\n continue;\n }\n const templateState = status.templateExists ? chalk.green('template') : chalk.yellow('missing-template');\n ctx.log.info(` ${templateState} ${status.templateRef} (${status.ownerId})`);\n ctx.log.info(chalk.dim(` path: ${status.templatePath}`));\n\n if (status.locales.length === 0) {\n ctx.log.info(chalk.dim(' locales: none'));\n continue;\n }\n\n for (const locale of status.locales) {\n ctx.log.info(chalk.dim(` ${locale.locale}: ${locale.labelsPath} (${locale.updatedAt})`));\n }\n }\n}\n\nasync function resolveCompanionClientOptions(ctx: CommandContext, timeoutMs: number): Promise<CompanionClientOptions> {\n const saasRoot = ctx.cliContext.resolvedHomes.app.declarationRoot;\n if (!saasRoot) {\n return { timeoutMs };\n }\n\n const serviceAddresses = await loadAppLocalRuntimeServiceAddresses(saasRoot);\n const devCompanion = serviceAddresses?.devCompanion;\n\n return {\n appRoot: saasRoot,\n baseUrl: devCompanion?.url,\n port: devCompanion?.port,\n timeoutMs,\n };\n}\n\nexport async function companionGet<T>(ctx: CommandContext, path: string, timeoutMs: number = EMAIL_COMPANION_TIMEOUT_MS): Promise<T> {\n return CompanionClient.get<T>(path, await resolveCompanionClientOptions(ctx, timeoutMs));\n}\n\nexport async function companionPost<T>(ctx: CommandContext, path: string, body?: unknown, timeoutMs: number = EMAIL_COMPANION_TIMEOUT_MS): Promise<T> {\n return CompanionClient.post<T>(path, body, await resolveCompanionClientOptions(ctx, timeoutMs));\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.command.d.ts","sourceRoot":"","sources":["../../../src/commands/init.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;
|
|
1
|
+
{"version":3,"file":"init.command.d.ts","sourceRoot":"","sources":["../../../src/commands/init.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAWH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAOL,KAAK,uBAAuB,EAC7B,MAAM,+BAA+B,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mkdtempSync, realpathSync, rmSync } from 'fs';
|
|
34
34
|
import { tmpdir } from 'os';
|
|
35
35
|
import { basename, dirname, join, resolve as resolvePath } from 'path';
|
|
36
|
+
import { readHostRunsMessageBroker } from '../services/environment/authored-infra-config.utils.js';
|
|
36
37
|
import { linkableFrameworkCheckout } from '@wildo-ai/application-creation-runtime';
|
|
37
38
|
import { BaseCommand } from '../kernel/base-command.js';
|
|
38
39
|
import { CommandCategory } from '../kernel/types.js';
|
|
@@ -623,6 +624,10 @@ export default class InitCommand extends BaseCommand {
|
|
|
623
624
|
// Decided up front with the shared half, so a refused mode or a declined prompt comes before anything is written.
|
|
624
625
|
await this.resolveProviderKeyDefaultsOnce(ctx);
|
|
625
626
|
const infrastructureHost = localDefaults === null ? null : resolveInfrastructureHostFor(cwd, localDefaults);
|
|
627
|
+
// #2303 slice D: a host whose profile runs no broker refuses a hosted application's RabbitMQ vhost, so the scaffold
|
|
628
|
+
// asks the host's own descriptor. A host whose descriptor cannot be read keeps the broker declaration (the previous
|
|
629
|
+
// shape), and the hosted resolution then reports whatever is wrong with the host by name.
|
|
630
|
+
const hostRunsMessageBroker = infrastructureHost === null ? undefined : await readHostRunsMessageBroker(join(cwd, infrastructureHost));
|
|
626
631
|
if (infrastructureHost !== null) {
|
|
627
632
|
ctx.log.info('');
|
|
628
633
|
ctx.log.info(chalk.cyan(` This application will run on the infrastructure of ${infrastructureHost}`));
|
|
@@ -651,7 +656,7 @@ export default class InitCommand extends BaseCommand {
|
|
|
651
656
|
frameworkPath,
|
|
652
657
|
mode: skeletonMode,
|
|
653
658
|
database,
|
|
654
|
-
...(infrastructureHost !== null ? { infrastructureHost } : {}),
|
|
659
|
+
...(infrastructureHost !== null ? { infrastructureHost, hostRunsMessageBroker } : {}),
|
|
655
660
|
});
|
|
656
661
|
}
|
|
657
662
|
catch (error) {
|
|
@@ -665,7 +670,7 @@ export default class InitCommand extends BaseCommand {
|
|
|
665
670
|
frameworkPath,
|
|
666
671
|
mode: skeletonMode,
|
|
667
672
|
database,
|
|
668
|
-
...(infrastructureHost !== null ? { infrastructureHost } : {}),
|
|
673
|
+
...(infrastructureHost !== null ? { infrastructureHost, hostRunsMessageBroker } : {}),
|
|
669
674
|
...(portBase !== undefined ? { portBase } : {}),
|
|
670
675
|
skipInstall: ctx.flags.skipInstall === true || ctx.flags['skip-install'] === true,
|
|
671
676
|
log: ctx.log,
|