@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
|
@@ -5,6 +5,7 @@ import { Command as CommanderCommand, CommanderError } from 'commander';
|
|
|
5
5
|
import { BaseCommand } from './base-command.js';
|
|
6
6
|
import { DEFAULT_GLOBAL_FLAGS } from './types.js';
|
|
7
7
|
import { createLogger, LoggerHumanLineSink } from './logger.js';
|
|
8
|
+
import { commandEmitsDocument } from './json-document-output.js';
|
|
8
9
|
import { ErrorUtils } from '../infrastructure/errors/error.utils.js';
|
|
9
10
|
// ---------------------------------------------------------------------------
|
|
10
11
|
// Global flag extraction — strips global flags before command-specific parsing
|
|
@@ -138,10 +139,7 @@ function mapPositionalArgs(values, defs) {
|
|
|
138
139
|
* probe`, `market generate`, `workbench status`, `frontend look`). Decided HERE, once, rather than at
|
|
139
140
|
* each verb's branch, because the fifteen verbs that each decided it for themselves all decided it wrong.
|
|
140
141
|
*/
|
|
141
|
-
function
|
|
142
|
-
return parsedFlags.json === true;
|
|
143
|
-
}
|
|
144
|
-
function buildCommandContext(parsedArgs, parsedFlags, rawArgs, globalFlags, answers, services) {
|
|
142
|
+
function buildCommandContext(meta, parsedArgs, parsedFlags, rawArgs, globalFlags, answers, services) {
|
|
145
143
|
return {
|
|
146
144
|
args: parsedArgs,
|
|
147
145
|
flags: parsedFlags,
|
|
@@ -151,7 +149,7 @@ function buildCommandContext(parsedArgs, parsedFlags, rawArgs, globalFlags, answ
|
|
|
151
149
|
activeEnv: services.activeEnv,
|
|
152
150
|
preferences: services.preferences,
|
|
153
151
|
cliContext: services.cliContext,
|
|
154
|
-
log:
|
|
152
|
+
log: commandEmitsDocument(meta, parsedFlags)
|
|
155
153
|
? (services.documentModeLog ?? createLogger(LoggerHumanLineSink.STDERR))
|
|
156
154
|
: services.log,
|
|
157
155
|
registry: services.registry,
|
|
@@ -171,7 +169,7 @@ export async function runCommand(command, rawArgs, globalFlags, services) {
|
|
|
171
169
|
if (globalFlags.answersFile) {
|
|
172
170
|
answers = BaseCommand.loadAnswersFile(globalFlags.answersFile);
|
|
173
171
|
}
|
|
174
|
-
ctx = buildCommandContext(args, flags, rawArgs, globalFlags, answers, services);
|
|
172
|
+
ctx = buildCommandContext(command.meta, args, flags, rawArgs, globalFlags, answers, services);
|
|
175
173
|
}
|
|
176
174
|
catch (error) {
|
|
177
175
|
const message = ErrorUtils.extractErrorMessage(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-runner.js","sourceRoot":"","sources":["../../../src/kernel/command-runner.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAa7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,8EAA8E;AAC9E,+EAA+E;AAC/E,8EAA8E;AAE9E,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,IAAI,EAAE,mBAAmB;IACzB,WAAW;IACX,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,SAAS;CAChB,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAkB;IACrD,OAAO;QACL,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACnC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAiB;IA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AAC;QAClD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC3D,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC1D,OAAO;YACL,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC;SAC/C,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["/**\n * CommandRunner — parse args, extract global flags, run lifecycle hooks, execute command.\n */\n\nimport { Command as CommanderCommand, CommanderError } from 'commander';\nimport { BaseCommand } from './base-command';\nimport type { CommandRegistry } from './command-registry';\nimport type { HookRegistry } from './hooks';\nimport type {\n CommandMeta,\n CommandContext,\n CommandResult,\n Logger,\n CliContext,\n PlatformEnvironmentConfiguration,\n WildoPreferences,\n GlobalFlags,\n} from './types';\nimport { DEFAULT_GLOBAL_FLAGS } from './types';\nimport { createLogger, LoggerHumanLineSink } from './logger';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\n\n// ---------------------------------------------------------------------------\n// Global flag extraction — strips global flags before command-specific parsing\n// ---------------------------------------------------------------------------\n\nconst GLOBAL_FLAG_NAMES = new Set([\n '-y', '--non-interactive',\n '--answers',\n '-v', '--verbose',\n '-q', '--quiet',\n]);\n\n/**\n * The inverse of {@link extractGlobalFlags}: the arguments a re-invoked `wildo` must receive to behave\n * like this one. Global flags are parsed from any position, so they may precede the command. Used by\n * every command that runs another `wildo` as a child (`update` re-executing the new CLI, `fwk publish\n * all` running each publish step).\n */\nexport function forwardedGlobalFlags(flags: GlobalFlags): string[] {\n return [\n ...(flags.nonInteractive ? ['-y'] : []),\n ...(flags.verbose ? ['--verbose'] : []),\n ...(flags.quiet ? ['--quiet'] : []),\n ...(flags.answersFile ? ['--answers', flags.answersFile] : []),\n ];\n}\n\nexport function extractGlobalFlags(rawArgs: string[]): { globalFlags: GlobalFlags; commandArgs: string[] } {\n const globalFlags: GlobalFlags = { ...DEFAULT_GLOBAL_FLAGS };\n const commandArgs: string[] = [];\n\n for (let i = 0; i < rawArgs.length; i++) {\n const arg = rawArgs[i];\n\n if (arg === '-y' || arg === '--non-interactive') {\n globalFlags.nonInteractive = true;\n } else if (arg === '--answers' || arg.startsWith('--answers=')) {\n if (arg.startsWith('--answers=')) {\n globalFlags.answersFile = arg.slice('--answers='.length);\n } else {\n const next = rawArgs[i + 1];\n if (!next || next.startsWith('-')) {\n console.error('--answers requires a file path argument.');\n process.exitCode = 1;\n return { globalFlags, commandArgs: [] };\n }\n globalFlags.answersFile = next;\n i++;\n }\n } else if (arg === '-v' || arg === '--verbose') {\n globalFlags.verbose = true;\n } else if (arg === '-q' || arg === '--quiet') {\n globalFlags.quiet = true;\n } else {\n commandArgs.push(arg);\n }\n }\n\n return { globalFlags, commandArgs };\n}\n\n// ---------------------------------------------------------------------------\n// Arg/flag parsing via Commander.js (instantiated per command, not global)\n// ---------------------------------------------------------------------------\n\nexport function parseCommandArgs(\n meta: CommandMeta,\n rawArgs: string[],\n): { flags: Record<string, unknown>; args: Record<string, string | undefined>; helpDisplayed?: boolean } {\n const program = new CommanderCommand();\n program.exitOverride();\n\n for (const [name, def] of Object.entries(meta.flags ?? {})) {\n const flag =\n def.type === 'boolean'\n ? `--${name}`\n : def.type === 'string[]'\n ? `--${name} <value...>`\n : `--${name} <value>`;\n\n if (def.type === 'number') {\n program.option(flag, def.description, (v: string) => Number(v), def.default);\n } else {\n // `string[]` uses Commander's variadic `<value...>` arity: every following\n // space-separated token is collected into an array, so `--units a b c` is\n // not silently truncated to its first token (the rest are no longer\n // swallowed as stray positionals).\n program.option(flag, def.description, def.default as string | boolean | string[] | undefined);\n }\n }\n\n for (const arg of meta.args ?? []) {\n const token = arg.required ? `<${arg.name}>` : `[${arg.name}]`;\n program.argument(token, arg.description);\n }\n\n try {\n program.parse(rawArgs, { from: 'user' });\n } catch (err) {\n if (err instanceof CommanderError) {\n if (err.code === 'commander.helpDisplayed') {\n return { flags: {}, args: {}, helpDisplayed: true };\n }\n throw new Error(`Invalid arguments for '${meta.name}': ${err.message}`);\n }\n throw err;\n }\n\n const flags = program.opts();\n // Commander CAMELIZES multi-word option names in `opts()` (`--register-only` →\n // `registerOnly`), while command code historically reads `ctx.flags['register-only']`.\n // Mirror every declared kebab name onto its camelized value so BOTH spellings are always\n // present — the kebab-only read silently shipped `--register-only` (the #50 guard bypass),\n // `db resolve --rolled-back`, `db generate --accept-planner-contract`,\n // `db diff --update-lockfile` and `registry ping --companion-port` as dead flags. Fixing it\n // HERE is the unbypassable form; per-command dual reads remain harmless.\n for (const name of Object.keys(meta.flags ?? {})) {\n if (!name.includes('-')) continue;\n const camelized = name.replace(/-([a-z0-9])/g, (_, character: string) => character.toUpperCase());\n if (!(name in flags) && camelized in flags) {\n flags[name] = flags[camelized];\n }\n }\n const positionals = program.processedArgs as unknown[];\n const args = mapPositionalArgs(positionals, meta.args);\n\n return { flags, args };\n}\n\nfunction mapPositionalArgs(\n values: unknown[],\n defs?: CommandMeta['args'],\n): Record<string, string | undefined> {\n const result: Record<string, string | undefined> = {};\n if (!defs) return result;\n\n for (let i = 0; i < defs.length; i++) {\n result[defs[i].name] = values[i] != null ? String(values[i]) : undefined;\n }\n return result;\n}\n\n// ---------------------------------------------------------------------------\n// Context builder\n// ---------------------------------------------------------------------------\n\nexport interface CommandRunnerServices {\n hooks: HookRegistry;\n log: Logger;\n /**\n * The logger a `--json` run gets: its human lines go to stderr, so stdout carries the command's\n * document alone (#2068). Defaults to the real one; a test injects its own.\n */\n documentModeLog?: Logger;\n cliContext: CliContext;\n activeEnv: PlatformEnvironmentConfiguration | null;\n preferences: WildoPreferences | null;\n registry?: CommandRegistry;\n}\n\n/**\n * A command's own `--json` means \"stdout is one machine document\" — every command that declares the flag\n * uses it that way (the creation and build console verbs, `context`, `secrets`, `local doctor`, `acp\n * probe`, `market generate`, `workbench status`, `frontend look`). Decided HERE, once, rather than at\n * each verb's branch, because the fifteen verbs that each decided it for themselves all decided it wrong.\n */\nfunction commandEmitsJsonDocument(parsedFlags: Record<string, unknown>): boolean {\n return parsedFlags.json === true;\n}\n\nfunction buildCommandContext(\n parsedArgs: Record<string, string | undefined>,\n parsedFlags: Record<string, unknown>,\n rawArgs: string[],\n globalFlags: GlobalFlags,\n answers: Record<string, unknown>,\n services: CommandRunnerServices,\n): CommandContext {\n return {\n args: parsedArgs,\n flags: parsedFlags,\n rawArgs,\n globalFlags,\n answers,\n activeEnv: services.activeEnv,\n preferences: services.preferences,\n cliContext: services.cliContext,\n log: commandEmitsJsonDocument(parsedFlags)\n ? (services.documentModeLog ?? createLogger(LoggerHumanLineSink.STDERR))\n : services.log,\n registry: services.registry,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Command runner — lifecycle orchestration\n// ---------------------------------------------------------------------------\n\nexport async function runCommand(\n command: BaseCommand,\n rawArgs: string[],\n globalFlags: GlobalFlags,\n services: CommandRunnerServices,\n): Promise<CommandResult> {\n let ctx: CommandContext;\n\n try {\n const { flags, args, helpDisplayed } = parseCommandArgs(command.meta, rawArgs);\n if (helpDisplayed) {\n return { success: true };\n }\n\n let answers: Record<string, unknown> = {};\n if (globalFlags.answersFile) {\n answers = BaseCommand.loadAnswersFile(globalFlags.answersFile);\n }\n\n ctx = buildCommandContext(args, flags, rawArgs, globalFlags, answers, services);\n } catch (error) {\n const message = ErrorUtils.extractErrorMessage(error);\n services.log.error(message);\n return { success: false, message };\n }\n\n try {\n await services.hooks.runPreRun(ctx, command.meta);\n const result = await command.run(ctx);\n await services.hooks.runPostRun(ctx, command.meta, result);\n return result;\n } catch (error) {\n await services.hooks.runOnError(ctx, command.meta, error);\n return {\n success: false,\n message: ErrorUtils.extractErrorMessage(error),\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"command-runner.js","sourceRoot":"","sources":["../../../src/kernel/command-runner.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAa7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,8EAA8E;AAC9E,+EAA+E;AAC/E,8EAA8E;AAE9E,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,IAAI,EAAE,mBAAmB;IACzB,WAAW;IACX,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,SAAS;CAChB,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAkB;IACrD,OAAO;QACL,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACnC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/D,CAAC;AACJ,CAAC;AAED,MAAM,UA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AM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC3D,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAC1D,OAAO;YACL,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC;SAC/C,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["/**\n * CommandRunner — parse args, extract global flags, run lifecycle hooks, execute command.\n */\n\nimport { Command as CommanderCommand, CommanderError } from 'commander';\nimport { BaseCommand } from './base-command';\nimport type { CommandRegistry } from './command-registry';\nimport type { HookRegistry } from './hooks';\nimport type {\n CommandMeta,\n CommandContext,\n CommandResult,\n Logger,\n CliContext,\n PlatformEnvironmentConfiguration,\n WildoPreferences,\n GlobalFlags,\n} from './types';\nimport { DEFAULT_GLOBAL_FLAGS } from './types';\nimport { createLogger, LoggerHumanLineSink } from './logger';\nimport { commandEmitsDocument } from './json-document-output';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\n\n// ---------------------------------------------------------------------------\n// Global flag extraction — strips global flags before command-specific parsing\n// ---------------------------------------------------------------------------\n\nconst GLOBAL_FLAG_NAMES = new Set([\n '-y', '--non-interactive',\n '--answers',\n '-v', '--verbose',\n '-q', '--quiet',\n]);\n\n/**\n * The inverse of {@link extractGlobalFlags}: the arguments a re-invoked `wildo` must receive to behave\n * like this one. Global flags are parsed from any position, so they may precede the command. Used by\n * every command that runs another `wildo` as a child (`update` re-executing the new CLI, `fwk publish\n * all` running each publish step).\n */\nexport function forwardedGlobalFlags(flags: GlobalFlags): string[] {\n return [\n ...(flags.nonInteractive ? ['-y'] : []),\n ...(flags.verbose ? ['--verbose'] : []),\n ...(flags.quiet ? ['--quiet'] : []),\n ...(flags.answersFile ? ['--answers', flags.answersFile] : []),\n ];\n}\n\nexport function extractGlobalFlags(rawArgs: string[]): { globalFlags: GlobalFlags; commandArgs: string[] } {\n const globalFlags: GlobalFlags = { ...DEFAULT_GLOBAL_FLAGS };\n const commandArgs: string[] = [];\n\n for (let i = 0; i < rawArgs.length; i++) {\n const arg = rawArgs[i];\n\n if (arg === '-y' || arg === '--non-interactive') {\n globalFlags.nonInteractive = true;\n } else if (arg === '--answers' || arg.startsWith('--answers=')) {\n if (arg.startsWith('--answers=')) {\n globalFlags.answersFile = arg.slice('--answers='.length);\n } else {\n const next = rawArgs[i + 1];\n if (!next || next.startsWith('-')) {\n console.error('--answers requires a file path argument.');\n process.exitCode = 1;\n return { globalFlags, commandArgs: [] };\n }\n globalFlags.answersFile = next;\n i++;\n }\n } else if (arg === '-v' || arg === '--verbose') {\n globalFlags.verbose = true;\n } else if (arg === '-q' || arg === '--quiet') {\n globalFlags.quiet = true;\n } else {\n commandArgs.push(arg);\n }\n }\n\n return { globalFlags, commandArgs };\n}\n\n// ---------------------------------------------------------------------------\n// Arg/flag parsing via Commander.js (instantiated per command, not global)\n// ---------------------------------------------------------------------------\n\nexport function parseCommandArgs(\n meta: CommandMeta,\n rawArgs: string[],\n): { flags: Record<string, unknown>; args: Record<string, string | undefined>; helpDisplayed?: boolean } {\n const program = new CommanderCommand();\n program.exitOverride();\n\n for (const [name, def] of Object.entries(meta.flags ?? {})) {\n const flag =\n def.type === 'boolean'\n ? `--${name}`\n : def.type === 'string[]'\n ? `--${name} <value...>`\n : `--${name} <value>`;\n\n if (def.type === 'number') {\n program.option(flag, def.description, (v: string) => Number(v), def.default);\n } else {\n // `string[]` uses Commander's variadic `<value...>` arity: every following\n // space-separated token is collected into an array, so `--units a b c` is\n // not silently truncated to its first token (the rest are no longer\n // swallowed as stray positionals).\n program.option(flag, def.description, def.default as string | boolean | string[] | undefined);\n }\n }\n\n for (const arg of meta.args ?? []) {\n const token = arg.required ? `<${arg.name}>` : `[${arg.name}]`;\n program.argument(token, arg.description);\n }\n\n try {\n program.parse(rawArgs, { from: 'user' });\n } catch (err) {\n if (err instanceof CommanderError) {\n if (err.code === 'commander.helpDisplayed') {\n return { flags: {}, args: {}, helpDisplayed: true };\n }\n throw new Error(`Invalid arguments for '${meta.name}': ${err.message}`);\n }\n throw err;\n }\n\n const flags = program.opts();\n // Commander CAMELIZES multi-word option names in `opts()` (`--register-only` →\n // `registerOnly`), while command code historically reads `ctx.flags['register-only']`.\n // Mirror every declared kebab name onto its camelized value so BOTH spellings are always\n // present — the kebab-only read silently shipped `--register-only` (the #50 guard bypass),\n // `db resolve --rolled-back`, `db generate --accept-planner-contract`,\n // `db diff --update-lockfile` and `registry ping --companion-port` as dead flags. Fixing it\n // HERE is the unbypassable form; per-command dual reads remain harmless.\n for (const name of Object.keys(meta.flags ?? {})) {\n if (!name.includes('-')) continue;\n const camelized = name.replace(/-([a-z0-9])/g, (_, character: string) => character.toUpperCase());\n if (!(name in flags) && camelized in flags) {\n flags[name] = flags[camelized];\n }\n }\n const positionals = program.processedArgs as unknown[];\n const args = mapPositionalArgs(positionals, meta.args);\n\n return { flags, args };\n}\n\nfunction mapPositionalArgs(\n values: unknown[],\n defs?: CommandMeta['args'],\n): Record<string, string | undefined> {\n const result: Record<string, string | undefined> = {};\n if (!defs) return result;\n\n for (let i = 0; i < defs.length; i++) {\n result[defs[i].name] = values[i] != null ? String(values[i]) : undefined;\n }\n return result;\n}\n\n// ---------------------------------------------------------------------------\n// Context builder\n// ---------------------------------------------------------------------------\n\nexport interface CommandRunnerServices {\n hooks: HookRegistry;\n log: Logger;\n /**\n * The logger a `--json` run gets: its human lines go to stderr, so stdout carries the command's\n * document alone (#2068). Defaults to the real one; a test injects its own.\n */\n documentModeLog?: Logger;\n cliContext: CliContext;\n activeEnv: PlatformEnvironmentConfiguration | null;\n preferences: WildoPreferences | null;\n registry?: CommandRegistry;\n}\n\n/**\n * A command's own `--json` means \"stdout is one machine document\" — every command that declares the flag\n * uses it that way (the creation and build console verbs, `context`, `secrets`, `local doctor`, `acp\n * probe`, `market generate`, `workbench status`, `frontend look`). Decided HERE, once, rather than at\n * each verb's branch, because the fifteen verbs that each decided it for themselves all decided it wrong.\n */\n\nfunction buildCommandContext(\n meta: Pick<CommandMeta, 'emitsDocumentOnStdout'>,\n parsedArgs: Record<string, string | undefined>,\n parsedFlags: Record<string, unknown>,\n rawArgs: string[],\n globalFlags: GlobalFlags,\n answers: Record<string, unknown>,\n services: CommandRunnerServices,\n): CommandContext {\n return {\n args: parsedArgs,\n flags: parsedFlags,\n rawArgs,\n globalFlags,\n answers,\n activeEnv: services.activeEnv,\n preferences: services.preferences,\n cliContext: services.cliContext,\n log: commandEmitsDocument(meta, parsedFlags)\n ? (services.documentModeLog ?? createLogger(LoggerHumanLineSink.STDERR))\n : services.log,\n registry: services.registry,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Command runner — lifecycle orchestration\n// ---------------------------------------------------------------------------\n\nexport async function runCommand(\n command: BaseCommand,\n rawArgs: string[],\n globalFlags: GlobalFlags,\n services: CommandRunnerServices,\n): Promise<CommandResult> {\n let ctx: CommandContext;\n\n try {\n const { flags, args, helpDisplayed } = parseCommandArgs(command.meta, rawArgs);\n if (helpDisplayed) {\n return { success: true };\n }\n\n let answers: Record<string, unknown> = {};\n if (globalFlags.answersFile) {\n answers = BaseCommand.loadAnswersFile(globalFlags.answersFile);\n }\n\n ctx = buildCommandContext(command.meta, args, flags, rawArgs, globalFlags, answers, services);\n } catch (error) {\n const message = ErrorUtils.extractErrorMessage(error);\n services.log.error(message);\n return { success: false, message };\n }\n\n try {\n await services.hooks.runPreRun(ctx, command.meta);\n const result = await command.run(ctx);\n await services.hooks.runPostRun(ctx, command.meta, result);\n return result;\n } catch (error) {\n await services.hooks.runOnError(ctx, command.meta, error);\n return {\n success: false,\n message: ErrorUtils.extractErrorMessage(error),\n };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/kernel/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/kernel/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI1E,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AACnF,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3G,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAElG,qBAAa,YAAY;IACvB,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,UAAU,CAAmB;IAErC,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAItC,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAIxC,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IAIhC,SAAS,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAMhE,UAAU,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAMxF,UAAU,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAKxF;AAED,wBAAgB,kBAAkB,IAAI,YAAY,CA6BjD"}
|
package/dist/src/kernel/hooks.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { commandEmitsDocument } from './json-document-output.js';
|
|
1
2
|
import { ErrorUtils } from '../infrastructure/errors/error.utils.js';
|
|
2
3
|
export class HookRegistry {
|
|
3
4
|
preRunHooks = [];
|
|
@@ -43,7 +44,7 @@ export function createBuiltInHooks() {
|
|
|
43
44
|
* "✔ … completed" made it invalid (measured 2026-10-01, `wildo frontend look --json`). A failure
|
|
44
45
|
* still says so, below, on stderr.
|
|
45
46
|
*/
|
|
46
|
-
if (!ctx.globalFlags?.quiet && ctx.flags
|
|
47
|
+
if (!ctx.globalFlags?.quiet && !commandEmitsDocument(meta, ctx.flags ?? {}))
|
|
47
48
|
ctx.log.success(`${meta.name} completed`);
|
|
48
49
|
}
|
|
49
50
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/kernel/hooks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAM1E,MAAM,OAAO,YAAY;IACf,WAAW,GAAiB,EAAE,CAAC;IAC/B,YAAY,GAAkB,EAAE,CAAC;IACjC,UAAU,GAAgB,EAAE,CAAC;IAErC,cAAc,CAAC,IAAgB;QAC7B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,eAAe,CAAC,IAAiB;QAC/B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,eAAe,CAAC,IAAe;QAC7B,IAAI,CAAC,UAAU,CAAC,IAAI,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,CAAC,CAAC;IAEH,QAAQ,CAAC,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QACnD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB;;;;;;eAMG;YACH,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;gBAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,YAAY,CAAC,CAAC;QACzH,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,UAAU,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACrF,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QAClD,MAAM,OAAO,GAAG,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;QACtD,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import type { CommandContext, CommandMeta, CommandResult } from './types';\nimport { commandEmitsDocument } from './json-document-output';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\n\nexport type PreRunHook = (ctx: CommandContext, meta: CommandMeta) => Promise<void>;\nexport type PostRunHook = (ctx: CommandContext, meta: CommandMeta, result: CommandResult) => Promise<void>;\nexport type ErrorHook = (ctx: CommandContext, meta: CommandMeta, error: unknown) => Promise<void>;\n\nexport class HookRegistry {\n private preRunHooks: PreRunHook[] = [];\n private postRunHooks: PostRunHook[] = [];\n private errorHooks: ErrorHook[] = [];\n\n registerPreRun(hook: PreRunHook): void {\n this.preRunHooks.push(hook);\n }\n\n registerPostRun(hook: PostRunHook): void {\n this.postRunHooks.push(hook);\n }\n\n registerOnError(hook: ErrorHook): void {\n this.errorHooks.push(hook);\n }\n\n async runPreRun(ctx: CommandContext, meta: CommandMeta): Promise<void> {\n for (const hook of this.preRunHooks) {\n await hook(ctx, meta);\n }\n }\n\n async runPostRun(ctx: CommandContext, meta: CommandMeta, result: CommandResult): Promise<void> {\n for (const hook of this.postRunHooks) {\n await hook(ctx, meta, result);\n }\n }\n\n async runOnError(ctx: CommandContext, meta: CommandMeta, error: unknown): Promise<void> {\n for (const hook of this.errorHooks) {\n await hook(ctx, meta, error);\n }\n }\n}\n\nexport function createBuiltInHooks(): HookRegistry {\n const registry = new HookRegistry();\n\n // Env resolution is handled by bootstrap (ContextManager.detect + EnvironmentUtils.getCurrent).\n // This preRun hook is a placeholder for future per-command context enrichment.\n registry.registerPreRun(async (_ctx, _meta) => {\n });\n\n registry.registerPostRun(async (ctx, meta, result) => {\n if (result.success) {\n /*\n * Not under --quiet: a command whose stdout is CONSUMED — a Claude Code hook's, whose every line\n * becomes session context (#1657) — must not carry a completion line nobody asked for. Nor under a\n * command's own --json: its stdout is one JSON document for a parser, and a trailing\n * \"✔ … completed\" made it invalid (measured 2026-10-01, `wildo frontend look --json`). A failure\n * still says so, below, on stderr.\n */\n if (!ctx.globalFlags?.quiet && !commandEmitsDocument(meta, ctx.flags ?? {})) ctx.log.success(`${meta.name} completed`);\n } else {\n ctx.log.error(`${meta.name} failed${result.message ? `: ${result.message}` : ''}`);\n }\n });\n\n registry.registerOnError(async (ctx, meta, error) => {\n const message = ErrorUtils.extractErrorMessage(error);\n ctx.log.error(`[${meta.name}] ${message}`);\n });\n\n return registry;\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CommandMeta } from './types';
|
|
1
2
|
/**
|
|
2
3
|
* The one way a command prints a machine-readable document: written to stdout AS IS, never through
|
|
3
4
|
* `ctx.log`. The logger prefixes every line with a glyph (`ℹ`, `✔`), so a document printed through it
|
|
@@ -21,5 +22,11 @@ export declare enum JsonDocumentLayout {
|
|
|
21
22
|
COMPACT = "compact",
|
|
22
23
|
INDENTED = "indented"
|
|
23
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Whether this run's stdout carries a machine document: a `--json` run, or one the command declares
|
|
27
|
+
* (`CommandMeta.emitsDocumentOnStdout`). The runner then gives the command a logger whose human lines go to stderr, and the
|
|
28
|
+
* completion hook prints no "✔ … completed".
|
|
29
|
+
*/
|
|
30
|
+
export declare function commandEmitsDocument(meta: Pick<CommandMeta, 'emitsDocumentOnStdout'>, parsedFlags: Record<string, unknown>): boolean;
|
|
24
31
|
export declare function writeJsonDocument(payload: unknown, layout?: JsonDocumentLayout): void;
|
|
25
32
|
//# sourceMappingURL=json-document-output.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-document-output.d.ts","sourceRoot":"","sources":["../../../src/kernel/json-document-output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;;GAQG;AACH,oBAAY,kBAAkB;IAC5B,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,GAAE,kBAA+C,GAAG,IAAI,CAGjH"}
|
|
1
|
+
{"version":3,"file":"json-document-output.d.ts","sourceRoot":"","sources":["../../../src/kernel/json-document-output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C;;;;;;;;;GASG;AAEH;;;;;;;;GAQG;AACH,oBAAY,kBAAkB;IAC5B,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,uBAAuB,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAEpI;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,GAAE,kBAA+C,GAAG,IAAI,CAGjH"}
|
|
@@ -22,6 +22,14 @@ export var JsonDocumentLayout;
|
|
|
22
22
|
JsonDocumentLayout["COMPACT"] = "compact";
|
|
23
23
|
JsonDocumentLayout["INDENTED"] = "indented";
|
|
24
24
|
})(JsonDocumentLayout || (JsonDocumentLayout = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Whether this run's stdout carries a machine document: a `--json` run, or one the command declares
|
|
27
|
+
* (`CommandMeta.emitsDocumentOnStdout`). The runner then gives the command a logger whose human lines go to stderr, and the
|
|
28
|
+
* completion hook prints no "✔ … completed".
|
|
29
|
+
*/
|
|
30
|
+
export function commandEmitsDocument(meta, parsedFlags) {
|
|
31
|
+
return parsedFlags.json === true || meta.emitsDocumentOnStdout?.(parsedFlags) === true;
|
|
32
|
+
}
|
|
25
33
|
export function writeJsonDocument(payload, layout = JsonDocumentLayout.COMPACT) {
|
|
26
34
|
const text = layout === JsonDocumentLayout.INDENTED ? JSON.stringify(payload, null, 2) : JSON.stringify(payload);
|
|
27
35
|
process.stdout.write(`${text}\n`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-document-output.js","sourceRoot":"","sources":["../../../src/kernel/json-document-output.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"json-document-output.js","sourceRoot":"","sources":["../../../src/kernel/json-document-output.ts"],"names":[],"mappings":"AACA;;;;;;;;;GASG;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,2CAAqB,CAAA;AACvB,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAgD,EAAE,WAAoC;IACzH,OAAO,WAAW,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;AACzF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAgB,EAAE,SAA6B,kBAAkB,CAAC,OAAO;IACzG,MAAM,IAAI,GAAG,MAAM,KAAK,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACjH,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import type { CommandMeta } from './types';\n/**\n * The one way a command prints a machine-readable document: written to stdout AS IS, never through\n * `ctx.log`. The logger prefixes every line with a glyph (`ℹ`, `✔`), so a document printed through it\n * is not JSON. That shipped on fifteen `--json` verbs at once (#2068) — `wildo creation questions\n * --json` printed `ℹ {…}` and the plugin's `answer` / `status` skills read exactly that output.\n *\n * Pairs with the command runner: a run whose `--json` flag is set gets a logger whose human lines go to\n * stderr (`LoggerHumanLineSink.STDERR`), so a note a command logs beside its document cannot land in\n * the middle of it either.\n */\n\n/**\n * How the document is laid out on stdout.\n *\n * - `COMPACT` — one line. The form an agent reads into its context (the creation console verbs), and the\n * only form a stream of events can take: `wildo creation feed --json --follow` prints one document\n * per line.\n * - `INDENTED` — two-space indentation, for a document a person also scans (`wildo context …`,\n * `wildo local doctor --json`). Still exactly one JSON value.\n */\nexport enum JsonDocumentLayout {\n COMPACT = 'compact',\n INDENTED = 'indented',\n}\n\n/**\n * Whether this run's stdout carries a machine document: a `--json` run, or one the command declares\n * (`CommandMeta.emitsDocumentOnStdout`). The runner then gives the command a logger whose human lines go to stderr, and the\n * completion hook prints no \"✔ … completed\".\n */\nexport function commandEmitsDocument(meta: Pick<CommandMeta, 'emitsDocumentOnStdout'>, parsedFlags: Record<string, unknown>): boolean {\n return parsedFlags.json === true || meta.emitsDocumentOnStdout?.(parsedFlags) === true;\n}\n\nexport function writeJsonDocument(payload: unknown, layout: JsonDocumentLayout = JsonDocumentLayout.COMPACT): void {\n const text = layout === JsonDocumentLayout.INDENTED ? JSON.stringify(payload, null, 2) : JSON.stringify(payload);\n process.stdout.write(`${text}\\n`);\n}\n"]}
|
|
@@ -163,6 +163,14 @@ export interface CommandMeta {
|
|
|
163
163
|
flags?: Record<string, FlagDefinition>;
|
|
164
164
|
args?: ArgDefinition[];
|
|
165
165
|
prompts?: PromptDefinition[];
|
|
166
|
+
/**
|
|
167
|
+
* True when this run's stdout carries a machine document other than a `--json` one (for example
|
|
168
|
+
* `providers grant export` writing its grant document to a pipe). The runner then sends the human lines to
|
|
169
|
+
* stderr and the completion hook prints no "✔ … completed", exactly as for `--json`, so stdout holds the
|
|
170
|
+
* document and nothing else. Without it the export's trailing completion line made the piped document
|
|
171
|
+
* unparseable (2026-11-18).
|
|
172
|
+
*/
|
|
173
|
+
emitsDocumentOnStdout?: (flags: Record<string, unknown>) => boolean;
|
|
166
174
|
}
|
|
167
175
|
export interface Logger {
|
|
168
176
|
info: (msg: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/kernel/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,IAAI,iCAAiC,EAAE,MAAM,qDAAqD,CAAC;AACjJ,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,IAAI,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAC/H,OAAO,KAAK,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,KAAK,EAAE,eAAe,IAAI,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC9F,OAAO,EAAE,cA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;IACjB;;;;;;;;;;;;;;;;;;OAkBG;IACH,wCAAqB,CAAA;IACrB;;;;;;;OAOG;IACH,kCAAe,CAAA;IACf;;;;OAIG;IACH,0CAAuB,CAAA;IACvB;;;;;;OAMG;IACH,sCAAmB,CAAA;IACnB,8BAAW,CAAA;IACX;;;;;;;;;;;;;;OAcG;IACH,gCAAa,CAAA;IACb;;;;;OAKG;IACH,0CAAuB,CAAA;AAEzB,CAAC,EApFW,eAAe,KAAf,eAAe,QAoF1B;AA4ED,MAAM,CAAC,MAAM,oBAAoB,GAAgB;IAC/C,cAAc,EAAE,KAAK;IACrB,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,KAAK;CACb,CAAC","sourcesContent":["import type { PlatformEnvironmentConfiguration as _PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport type { WildoMachineDefaults, WildoPreferences as _WildoPreferences } from '~wildo-cli/services/context/context.schemas';\nimport type { CliContext as _CliContext } from '~wildo-cli/services/context/context.schemas';\nimport type { CommandRegistry as _CommandRegistry } from '~wildo-cli/kernel/command-registry';\nimport { WorkspaceScope } from '@wildo-ai/platform-config-lib';\n\nexport type PlatformEnvironmentConfiguration = _PlatformEnvironmentConfiguration;\nexport type WildoPreferences = _WildoPreferences;\n/** Re-exported beside {@link WildoPreferences}: `PromptDefinition.preference` is keyed on it. */\nexport type { WildoMachineDefaults };\nexport type CliContext = _CliContext;\n\n// ---------------------------------------------------------------------------\n// Command category — groups commands by domain and determines scope gating\n// ---------------------------------------------------------------------------\n\nexport enum CommandCategory {\n Core = 'core',\n Local = 'local',\n Remote = 'remote',\n Dev = 'dev',\n Website = 'website',\n Config = 'config',\n Generate = 'generate',\n /**\n * Market — drive the market-generation CLI surface against the application's\n * authored `MarketSnapshot` (Phase 4.2). Commands in this category POST to\n * the dev-companion's market routes and require `WorkspaceScope.SAAS_APP`\n * because they are inherently app-scoped (the snapshot lives in the\n * application's `specifications/` package).\n */\n Market = 'market',\n /**\n * Registry — module-registry workstream. The category covers CLI\n * surfaces that read/write `wildo.saas.config.ts > moduleRegistries`,\n * mutate `wildo-saas.lock.json > sections.modules`, add/update/remove\n * module source from the configured registry server, and publish\n * local modules.\n *\n * Scope split:\n * - SAAS-app verbs (category default `WorkspaceScope.SAAS_APP`):\n * `add`, `update`, `remove`, `publish`, `repair-lockfile`,\n * `lockfile-smoke`. They mutate the SaaS app source / lockfile\n * and require an app workspace.\n * - Workspace-independent verbs (declare\n * `minimumScope: WorkspaceScope.UNINITIALIZED` to override the\n * category default): `login`, `logout`, `whoami`, `info`,\n * `search`, `ping`. They operate against the registry server +\n * per-machine credential store and must run from a fresh install\n * where `~/.wildo/preferences.json` doesn't exist yet.\n */\n Registry = 'registry',\n /**\n * Brand — propagate the accepted brand-asset SSOT (the app's\n * `specifications/src/brand/resolved-assets.generated.ts`) to every frontend\n * destination (app / website / docs public dirs, head refs, config). Runs\n * independently of any generation step (a human may supply the logo), so it\n * requires `WorkspaceScope.SAAS_APP` — the SSOT lives in the application's\n * `specifications/` package.\n */\n Brand = 'brand',\n /**\n * Blueprint — define, pack and publish application blueprints (epic #2856): `wildo blueprint pack` / `status` /\n * `publish`, run in the application that DEFINES a blueprint (`blueprints/<name>/blueprint.definition.ts`). Applying\n * one is `wildo init --blueprint`, a Core command. Requires `WorkspaceScope.SAAS_APP`.\n */\n Blueprint = 'blueprint',\n /**\n * Context — the live-context door (issue #252): read-only queries against the\n * running dev companion's introspection behaviors and journey state, for\n * humans AND for tool-bearing coding/research agents working inside the\n * application. Never a mutation verb — anything that writes belongs in\n * another category by definition.\n */\n Context = 'context',\n Fwk = 'fwk',\n /**\n * Docs — publish and inspect the application's own CUSTOMER technical\n * documentation portal (`technical-doc/src/generated/consumer-documentation`\n * and the API reference beside it).\n *\n * The tree is generated, committed, and was reachable by exactly one door: a\n * hand-called `POST /api/companion/technical-doc/publish-managed`. Nothing in\n * `wildo local dev` published, no command existed, and no CI step ran — so\n * the committed tree went stale silently whenever the engine's content module\n * or the application's specifications changed, and the only way to notice was\n * to diff it (issue #275). This category is that missing door.\n *\n * Distinct from `Fwk`, which serves the FRAMEWORK developer's own knowledge\n * artifacts, and from `Website`, which is the marketing site.\n */\n Docs = 'docs',\n /**\n * Assurance — run the application's assurance cycle (collect, judge, findings, snapshot), print its schedule entry,\n * and read its coverage (#2302). The cycle runs from the framework checkout's `scripts/assurance/` for a dogfood\n * application and from the published `@wildo-ai/assurance-cycle` for every other one, so an application that owns\n * only its own repository can run it. Distinct from `Context`, which reads the dev companion: nothing here needs one.\n */\n Assurance = 'assurance',\n\n}\n\n// ---------------------------------------------------------------------------\n// Flag & Arg definitions — declarative metadata consumed by Commander.js\n// ---------------------------------------------------------------------------\n\nexport interface FlagDefinition {\n /**\n * Flag value kind. `'string[]'` is VARIADIC: Commander collects every\n * following space-separated token into an array (`--units a b c`), and a\n * comma-joined value still works too (`--units a,b,c`) — normalize with\n * `parseCsvFlag` from `~wildo-cli/kernel/flag-utils`. Use it for any flag\n * that legitimately takes multiple values, so extra tokens are captured\n * rather than silently dropped as stray args.\n */\n type: 'boolean' | 'string' | 'number' | 'string[]';\n description: string;\n default?: unknown;\n required?: boolean;\n}\n\nexport interface ArgDefinition {\n name: string;\n description: string;\n required?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Prompt definitions — declarative prompts with automatic CLI flag mapping\n// ---------------------------------------------------------------------------\n\nexport interface PromptChoiceDefinition {\n value: string;\n label: string;\n}\n\nexport interface PromptDefinition {\n /** Unique id — used as key in answer files and as the CLI flag name. */\n id: string;\n type: 'input' | 'select' | 'confirm' | 'password';\n message: string;\n choices?: PromptChoiceDefinition[];\n default?: unknown;\n /**\n * The `~/.wildo/preferences.json` member that ANSWERS this prompt, when the machine states one.\n *\n * Resolution is `flag → answer file → preference → interactive prompt → declared default`, and the\n * position is the whole design. A preference sits BELOW a flag and an answer file, because both of\n * those are explicit inputs to THIS run and must be able to differ; it sits ABOVE the prompt,\n * because its entire purpose is that the question stops being asked. So it means \"stop asking me\",\n * never \"decide for me\" — one application can still differ without the file being edited.\n *\n * Declare it only where the answer is genuinely a property of the MACHINE rather than of the\n * application: the operator's own identity, a posture, a house default. A per-application decision\n * with real consequences (a port block, a name) does not belong here, because a stored answer\n * would silently apply it to an application whose author never considered it.\n */\n preference?: keyof WildoMachineDefaults;\n /**\n * Conditional — prompt is skipped when this returns false.\n * Receives the current CommandContext so decisions can depend on prior answers.\n */\n when?: (ctx: CommandContext) => boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Global flags — available on every command\n// ---------------------------------------------------------------------------\n\nexport interface GlobalFlags {\n nonInteractive: boolean;\n answersFile: string | null;\n verbose: boolean;\n quiet: boolean;\n}\n\nexport const DEFAULT_GLOBAL_FLAGS: GlobalFlags = {\n nonInteractive: false,\n answersFile: null,\n verbose: false,\n quiet: false,\n};\n\n// ---------------------------------------------------------------------------\n// CommandMeta — declarative command descriptor (static per command class)\n// ---------------------------------------------------------------------------\n\nexport interface CommandMeta {\n name: string;\n description: string;\n category: CommandCategory;\n /** Optional stricter scope than the category-wide default. */\n minimumScope?: WorkspaceScope;\n /** Optional command-specific unavailability copy. */\n unavailabilityMessage?: string;\n aliases?: string[];\n hidden?: boolean;\n flags?: Record<string, FlagDefinition>;\n args?: ArgDefinition[];\n prompts?: PromptDefinition[];\n}\n\n// ---------------------------------------------------------------------------\n// Logger — structured console output\n// ---------------------------------------------------------------------------\n\nexport interface Logger {\n info: (msg: string) => void;\n success: (msg: string) => void;\n warn: (msg: string) => void;\n error: (msg: string) => void;\n}\n\n// ---------------------------------------------------------------------------\n// CommandContext — enriched context injected into every command's run()\n// ---------------------------------------------------------------------------\n\nexport interface CommandContext {\n args: Record<string, string | undefined>;\n flags: Record<string, unknown>;\n rawArgs: string[];\n\n globalFlags: GlobalFlags;\n /** Parsed answers from --answers file. Keys = prompt ids. */\n answers: Record<string, unknown>;\n\n activeEnv: PlatformEnvironmentConfiguration | null;\n preferences: WildoPreferences | null;\n cliContext: CliContext;\n\n log: Logger;\n\n /** Available to kernel-level commands (e.g. help) for dynamic command listing. */\n registry?: _CommandRegistry;\n}\n\n// ---------------------------------------------------------------------------\n// CommandResult — returned by command's run()\n// ---------------------------------------------------------------------------\n\nexport interface CommandResult {\n success: boolean;\n message?: string;\n /**\n * The process exit code, when a failure has more than one meaning a caller must branch on — the\n * creation console's convention is 1 = refused or failed, 2 = the companion could not be reached\n * (#1652), so an agent tells \"your request was wrong\" from \"nothing is listening\" without parsing\n * prose. Omitted, a failure exits 1 and a success 0, as before.\n */\n exitCode?: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/kernel/types.ts"],"names":[],"mappings":"AAYA,8EAA8E;AAC9E,2EAA2E;AAC3E,8EAA8E;AAE9E,MAAM,CAAN,IAAY,eAoFX;AApFD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,oCAAiB,CAAA;IACjB,8BAAW,CAAA;IACX,sCAAmB,CAAA;IACnB,oCAAiB,CAAA;IACjB,wCAAqB,CAAA;IACrB;;;;;;OAMG;IACH,oCAAiB,CAAA;IACjB;;;;;;;;;;;;;;;;;;OAkBG;IACH,wCAAqB,CAAA;IACrB;;;;;;;OAOG;IACH,kCAAe,CAAA;IACf;;;;OAIG;IACH,0CAAuB,CAAA;IACvB;;;;;;OAMG;IACH,sCAAmB,CAAA;IACnB,8BAAW,CAAA;IACX;;;;;;;;;;;;;;OAcG;IACH,gCAAa,CAAA;IACb;;;;;OAKG;IACH,0CAAuB,CAAA;AAEzB,CAAC,EApFW,eAAe,KAAf,eAAe,QAoF1B;AA4ED,MAAM,CAAC,MAAM,oBAAoB,GAAgB;IAC/C,cAAc,EAAE,KAAK;IACrB,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,KAAK;CACb,CAAC","sourcesContent":["import type { PlatformEnvironmentConfiguration as _PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport type { WildoMachineDefaults, WildoPreferences as _WildoPreferences } from '~wildo-cli/services/context/context.schemas';\nimport type { CliContext as _CliContext } from '~wildo-cli/services/context/context.schemas';\nimport type { CommandRegistry as _CommandRegistry } from '~wildo-cli/kernel/command-registry';\nimport { WorkspaceScope } from '@wildo-ai/platform-config-lib';\n\nexport type PlatformEnvironmentConfiguration = _PlatformEnvironmentConfiguration;\nexport type WildoPreferences = _WildoPreferences;\n/** Re-exported beside {@link WildoPreferences}: `PromptDefinition.preference` is keyed on it. */\nexport type { WildoMachineDefaults };\nexport type CliContext = _CliContext;\n\n// ---------------------------------------------------------------------------\n// Command category — groups commands by domain and determines scope gating\n// ---------------------------------------------------------------------------\n\nexport enum CommandCategory {\n Core = 'core',\n Local = 'local',\n Remote = 'remote',\n Dev = 'dev',\n Website = 'website',\n Config = 'config',\n Generate = 'generate',\n /**\n * Market — drive the market-generation CLI surface against the application's\n * authored `MarketSnapshot` (Phase 4.2). Commands in this category POST to\n * the dev-companion's market routes and require `WorkspaceScope.SAAS_APP`\n * because they are inherently app-scoped (the snapshot lives in the\n * application's `specifications/` package).\n */\n Market = 'market',\n /**\n * Registry — module-registry workstream. The category covers CLI\n * surfaces that read/write `wildo.saas.config.ts > moduleRegistries`,\n * mutate `wildo-saas.lock.json > sections.modules`, add/update/remove\n * module source from the configured registry server, and publish\n * local modules.\n *\n * Scope split:\n * - SAAS-app verbs (category default `WorkspaceScope.SAAS_APP`):\n * `add`, `update`, `remove`, `publish`, `repair-lockfile`,\n * `lockfile-smoke`. They mutate the SaaS app source / lockfile\n * and require an app workspace.\n * - Workspace-independent verbs (declare\n * `minimumScope: WorkspaceScope.UNINITIALIZED` to override the\n * category default): `login`, `logout`, `whoami`, `info`,\n * `search`, `ping`. They operate against the registry server +\n * per-machine credential store and must run from a fresh install\n * where `~/.wildo/preferences.json` doesn't exist yet.\n */\n Registry = 'registry',\n /**\n * Brand — propagate the accepted brand-asset SSOT (the app's\n * `specifications/src/brand/resolved-assets.generated.ts`) to every frontend\n * destination (app / website / docs public dirs, head refs, config). Runs\n * independently of any generation step (a human may supply the logo), so it\n * requires `WorkspaceScope.SAAS_APP` — the SSOT lives in the application's\n * `specifications/` package.\n */\n Brand = 'brand',\n /**\n * Blueprint — define, pack and publish application blueprints (epic #2856): `wildo blueprint pack` / `status` /\n * `publish`, run in the application that DEFINES a blueprint (`blueprints/<name>/blueprint.definition.ts`). Applying\n * one is `wildo init --blueprint`, a Core command. Requires `WorkspaceScope.SAAS_APP`.\n */\n Blueprint = 'blueprint',\n /**\n * Context — the live-context door (issue #252): read-only queries against the\n * running dev companion's introspection behaviors and journey state, for\n * humans AND for tool-bearing coding/research agents working inside the\n * application. Never a mutation verb — anything that writes belongs in\n * another category by definition.\n */\n Context = 'context',\n Fwk = 'fwk',\n /**\n * Docs — publish and inspect the application's own CUSTOMER technical\n * documentation portal (`technical-doc/src/generated/consumer-documentation`\n * and the API reference beside it).\n *\n * The tree is generated, committed, and was reachable by exactly one door: a\n * hand-called `POST /api/companion/technical-doc/publish-managed`. Nothing in\n * `wildo local dev` published, no command existed, and no CI step ran — so\n * the committed tree went stale silently whenever the engine's content module\n * or the application's specifications changed, and the only way to notice was\n * to diff it (issue #275). This category is that missing door.\n *\n * Distinct from `Fwk`, which serves the FRAMEWORK developer's own knowledge\n * artifacts, and from `Website`, which is the marketing site.\n */\n Docs = 'docs',\n /**\n * Assurance — run the application's assurance cycle (collect, judge, findings, snapshot), print its schedule entry,\n * and read its coverage (#2302). The cycle runs from the framework checkout's `scripts/assurance/` for a dogfood\n * application and from the published `@wildo-ai/assurance-cycle` for every other one, so an application that owns\n * only its own repository can run it. Distinct from `Context`, which reads the dev companion: nothing here needs one.\n */\n Assurance = 'assurance',\n\n}\n\n// ---------------------------------------------------------------------------\n// Flag & Arg definitions — declarative metadata consumed by Commander.js\n// ---------------------------------------------------------------------------\n\nexport interface FlagDefinition {\n /**\n * Flag value kind. `'string[]'` is VARIADIC: Commander collects every\n * following space-separated token into an array (`--units a b c`), and a\n * comma-joined value still works too (`--units a,b,c`) — normalize with\n * `parseCsvFlag` from `~wildo-cli/kernel/flag-utils`. Use it for any flag\n * that legitimately takes multiple values, so extra tokens are captured\n * rather than silently dropped as stray args.\n */\n type: 'boolean' | 'string' | 'number' | 'string[]';\n description: string;\n default?: unknown;\n required?: boolean;\n}\n\nexport interface ArgDefinition {\n name: string;\n description: string;\n required?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Prompt definitions — declarative prompts with automatic CLI flag mapping\n// ---------------------------------------------------------------------------\n\nexport interface PromptChoiceDefinition {\n value: string;\n label: string;\n}\n\nexport interface PromptDefinition {\n /** Unique id — used as key in answer files and as the CLI flag name. */\n id: string;\n type: 'input' | 'select' | 'confirm' | 'password';\n message: string;\n choices?: PromptChoiceDefinition[];\n default?: unknown;\n /**\n * The `~/.wildo/preferences.json` member that ANSWERS this prompt, when the machine states one.\n *\n * Resolution is `flag → answer file → preference → interactive prompt → declared default`, and the\n * position is the whole design. A preference sits BELOW a flag and an answer file, because both of\n * those are explicit inputs to THIS run and must be able to differ; it sits ABOVE the prompt,\n * because its entire purpose is that the question stops being asked. So it means \"stop asking me\",\n * never \"decide for me\" — one application can still differ without the file being edited.\n *\n * Declare it only where the answer is genuinely a property of the MACHINE rather than of the\n * application: the operator's own identity, a posture, a house default. A per-application decision\n * with real consequences (a port block, a name) does not belong here, because a stored answer\n * would silently apply it to an application whose author never considered it.\n */\n preference?: keyof WildoMachineDefaults;\n /**\n * Conditional — prompt is skipped when this returns false.\n * Receives the current CommandContext so decisions can depend on prior answers.\n */\n when?: (ctx: CommandContext) => boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Global flags — available on every command\n// ---------------------------------------------------------------------------\n\nexport interface GlobalFlags {\n nonInteractive: boolean;\n answersFile: string | null;\n verbose: boolean;\n quiet: boolean;\n}\n\nexport const DEFAULT_GLOBAL_FLAGS: GlobalFlags = {\n nonInteractive: false,\n answersFile: null,\n verbose: false,\n quiet: false,\n};\n\n// ---------------------------------------------------------------------------\n// CommandMeta — declarative command descriptor (static per command class)\n// ---------------------------------------------------------------------------\n\nexport interface CommandMeta {\n name: string;\n description: string;\n category: CommandCategory;\n /** Optional stricter scope than the category-wide default. */\n minimumScope?: WorkspaceScope;\n /** Optional command-specific unavailability copy. */\n unavailabilityMessage?: string;\n aliases?: string[];\n hidden?: boolean;\n flags?: Record<string, FlagDefinition>;\n args?: ArgDefinition[];\n prompts?: PromptDefinition[];\n /**\n * True when this run's stdout carries a machine document other than a `--json` one (for example\n * `providers grant export` writing its grant document to a pipe). The runner then sends the human lines to\n * stderr and the completion hook prints no \"✔ … completed\", exactly as for `--json`, so stdout holds the\n * document and nothing else. Without it the export's trailing completion line made the piped document\n * unparseable (2026-11-18).\n */\n emitsDocumentOnStdout?: (flags: Record<string, unknown>) => boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Logger — structured console output\n// ---------------------------------------------------------------------------\n\nexport interface Logger {\n info: (msg: string) => void;\n success: (msg: string) => void;\n warn: (msg: string) => void;\n error: (msg: string) => void;\n}\n\n// ---------------------------------------------------------------------------\n// CommandContext — enriched context injected into every command's run()\n// ---------------------------------------------------------------------------\n\nexport interface CommandContext {\n args: Record<string, string | undefined>;\n flags: Record<string, unknown>;\n rawArgs: string[];\n\n globalFlags: GlobalFlags;\n /** Parsed answers from --answers file. Keys = prompt ids. */\n answers: Record<string, unknown>;\n\n activeEnv: PlatformEnvironmentConfiguration | null;\n preferences: WildoPreferences | null;\n cliContext: CliContext;\n\n log: Logger;\n\n /** Available to kernel-level commands (e.g. help) for dynamic command listing. */\n registry?: _CommandRegistry;\n}\n\n// ---------------------------------------------------------------------------\n// CommandResult — returned by command's run()\n// ---------------------------------------------------------------------------\n\nexport interface CommandResult {\n success: boolean;\n message?: string;\n /**\n * The process exit code, when a failure has more than one meaning a caller must branch on — the\n * creation console's convention is 1 = refused or failed, 2 = the companion could not be reached\n * (#1652), so an agent tells \"your request was wrong\" from \"nothing is listening\" without parsing\n * prose. Omitted, a failure exits 1 and a success 0, as before.\n */\n exitCode?: number;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RuntimeEnvironment } from '@wildo-ai/saas-models';
|
|
2
|
-
import { type AdminAppManagedDeclaration, type AppBootstrapCredentials, type AppBootstrapFirstAdminSeed, type ApplicationBackingServiceAddressing, type ApplicationSigningKeyPromoteRequest, type ApplicationSigningKeyStageRequest, type ApplicationSigningKeyRotationRequest, type ApplicationSigningKeyRotationResponse, type ApplicationSigningKeysStatus, type ApplicationLegacyEnvelopeKeyResponse, type ApplicationLegacyEnvelopeKeyRestoreRequest, type ApplicationLegacyEnvelopeKeyRetirementRequest, type ApplicationLegacyEnvelopeKeyStatus, type KeyringRotationRequest, type KeyringStatus, type RegistryKeyMintRequest, type RegistryKeyListResponse, type RegistryKeyMintResponse, type AdminAppReapplyDeclarationResponse, type ApplicationRuntimePrincipal, DatabaseEngine, AppDatabaseSeedingPhase, AppDatabaseSeedingOutcome, type BackingServiceKind } from '@wildo-ai/platform-config-lib';
|
|
2
|
+
import { type AdminAppManagedDeclaration, type AppBootstrapCredentials, type AppBootstrapFirstAdminSeed, type ApplicationBackingServiceAddressing, type ApplicationSigningKeyPromoteRequest, type ApplicationSigningKeyStageRequest, type ApplicationSigningKeyRotationRequest, type ApplicationSigningKeyRotationResponse, type ApplicationSigningKeysStatus, type ApplicationLegacyEnvelopeKeyResponse, type ApplicationLegacyEnvelopeKeyRestoreRequest, type ApplicationLegacyEnvelopeKeyRetirementRequest, type ApplicationLegacyEnvelopeKeyStatus, type KeyringRotationRequest, type KeyringStatus, type RegistryKeyMintRequest, type RegistryKeyListResponse, type RegistryKeyMintResponse, type AdminAppReapplyDeclarationResponse, type ApplicationScheduledJobsResponse, type ApplicationScheduledJobRunRequest, type ApplicationScheduledJobRunResponse, type ApplicationRuntimePrincipal, DatabaseEngine, AppDatabaseSeedingPhase, AppDatabaseSeedingOutcome, type BackingServiceKind } from '@wildo-ai/platform-config-lib';
|
|
3
3
|
import type { PlatformEnvSecretsJson } from '../../services/credentials/credentials.schemas';
|
|
4
4
|
import type { PlatformEnvConfigJson } from '../../services/credentials/credentials.schemas';
|
|
5
5
|
import type { PlatformEnvironmentConfiguration } from '../../services/environment/environment.schemas';
|
|
@@ -96,9 +96,22 @@ export interface PreparedApplicationEnvTargets {
|
|
|
96
96
|
* existing `.env` files are left untouched.
|
|
97
97
|
*/
|
|
98
98
|
unresolvedPrincipals?: string[];
|
|
99
|
+
/**
|
|
100
|
+
* The runtime endpoints the application's runtimes receive. While a local tunnel is live (#3907) the tunnel's frontend
|
|
101
|
+
* has the public origin as its `publicUrl` and its local origin in `additionalBrowserOrigins`.
|
|
102
|
+
*/
|
|
99
103
|
runtimeEndpoints: Record<string, {
|
|
100
104
|
publicUrl: string;
|
|
101
105
|
internalUrl: string;
|
|
106
|
+
additionalBrowserOrigins?: string[];
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* The same endpoints WITHOUT the tunnel: the companion's. A tunnel coming up or down must never restart the companion
|
|
110
|
+
* under a live run (#3493), and nothing the companion does needs the public origin.
|
|
111
|
+
*/
|
|
112
|
+
companionRuntimeEndpoints: Record<string, {
|
|
113
|
+
publicUrl: string;
|
|
114
|
+
internalUrl: string;
|
|
102
115
|
}>;
|
|
103
116
|
/**
|
|
104
117
|
* The environment resolved during preparation, carried so per-runtime
|
|
@@ -170,6 +183,13 @@ export interface ApplicationDeregistrationResponse {
|
|
|
170
183
|
withdrawnJobs: number;
|
|
171
184
|
deletedExecutions: number;
|
|
172
185
|
revokedCredentials: ApplicationCredentialReportEntry[];
|
|
186
|
+
/**
|
|
187
|
+
* Broker credentials no running broker could revoke (#2303 slice D): minted before the platform moved to a profile that
|
|
188
|
+
* runs no broker. Absent when there are none; each names its remedy.
|
|
189
|
+
*/
|
|
190
|
+
unreachableCredentials?: Array<ApplicationCredentialReportEntry & {
|
|
191
|
+
reason: string;
|
|
192
|
+
}>;
|
|
173
193
|
}
|
|
174
194
|
/** `POST /admin/apps/:appSlug/restore` — the restore and every credential it re-minted. */
|
|
175
195
|
export interface ApplicationRestoreResponse {
|
|
@@ -201,6 +221,12 @@ export declare class AppBootstrapService {
|
|
|
201
221
|
* entry falls back to normal nginx-pod serving (never silently drops a route).
|
|
202
222
|
*/
|
|
203
223
|
private static cdnFrontendKeys;
|
|
224
|
+
/**
|
|
225
|
+
* The runtime endpoints, and the same endpoints with a live local tunnel applied (#3907). Only a LOCAL environment can
|
|
226
|
+
* have a tunnel; a state file whose process is not running is ignored and named, so a crash or a reboot never leaves a
|
|
227
|
+
* dead issuer advertised. See `local-tunnel.service.ts`.
|
|
228
|
+
*/
|
|
229
|
+
private static buildRuntimeEndpointsWithTunnel;
|
|
204
230
|
private static buildRuntimeEndpoints;
|
|
205
231
|
/**
|
|
206
232
|
* serviceHosts-driven ingress routes for the app's public services — the
|
|
@@ -478,6 +504,20 @@ export declare class AppBootstrapService {
|
|
|
478
504
|
static inspectApplicationResidue(env: PlatformEnvironmentConfiguration, credentials: PlatformEnvSecretsJson, input: {
|
|
479
505
|
appSlug: string;
|
|
480
506
|
}): Promise<ApplicationResidueResponse>;
|
|
507
|
+
/**
|
|
508
|
+
* GET /admin/apps/:appSlug/scheduled-jobs (#4006) — the jobs the crontabs manager holds for this application, each with
|
|
509
|
+
* the selector `wildo local jobs run` takes, beside the platform-wide total (an empty list beside a zero total says the
|
|
510
|
+
* scheduler holds nothing for anyone).
|
|
511
|
+
*/
|
|
512
|
+
static listApplicationScheduledJobs(env: PlatformEnvironmentConfiguration, credentials: PlatformEnvSecretsJson, appSlug: string): Promise<ApplicationScheduledJobsResponse>;
|
|
513
|
+
/**
|
|
514
|
+
* POST /admin/apps/:appSlug/scheduled-jobs/run (#4006) — run one of the application's jobs now, once. Not re-sent on a
|
|
515
|
+
* failed answer as the signing-key doors are: a manual trigger carries no occurrence id the crontabs manager could
|
|
516
|
+
* deduplicate by, so a re-send whose first attempt landed would run the job twice. One residual, stated rather than
|
|
517
|
+
* hidden: `fetchWithReconnect` re-sends a request whose connection failed, and a connection that drops AFTER apps-manager
|
|
518
|
+
* forwarded the trigger is such a failure, so that rare case can run the job twice (each run is an audit row).
|
|
519
|
+
*/
|
|
520
|
+
static runApplicationScheduledJob(env: PlatformEnvironmentConfiguration, credentials: PlatformEnvSecretsJson, appSlug: string, request: ApplicationScheduledJobRunRequest): Promise<ApplicationScheduledJobRunResponse>;
|
|
481
521
|
/**
|
|
482
522
|
* POST /admin/apps/:appSlug/deregister
|
|
483
523
|
*
|
|
@@ -557,14 +597,23 @@ export declare class AppBootstrapService {
|
|
|
557
597
|
*/
|
|
558
598
|
private static fetchDeclaredRuntimePrincipalCredentials;
|
|
559
599
|
/**
|
|
560
|
-
*
|
|
600
|
+
* Read an application-authored configuration as the working tree holds it NOW: `wildo.saas.config.ts`, a minion's or
|
|
601
|
+
* a worker's own configuration, the authoritative backend config.
|
|
561
602
|
*
|
|
562
|
-
*
|
|
563
|
-
*
|
|
564
|
-
*
|
|
565
|
-
*
|
|
566
|
-
*
|
|
603
|
+
* Every env-projection read in this service goes through here, and none through a bare `loadConfig`, because jiti's
|
|
604
|
+
* module cache is PROCESS-WIDE: `wildo local dev` regenerates the runtimes' env files in its own long-lived process
|
|
605
|
+
* whenever the declaration changes, and a cached read answers with the file as that process first evaluated it.
|
|
606
|
+
* {@link AppRuntimeTargetsService.resolve} reads the declaration fresh (#3985), so the target, and the identities
|
|
607
|
+
* apps-manager mints from it, already knew a runtime declared later; these builders did not. On reference run
|
|
608
|
+
* 44255624884 five minions and a worker declared after the stack started were minted, then given no `.env`
|
|
609
|
+
* ("0 worker, 0 minion target(s)"), and each minion refused its unset `APPLICATION_ENV` about 150 times.
|
|
610
|
+
*
|
|
611
|
+
* What a fresh read costs depends on how the file's framework imports are evaluated: see
|
|
612
|
+
* {@link RUNTIME_DECLARATION_EVALUATION}, which the declaration and runtime-configuration reads pass. The backend
|
|
613
|
+
* config keeps the loader's own inference (`evaluation` omitted): it may define zod schemas of its own, which is the
|
|
614
|
+
* case that evaluation mode does not cover.
|
|
567
615
|
*/
|
|
616
|
+
private static readAuthoredConfig;
|
|
568
617
|
/**
|
|
569
618
|
* Degraded-mode counterpart of {@link requireRuntimePrincipalCredentials}.
|
|
570
619
|
*
|
|
@@ -577,6 +626,15 @@ export declare class AppBootstrapService {
|
|
|
577
626
|
* the application backend's identity for a principal's.
|
|
578
627
|
*/
|
|
579
628
|
private static resolveRuntimePrincipalCredentialsOrSkip;
|
|
629
|
+
/**
|
|
630
|
+
* A declared runtime's own credentials, or a hard failure.
|
|
631
|
+
*
|
|
632
|
+
* Deliberately NO fallback to `prepared.bootstrapCredentials`. A fallback here
|
|
633
|
+
* would hand the runtime the application backend's identity and the sync would
|
|
634
|
+
* report success — reintroducing F11 silently, at the one seam built to close
|
|
635
|
+
* it. A missing entry means preparation and the declaration disagree, which is
|
|
636
|
+
* a bug to surface, not to paper over.
|
|
637
|
+
*/
|
|
580
638
|
private static requireRuntimePrincipalCredentials;
|
|
581
639
|
static buildApplicationBackendTargets(input: ApplicationEnvProjectionInput): Promise<ApplicationBackendEnvTarget[]>;
|
|
582
640
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-bootstrap.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/app-bootstrap.service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAmB,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAOL,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAE/B,KAAK,mCAAmC,EAYxC,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,EAItC,KAAK,oCAAoC,EACzC,KAAK,qCAAqC,EAC1C,KAAK,4BAA4B,EAQjC,KAAK,oCAAoC,EACzC,KAAK,0CAA0C,EAC/C,KAAK,6CAA6C,EAClD,KAAK,kCAAkC,EAGvC,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAMlB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,kCAAkC,
|
|
1
|
+
{"version":3,"file":"app-bootstrap.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/app-bootstrap.service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAmB,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAOL,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAE/B,KAAK,mCAAmC,EAYxC,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,EAItC,KAAK,oCAAoC,EACzC,KAAK,qCAAqC,EAC1C,KAAK,4BAA4B,EAQjC,KAAK,oCAAoC,EACzC,KAAK,0CAA0C,EAC/C,KAAK,6CAA6C,EAClD,KAAK,kCAAkC,EAGvC,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAMlB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,kCAAkC,EAWvC,KAAK,gCAAgC,EACrC,KAAK,iCAAiC,EACtC,KAAK,kCAAkC,EA4BvC,KAAK,2BAA2B,EAChC,cAAc,EAEd,uBAAuB,EACvB,yBAAyB,EACzB,KAAK,kBAAkB,EACxB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAClG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AACjG,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAE5G,OAAO,KAAK,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,mCAAmC,EACnC,4BAA4B,EAC5B,0BAA0B,EAC1B,0BAA0B,EAE3B,MAAM,qEAAqE,CAAC;AAM7E,OAAO,EAA4B,KAAK,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAiGxG;;;;;;;;;;;;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