@wildo-ai/wildo-cli 1.1.14 → 1.1.15

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.
Files changed (142) hide show
  1. package/dist/src/commands/generate/email-command.utils.d.ts +2 -0
  2. package/dist/src/commands/generate/email-command.utils.d.ts.map +1 -1
  3. package/dist/src/commands/generate/email-command.utils.js +5 -0
  4. package/dist/src/commands/generate/email-command.utils.js.map +1 -1
  5. package/dist/src/commands/init.command.d.ts.map +1 -1
  6. package/dist/src/commands/init.command.js +7 -2
  7. package/dist/src/commands/init.command.js.map +1 -1
  8. package/dist/src/commands/local/deregister.command.d.ts.map +1 -1
  9. package/dist/src/commands/local/deregister.command.js +4 -0
  10. package/dist/src/commands/local/deregister.command.js.map +1 -1
  11. package/dist/src/commands/local/dev.command.d.ts +6 -0
  12. package/dist/src/commands/local/dev.command.d.ts.map +1 -1
  13. package/dist/src/commands/local/dev.command.js +72 -0
  14. package/dist/src/commands/local/dev.command.js.map +1 -1
  15. package/dist/src/commands/local/jobs-command.utils.d.ts +24 -0
  16. package/dist/src/commands/local/jobs-command.utils.d.ts.map +1 -0
  17. package/dist/src/commands/local/jobs-command.utils.js +44 -0
  18. package/dist/src/commands/local/jobs-command.utils.js.map +1 -0
  19. package/dist/src/commands/local/jobs-run.command.d.ts +7 -0
  20. package/dist/src/commands/local/jobs-run.command.d.ts.map +1 -0
  21. package/dist/src/commands/local/jobs-run.command.js +92 -0
  22. package/dist/src/commands/local/jobs-run.command.js.map +1 -0
  23. package/dist/src/commands/local/jobs.command.d.ts +7 -0
  24. package/dist/src/commands/local/jobs.command.d.ts.map +1 -0
  25. package/dist/src/commands/local/jobs.command.js +59 -0
  26. package/dist/src/commands/local/jobs.command.js.map +1 -0
  27. package/dist/src/commands/local/tunnel.command.d.ts +84 -0
  28. package/dist/src/commands/local/tunnel.command.d.ts.map +1 -0
  29. package/dist/src/commands/local/tunnel.command.js +274 -0
  30. package/dist/src/commands/local/tunnel.command.js.map +1 -0
  31. package/dist/src/services/application/app-bootstrap.service.d.ts +41 -1
  32. package/dist/src/services/application/app-bootstrap.service.d.ts.map +1 -1
  33. package/dist/src/services/application/app-bootstrap.service.js +49 -3
  34. package/dist/src/services/application/app-bootstrap.service.js.map +1 -1
  35. package/dist/src/services/application/app-runtime-targets.service.d.ts.map +1 -1
  36. package/dist/src/services/application/app-runtime-targets.service.js +9 -1
  37. package/dist/src/services/application/app-runtime-targets.service.js.map +1 -1
  38. package/dist/src/services/application/application-dependency-alignment.service.d.ts +20 -0
  39. package/dist/src/services/application/application-dependency-alignment.service.d.ts.map +1 -1
  40. package/dist/src/services/application/application-dependency-alignment.service.js +32 -2
  41. package/dist/src/services/application/application-dependency-alignment.service.js.map +1 -1
  42. package/dist/src/services/application/local-tunnel.service.d.ts +153 -0
  43. package/dist/src/services/application/local-tunnel.service.d.ts.map +1 -0
  44. package/dist/src/services/application/local-tunnel.service.js +294 -0
  45. package/dist/src/services/application/local-tunnel.service.js.map +1 -0
  46. package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
  47. package/dist/src/services/application/provider-runtime-sync.service.js +3 -0
  48. package/dist/src/services/application/provider-runtime-sync.service.js.map +1 -1
  49. package/dist/src/services/application/saas-skeleton.service.d.ts +7 -0
  50. package/dist/src/services/application/saas-skeleton.service.d.ts.map +1 -1
  51. package/dist/src/services/application/saas-skeleton.service.js +2 -0
  52. package/dist/src/services/application/saas-skeleton.service.js.map +1 -1
  53. package/dist/src/services/catalog/service-address-resolver.service.d.ts +7 -1
  54. package/dist/src/services/catalog/service-address-resolver.service.d.ts.map +1 -1
  55. package/dist/src/services/catalog/service-address-resolver.service.js +6 -3
  56. package/dist/src/services/catalog/service-address-resolver.service.js.map +1 -1
  57. package/dist/src/services/credentials/application-secrets.service.d.ts +6 -0
  58. package/dist/src/services/credentials/application-secrets.service.d.ts.map +1 -1
  59. package/dist/src/services/credentials/application-secrets.service.js +1 -1
  60. package/dist/src/services/credentials/application-secrets.service.js.map +1 -1
  61. package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
  62. package/dist/src/services/credentials/provider-env-vars.utils.js +3 -1
  63. package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
  64. package/dist/src/services/credentials/secrets-writer.service.d.ts +11 -2
  65. package/dist/src/services/credentials/secrets-writer.service.d.ts.map +1 -1
  66. package/dist/src/services/credentials/secrets-writer.service.js +12 -3
  67. package/dist/src/services/credentials/secrets-writer.service.js.map +1 -1
  68. package/dist/src/services/deployment/ci-deploy-generator.service.d.ts.map +1 -1
  69. package/dist/src/services/deployment/ci-deploy-generator.service.js +3 -3
  70. package/dist/src/services/deployment/ci-deploy-generator.service.js.map +1 -1
  71. package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts +3 -3
  72. package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
  73. package/dist/src/services/deployment/docker/docker-compose-generator.service.js +16 -12
  74. package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
  75. package/dist/src/services/deployment/framework-pod-network-membership.d.ts +6 -0
  76. package/dist/src/services/deployment/framework-pod-network-membership.d.ts.map +1 -1
  77. package/dist/src/services/deployment/framework-pod-network-membership.js +12 -3
  78. package/dist/src/services/deployment/framework-pod-network-membership.js.map +1 -1
  79. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts +4 -1
  80. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts.map +1 -1
  81. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js +17 -7
  82. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js.map +1 -1
  83. package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts +7 -0
  84. package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts.map +1 -1
  85. package/dist/src/services/deployment/k8s/k8s-manifest.schemas.js.map +1 -1
  86. package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.d.ts.map +1 -1
  87. package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js +15 -9
  88. package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js.map +1 -1
  89. package/dist/src/services/deployment/k8s/kind-pod-host-gateway.d.ts +43 -0
  90. package/dist/src/services/deployment/k8s/kind-pod-host-gateway.d.ts.map +1 -0
  91. package/dist/src/services/deployment/k8s/kind-pod-host-gateway.js +12 -0
  92. package/dist/src/services/deployment/k8s/kind-pod-host-gateway.js.map +1 -0
  93. package/dist/src/services/deployment/k8s/off-cluster-backing-services.d.ts +3 -1
  94. package/dist/src/services/deployment/k8s/off-cluster-backing-services.d.ts.map +1 -1
  95. package/dist/src/services/deployment/k8s/off-cluster-backing-services.js.map +1 -1
  96. package/dist/src/services/deployment/local-dev-late-workspace-members.service.d.ts +124 -0
  97. package/dist/src/services/deployment/local-dev-late-workspace-members.service.d.ts.map +1 -0
  98. package/dist/src/services/deployment/local-dev-late-workspace-members.service.js +249 -0
  99. package/dist/src/services/deployment/local-dev-late-workspace-members.service.js.map +1 -0
  100. package/dist/src/services/environment/authored-infra-config.utils.d.ts +9 -0
  101. package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
  102. package/dist/src/services/environment/authored-infra-config.utils.js +20 -1
  103. package/dist/src/services/environment/authored-infra-config.utils.js.map +1 -1
  104. package/dist/src/services/environment/container-host-gateway-listen-host.d.ts +6 -0
  105. package/dist/src/services/environment/container-host-gateway-listen-host.d.ts.map +1 -1
  106. package/dist/src/services/environment/container-host-gateway-listen-host.js +6 -0
  107. package/dist/src/services/environment/container-host-gateway-listen-host.js.map +1 -1
  108. package/dist/src/services/environment/env-configuration-generator.service.d.ts +12 -0
  109. package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
  110. package/dist/src/services/environment/env-configuration-generator.service.js +37 -5
  111. package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
  112. package/dist/src/services/environment/env-vars-builder.service.d.ts +2 -1
  113. package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
  114. package/dist/src/services/environment/env-vars-builder.service.js +47 -32
  115. package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
  116. package/dist/src/services/environment/environment-lifecycle.service.d.ts +7 -4
  117. package/dist/src/services/environment/environment-lifecycle.service.d.ts.map +1 -1
  118. package/dist/src/services/environment/environment-lifecycle.service.js +14 -18
  119. package/dist/src/services/environment/environment-lifecycle.service.js.map +1 -1
  120. package/dist/src/services/environment/environment-setup.service.d.ts.map +1 -1
  121. package/dist/src/services/environment/environment-setup.service.js +17 -6
  122. package/dist/src/services/environment/environment-setup.service.js.map +1 -1
  123. package/dist/src/services/environment/environment.service.d.ts +4 -3
  124. package/dist/src/services/environment/environment.service.d.ts.map +1 -1
  125. package/dist/src/services/environment/environment.service.js +0 -1
  126. package/dist/src/services/environment/environment.service.js.map +1 -1
  127. package/dist/src/services/framework/framework-docker-publish.service.d.ts +55 -15
  128. package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
  129. package/dist/src/services/framework/framework-docker-publish.service.js +115 -25
  130. package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
  131. package/dist/src/services/security/csp-sync.service.d.ts.map +1 -1
  132. package/dist/src/services/security/csp-sync.service.js +21 -2
  133. package/dist/src/services/security/csp-sync.service.js.map +1 -1
  134. package/dist/tsconfig.build.tsbuildinfo +1 -1
  135. package/package.json +19 -19
  136. package/templates/infra/docker-compose/docker-compose.wildo-platform.yml.hbs +14 -7
  137. package/templates/infra/k8s/platform/platform-crontabs-batches-manager/deployment.yaml.hbs +13 -0
  138. package/templates/saas/skeleton/.wildo-saas/wildo-dev-companion/scripts/dev-supervised.sh +18 -4
  139. package/templates/saas/skeleton/frontend/nginx-config/default.conf.hbs +1 -1
  140. package/templates/saas/skeleton/frontend/src/generated/csp.generated.json.hbs +4 -4
  141. package/templates/saas/skeleton/infrastructure/local/wildo.infra.local.config.ts.hbs +2 -0
  142. package/wildo-framework.info.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"service-address-resolver.service.js","sourceRoot":"","sources":["../../../../src/services/catalog/service-address-resolver.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yDAAyD,CAAC;AAC/F,OAAO,EAGL,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,0DAA0D,CAAC;AACxF,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,qDAAqD,CAAC;AAG7D,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,iDAA2B,CAAA;IAC3B,+DAAyC,CAAA;AAC3C,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AA+FD,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,SAAS,YAAY,CAAC,IAAY,EAAE,IAAY;IAC9C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;AACvD,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAS,aAAa,CAAC,QAA4B;IACjD,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC;QACzC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,C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EAAE,CAAC;wBAClD,MAAM,IAAI,GAAG,GAAG,WAAW,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC;wBAClD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,IAAI,EAAE,EAAE,CAAC;oBACrD,CAAC;oBACD,OAAO,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;gBAC1C,CAAC;gBACD,OAAO,YAAY,CAAC,oBAAoB,CAAC,WAAW,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC;YAE9E,OAAO,CAAC,CAAC,CAAC;gBACR,MAAM,WAAW,GAAU,GAAG,CAAC,OAAO,CAAC;gBACvC,MAAM,IAAI,KAAK,CAAC,2BAA2B,WAAW,EAAE,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["import { PlatformDataServices } from '~wildo-cli/services/data-services/data-services.schemas';\nimport {\n type BackingServiceEnvConfig,\n type BackingServicesEnvConfig,\n BackingServiceKind,\n BackingServiceSource,\n K8S_LOCAL_DEFAULTS,\n PUBLIC_DOMAIN_DEFAULTS,\n PlatformWildoServices,\n WildoLocationType,\n WildoDeploymentRuntime,\n buildK8sInternalHost,\n} from '@wildo-ai/platform-config-lib';\nimport { DEFAULT_HOST } from '~wildo-cli/services/environment/platform-runtime.schemas';\nimport {\n INFRA_SERVICE_CATALOG,\n PLATFORM_SERVICE_CATALOG,\n resolveContainerInternalAlias,\n} from '~wildo-cli/services/catalog/service-catalog.schemas';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\n\n// ============================================================================\n// Enums & Interfaces\n// ============================================================================\n\nexport enum AddressPerspective {\n HOST_FACING = 'host-facing',\n CONTAINER_INTERNAL = 'container-internal',\n}\n\nexport interface ServiceAddressContext {\n runtime: WildoDeploymentRuntime;\n locationType: WildoLocationType;\n perspective: AddressPerspective;\n namespace: string;\n /**\n * Public domain (`WildoInfraEnvConfig.publicDomain`) — the\n * runtime-agnostic external hostname browsers and reverse proxies\n * resolve. Used here only for K8s-remote host-facing addressing\n * (`https://<service>.<publicDomain>`); compose host-facing keeps\n * its `localhost` shape because operators typically don't put a\n * reverse proxy in front of local compose runs.\n */\n publicDomain: string;\n databaseSource: BackingServiceSource;\n /**\n * Authored backing-services snapshot (mirrored from\n * `wildo.infra.<env>.config.ts`). When present, per-service overrides\n * win over catalog defaults. Missing services keep catalog-driven topology.\n *\n * Override precedence per perspective:\n * - HOST_FACING: author `host` and `port` win.\n * - CONTAINER_INTERNAL (compose / K8s):\n * * container name stays canonical (catalog `containerName` /\n * `<service>.<namespace>.svc.cluster.local`) — that is the only\n * address the container network can resolve.\n * * port: author `port` wins for self-deployed services because the\n * generated docker-compose maps host port `port:port` (compose-side\n * binds match the container-listen port). For MANAGED/EXTERNAL\n * sources the author `host`/`port` are canonical for both\n * perspectives — catalog defaults never apply.\n */\n backingServices?: BackingServicesEnvConfig;\n}\n\nexport interface ResolvedServiceAddress {\n host: string;\n port: number;\n url: string;\n}\n\n/**\n * All fields are nullable: `mongodb` is null when Atlas (no local instance),\n * and ALL fields are null for K8s remote + HOST_FACING (no direct host access\n * to cluster-internal infra — use CONTAINER_INTERNAL perspective instead).\n */\nexport interface ResolvedInfraAddresses {\n mongodb: ResolvedServiceAddress | null;\n valkey: ResolvedServiceAddress | null;\n rabbitmq: ResolvedServiceAddress | null;\n rabbitmqManagement: ResolvedServiceAddress | null;\n minio: ResolvedServiceAddress | null;\n postgresql: ResolvedServiceAddress | null;\n /**\n * The ClamAV daemon an application backend submits uploads and received attachments to (#1910). Resolved like every\n * other backing service — `localhost` + the published port for a host-run process, the data-network alias for a\n * container — so a host-run dev backend reaches the same `clamav` container a containerised one does.\n */\n clamav: ResolvedServiceAddress | null;\n /**\n * The self-hosted immudb server apps-manager administers (#1696): it logs in there as the sysadmin to give each\n * application its own database and user. Resolved like every other backing service, so a host-run apps-manager and\n * a containerised one both reach the `immudb` container. Applications reach immudb through their own provider\n * address (`IMMUDB_HOST`), not through this.\n */\n immudb: ResolvedServiceAddress | null;\n /**\n * The self-hosted OpenBao holding the platform's custodied keys (#2933). apps-manager is its only client, host-run\n * in local development and containerised otherwise, so it resolves like `immudb`. Whether one runs at all is\n * `selfHostsPlatformKeyVault`; this address is meaningful only then.\n */\n openbao: ResolvedServiceAddress | null;\n}\n\nexport interface ResolvedPlatformAddresses {\n appsManager: ResolvedServiceAddress;\n crontabsBatchesManager: ResolvedServiceAddress;\n /**\n * Module-registry endpoint. Required by\n * `ApplicationEnvConfigurationSchema.PLATFORM_MODULE_REGISTRY_URL`\n * (engine `app-env-config.backend.schemas.ts`). Without this, every\n * application backend fails Zod env-validation at startup with\n * \"Invalid input: expected string, received undefined\" on\n * `PLATFORM_MODULE_REGISTRY_URL`.\n */\n moduleRegistry: ResolvedServiceAddress;\n}\n\nexport interface ResolvedAddresses {\n infra: ResolvedInfraAddresses;\n platform: ResolvedPlatformAddresses;\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\nfunction buildAddress(host: string, port: number): ResolvedServiceAddress {\n return { host, port, url: `http://${host}:${port}` };\n}\n\n/**\n * Parse an authored S3-style endpoint (e.g. `http://localhost:9000`) into\n * its host/port parts. Returns `null` for malformed values so the\n * resolver can fall back to the per-field overrides (`s3.host` / `s3.port`)\n * or catalog defaults without throwing during topology resolution.\n *\n * The scheme (`http`/`https`) is intentionally NOT returned. The address\n * resolver constructs URLs with a hardcoded `http://` scheme today (see\n * `buildAddress`), so threading `useSsl` here would be a dead field that\n * lies about the resolver contract. If/when scheme propagation becomes\n * a real requirement, the `buildAddress` helper and downstream consumers\n * must be updated together — this signature change is the gate.\n */\nfunction parseEndpoint(endpoint: string | undefined): { host: string; port: number } | null {\n if (!endpoint) return null;\n try {\n const url = new URL(endpoint);\n const useSsl = url.protocol === 'https:';\n const port = url.port ? Number(url.port) : useSsl ? 443 : 80;\n if (!url.hostname || Number.isNaN(port)) return null;\n return { host: url.hostname, port };\n } catch {\n return null;\n }\n}\n\n/**\n * Resolve a host/port pair given an authored backing-service entry, the\n * catalog-driven defaults for that service, and the current perspective.\n *\n * The semantic model:\n * - For `BackingServiceSource.SELF` (we deploy the container): the catalog\n * container name is canonical for `CONTAINER_INTERNAL` because that is\n * the only DNS name the container network knows. Authored `host` only\n * applies to `HOST_FACING` (host-side dev tools). Authored `port` applies\n * to BOTH because the docker-compose generator maps `port:port`.\n * - For `BackingServiceSource.MANAGED`: the service is not in our\n * compose/K8s topology, so authored `host`/`port` are the only\n * canonical address for both perspectives. **Mongo-on-managed\n * special case**: when the brand is `'atlas'` (or any future\n * external-URL Mongo brand), callers detect this via\n * `addresses.infra.mongodb === null` (the resolver short-circuits\n * for managed Mongo at line 273) and read the connection URL from\n * secrets; this helper is not invoked for that branch. Slice\n * 4.B.0 (2026-05-07) replaced the prior `source: ATLAS` enum\n * value with `(source: MANAGED, provider: 'atlas')`.\n */\nfunction resolveOverriddenAddress(\n override: BackingServiceEnvConfig | undefined,\n fallback: { host: string; port: number },\n perspective: AddressPerspective,\n): { host: string; port: number } {\n if (!override) return fallback;\n const isManaged = override.source !== BackingServiceSource.SELF;\n\n if (isManaged) {\n return {\n host: override.host ?? fallback.host,\n port: override.port ?? fallback.port,\n };\n }\n\n if (perspective === AddressPerspective.HOST_FACING) {\n return {\n host: override.host ?? fallback.host,\n port: override.port ?? fallback.port,\n };\n }\n\n return {\n host: fallback.host,\n port: override.port ?? fallback.port,\n };\n}\n\n// ============================================================================\n// Resolver\n// ============================================================================\n\nexport class ServiceAddressResolver {\n static resolve(context: ServiceAddressContext): ResolvedAddresses {\n return {\n infra: ServiceAddressResolver.resolveInfra(context),\n platform: ServiceAddressResolver.resolvePlatform(context),\n };\n }\n\n static fromEnvironment(\n env: PlatformEnvironmentConfiguration,\n perspective: AddressPerspective,\n ): ServiceAddressContext {\n const isRemoteKubernetes =\n env.runtime === WildoDeploymentRuntime.KUBERNETES\n && env.locationType === WildoLocationType.REMOTE;\n const namespace = env.kubernetes?.namespace ?? (isRemoteKubernetes ? undefined : K8S_LOCAL_DEFAULTS.NAMESPACE);\n // `publicDomain` is a required top-level field on\n // `PlatformEnvironmentConfiguration` (mirrored from the schema's\n // required `WildoInfraEnvConfig.publicDomain`), but the default\n // `PUBLIC_DOMAIN_DEFAULTS.LOCAL_K8S` is kept as a defensive\n // belt-and-braces fallback for the local path so a hand-edited\n // hydrated config that drops the field still works for local\n // K8s development. Remote Kubernetes paths ALWAYS require an\n // explicitly authored value — there is no remote default.\n const publicDomain = env.publicDomain\n ?? (isRemoteKubernetes ? undefined : PUBLIC_DOMAIN_DEFAULTS.LOCAL_K8S);\n\n if (!namespace || !publicDomain) {\n throw new Error(\n `Environment '${env.name}' is missing explicit Kubernetes namespace or top-level publicDomain metadata.`,\n );\n }\n\n return {\n runtime: env.runtime,\n locationType: env.locationType,\n perspective,\n namespace,\n publicDomain,\n databaseSource: env.database.source ?? BackingServiceSource.SELF,\n backingServices: env.backingServices,\n };\n }\n\n // --------------------------------------------------------------------------\n // Infrastructure services\n // --------------------------------------------------------------------------\n\n private static resolveInfra(ctx: ServiceAddressContext): ResolvedInfraAddresses {\n const isK8sRemoteHostFacing =\n ctx.runtime === WildoDeploymentRuntime.KUBERNETES\n && ctx.locationType === WildoLocationType.REMOTE\n && ctx.perspective === AddressPerspective.HOST_FACING;\n\n if (isK8sRemoteHostFacing) {\n return {\n mongodb: null,\n valkey: null,\n rabbitmq: null,\n rabbitmqManagement: null,\n minio: null,\n postgresql: null,\n clamav: null,\n immudb: null,\n openbao: null,\n };\n }\n\n const mongoCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.MONGODB];\n const valkeyCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.VALKEY];\n const rabbitmqCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.RABBITMQ];\n const minioCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.MINIO];\n const pgCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.POSTGRESQL];\n const clamavCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.CLAMAV];\n const immudbCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.IMMUDB];\n const openbaoCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.OPENBAO];\n\n const mongoOverride = ctx.backingServices?.[BackingServiceKind.MONGODB];\n const redisOverride = ctx.backingServices?.[BackingServiceKind.REDIS];\n const rabbitOverride = ctx.backingServices?.[BackingServiceKind.RABBITMQ];\n const s3Override = ctx.backingServices?.[BackingServiceKind.S3];\n const pgOverride = ctx.backingServices?.[BackingServiceKind.POSTGRESQL];\n const clamavOverride = ctx.backingServices?.[BackingServiceKind.CLAMAV];\n const immudbOverride = ctx.backingServices?.[BackingServiceKind.IMMUDB];\n\n const s3EndpointParsed = parseEndpoint(s3Override?.endpoint);\n const s3OverrideMerged: BackingServiceEnvConfig | undefined = s3Override\n ? {\n ...s3Override,\n host: s3Override.host ?? s3EndpointParsed?.host,\n port: s3Override.port ?? s3EndpointParsed?.port,\n }\n : undefined;\n\n // Slice 4.B.0 (2026-05-07): the legacy `source: ATLAS` was the only\n // managed-Mongo enum value, so it stood in for \"any managed Mongo\n // — let the external service's connection URL handle it; we don't\n // need to resolve a local container address\". Post-reshape, the\n // same logic applies to every managed-Mongo brand (Atlas, future\n // DocumentDB, etc.) → loosen to the broader source check.\n const mongodb =\n ctx.databaseSource === BackingServiceSource.MANAGED\n ? null\n : ServiceAddressResolver.resolveInfraService(\n ctx,\n mongoCatalog.containerName,\n mongoCatalog.defaultPort,\n mongoCatalog.defaultPort,\n mongoOverride,\n );\n\n return {\n mongodb,\n valkey: ServiceAddressResolver.resolveInfraService(\n ctx, valkeyCatalog.containerName, valkeyCatalog.defaultPort, valkeyCatalog.defaultPort, redisOverride,\n ),\n rabbitmq: ServiceAddressResolver.resolveInfraService(\n ctx, rabbitmqCatalog.containerName, rabbitmqCatalog.defaultPort, rabbitmqCatalog.defaultPort, rabbitOverride,\n ),\n rabbitmqManagement: ServiceAddressResolver.resolveInfraService(\n ctx,\n rabbitmqCatalog.containerName,\n rabbitmqCatalog.additionalPorts!.management,\n rabbitmqCatalog.additionalPorts!.management,\n // The management UI rides on the same RabbitMQ container; we only\n // honor the authored host (HOST_FACING) — the management port itself\n // is image-defined and not part of the author surface today.\n rabbitOverride\n ? { ...rabbitOverride, port: undefined }\n : undefined,\n ),\n minio: ServiceAddressResolver.resolveInfraService(\n ctx, minioCatalog.containerName, minioCatalog.defaultPort, minioCatalog.defaultPort, s3OverrideMerged,\n ),\n postgresql: ServiceAddressResolver.resolveInfraService(\n ctx, pgCatalog.containerName, pgCatalog.defaultPort, pgCatalog.defaultPort, pgOverride,\n ),\n clamav: ServiceAddressResolver.resolveInfraService(\n ctx, clamavCatalog.containerName, clamavCatalog.defaultPort, clamavCatalog.defaultPort, clamavOverride,\n ),\n immudb: ServiceAddressResolver.resolveInfraService(\n ctx, immudbCatalog.containerName, immudbCatalog.defaultPort, immudbCatalog.defaultPort, immudbOverride,\n ),\n // No authored override: the platform's own Vault is not a backing service an environment addresses.\n openbao: ServiceAddressResolver.resolveInfraService(\n ctx, openbaoCatalog.containerName, openbaoCatalog.defaultPort, openbaoCatalog.defaultPort, undefined,\n ),\n };\n }\n\n /**\n * @param hostFacingPort Port exposed on the host (mapped port)\n * @param internalPort Port inside the container\n * @param override Optional authored backing-service entry; honored\n * per the precedence rules in `ServiceAddressContext.backingServices`.\n */\n private static resolveInfraService(\n ctx: ServiceAddressContext,\n serviceName: string,\n hostFacingPort: number,\n internalPort: number,\n override: BackingServiceEnvConfig | undefined,\n ): ResolvedServiceAddress {\n const isHostFacing = ctx.perspective === AddressPerspective.HOST_FACING;\n\n switch (ctx.runtime) {\n case WildoDeploymentRuntime.DOCKER_COMPOSE: {\n /*\n * A container dials the data-network ALIAS, never the bare service name.\n *\n * Both ends of this call are attached to `wildo-host-access`, the publish\n * bridge, which is created with ICC disabled — so the service name resolves\n * to an address that is deliberately unreachable, and the caller times out\n * against a service that is up. The alias is registered on the data segment\n * only, so it cannot resolve to the blocked bridge.\n *\n * @see CONTAINER_INTERNAL_ALIAS_SUFFIX for the measurement.\n *\n * HOST_FACING is untouched: a host process reaches the published port on\n * localhost and never consults Docker DNS.\n */\n const fallbackHost = isHostFacing ? DEFAULT_HOST : resolveContainerInternalAlias(serviceName);\n const fallbackPort = isHostFacing ? hostFacingPort : internalPort;\n const { host, port } = resolveOverriddenAddress(\n override,\n { host: fallbackHost, port: fallbackPort },\n ctx.perspective,\n );\n return buildAddress(host, port);\n }\n\n case WildoDeploymentRuntime.KUBERNETES: {\n if (ctx.locationType === WildoLocationType.LOCAL && isHostFacing) {\n const { host, port } = resolveOverriddenAddress(\n override,\n { host: DEFAULT_HOST, port: hostFacingPort },\n ctx.perspective,\n );\n return buildAddress(host, port);\n }\n const fallbackHost = buildK8sInternalHost(serviceName, ctx.namespace);\n const { host, port } = resolveOverriddenAddress(\n override,\n { host: fallbackHost, port: internalPort },\n ctx.perspective,\n );\n return buildAddress(host, port);\n }\n\n default: {\n const _exhaustive: never = ctx.runtime;\n throw new Error(`Unhandled runtime mode: ${_exhaustive}`);\n }\n }\n }\n\n // --------------------------------------------------------------------------\n // Platform (Wildo) services\n // --------------------------------------------------------------------------\n\n private static resolvePlatform(ctx: ServiceAddressContext): ResolvedPlatformAddresses {\n return {\n appsManager: ServiceAddressResolver.resolvePlatformService(ctx, PlatformWildoServices.APPS_MANAGER),\n crontabsBatchesManager: ServiceAddressResolver.resolvePlatformService(ctx, PlatformWildoServices.CRONTABS_BATCHES_MANAGER),\n moduleRegistry: ServiceAddressResolver.resolvePlatformService(ctx, PlatformWildoServices.MODULE_REGISTRY),\n };\n }\n\n private static resolvePlatformService(\n ctx: ServiceAddressContext,\n service: Exclude<PlatformWildoServices, PlatformWildoServices.PLATFORM_INIT>,\n ): ResolvedServiceAddress {\n const catalogEntry = PLATFORM_SERVICE_CATALOG[service];\n const port = catalogEntry.defaultPort;\n const serviceName = catalogEntry.containerName;\n const isHostFacing = ctx.perspective === AddressPerspective.HOST_FACING;\n\n switch (ctx.runtime) {\n case WildoDeploymentRuntime.DOCKER_COMPOSE:\n /*\n * Same alias rule as the infra branch, for the same reason: every platform\n * service declares `ports:` and is therefore on the ICC-disabled publish\n * bridge alongside the platform service it is calling.\n * @see CONTAINER_INTERNAL_ALIAS_SUFFIX\n */\n return isHostFacing\n ? buildAddress(DEFAULT_HOST, port)\n : buildAddress(resolveContainerInternalAlias(serviceName), port);\n\n case WildoDeploymentRuntime.KUBERNETES:\n if (isHostFacing) {\n if (ctx.locationType === WildoLocationType.REMOTE) {\n const host = `${serviceName}.${ctx.publicDomain}`;\n return { host, port: 443, url: `https://${host}` };\n }\n return buildAddress(DEFAULT_HOST, port);\n }\n return buildAddress(buildK8sInternalHost(serviceName, ctx.namespace), port);\n\n default: {\n const _exhaustive: never = ctx.runtime;\n throw new Error(`Unhandled runtime mode: ${_exhaustive}`);\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"service-address-resolver.service.js","sourceRoot":"","sources":["../../../../src/services/catalog/service-address-resolver.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yDAAyD,CAAC;AAC/F,OAAO,EAGL,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,0CAA0C,GAE3C,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,0DAA0D,CAAC;AACxF,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,qDAAqD,CAAC;AAG7D,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,iDAA2B,CAAA;IAC3B,+DAAyC,CAAA;AAC3C,CAAC,EAHW,kBAAkB,KAAlB,kBA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,CAAC,CAAC;gBACR,MAAM,WAAW,GAAU,GAAG,CAAC,OAAO,CAAC;gBACvC,MAAM,IAAI,KAAK,CAAC,2BAA2B,WAAW,EAAE,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["import { PlatformDataServices } from '~wildo-cli/services/data-services/data-services.schemas';\nimport {\n type BackingServiceEnvConfig,\n type BackingServicesEnvConfig,\n BackingServiceKind,\n BackingServiceSource,\n K8S_LOCAL_DEFAULTS,\n PUBLIC_DOMAIN_DEFAULTS,\n PlatformWildoServices,\n WildoLocationType,\n WildoDeploymentRuntime,\n buildK8sInternalHost,\n environmentServiceProfileRunsMessageBroker,\n type EnvironmentServiceProfile,\n} from '@wildo-ai/platform-config-lib';\nimport { DEFAULT_HOST } from '~wildo-cli/services/environment/platform-runtime.schemas';\nimport {\n INFRA_SERVICE_CATALOG,\n PLATFORM_SERVICE_CATALOG,\n resolveContainerInternalAlias,\n} from '~wildo-cli/services/catalog/service-catalog.schemas';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\n\n// ============================================================================\n// Enums & Interfaces\n// ============================================================================\n\nexport enum AddressPerspective {\n HOST_FACING = 'host-facing',\n CONTAINER_INTERNAL = 'container-internal',\n}\n\nexport interface ServiceAddressContext {\n runtime: WildoDeploymentRuntime;\n locationType: WildoLocationType;\n perspective: AddressPerspective;\n namespace: string;\n /**\n * Public domain (`WildoInfraEnvConfig.publicDomain`) — the\n * runtime-agnostic external hostname browsers and reverse proxies\n * resolve. Used here only for K8s-remote host-facing addressing\n * (`https://<service>.<publicDomain>`); compose host-facing keeps\n * its `localhost` shape because operators typically don't put a\n * reverse proxy in front of local compose runs.\n */\n publicDomain: string;\n databaseSource: BackingServiceSource;\n /**\n * Authored backing-services snapshot (mirrored from\n * `wildo.infra.<env>.config.ts`). When present, per-service overrides\n * win over catalog defaults. Missing services keep catalog-driven topology.\n *\n * Override precedence per perspective:\n * - HOST_FACING: author `host` and `port` win.\n * - CONTAINER_INTERNAL (compose / K8s):\n * * container name stays canonical (catalog `containerName` /\n * `<service>.<namespace>.svc.cluster.local`) — that is the only\n * address the container network can resolve.\n * * port: author `port` wins for self-deployed services because the\n * generated docker-compose maps host port `port:port` (compose-side\n * binds match the container-listen port). For MANAGED/EXTERNAL\n * sources the author `host`/`port` are canonical for both\n * perspectives — catalog defaults never apply.\n */\n backingServices?: BackingServicesEnvConfig;\n /**\n * The environment's service profile (#2303 slice D). A profile whose queue lives in the application's database runs no\n * message broker, so the RabbitMQ addresses resolve to `null` under it: every env builder emits broker keys only from a\n * resolved address, so none points at a host the environment does not run. Absent ⇒ FULL.\n */\n serviceProfile?: EnvironmentServiceProfile;\n}\n\nexport interface ResolvedServiceAddress {\n host: string;\n port: number;\n url: string;\n}\n\n/**\n * All fields are nullable: `mongodb` is null when Atlas (no local instance),\n * and ALL fields are null for K8s remote + HOST_FACING (no direct host access\n * to cluster-internal infra — use CONTAINER_INTERNAL perspective instead).\n */\nexport interface ResolvedInfraAddresses {\n mongodb: ResolvedServiceAddress | null;\n valkey: ResolvedServiceAddress | null;\n rabbitmq: ResolvedServiceAddress | null;\n rabbitmqManagement: ResolvedServiceAddress | null;\n minio: ResolvedServiceAddress | null;\n postgresql: ResolvedServiceAddress | null;\n /**\n * The ClamAV daemon an application backend submits uploads and received attachments to (#1910). Resolved like every\n * other backing service — `localhost` + the published port for a host-run process, the data-network alias for a\n * container — so a host-run dev backend reaches the same `clamav` container a containerised one does.\n */\n clamav: ResolvedServiceAddress | null;\n /**\n * The self-hosted immudb server apps-manager administers (#1696): it logs in there as the sysadmin to give each\n * application its own database and user. Resolved like every other backing service, so a host-run apps-manager and\n * a containerised one both reach the `immudb` container. Applications reach immudb through their own provider\n * address (`IMMUDB_HOST`), not through this.\n */\n immudb: ResolvedServiceAddress | null;\n /**\n * The self-hosted OpenBao holding the platform's custodied keys (#2933). apps-manager is its only client, host-run\n * in local development and containerised otherwise, so it resolves like `immudb`. Whether one runs at all is\n * `selfHostsPlatformKeyVault`; this address is meaningful only then.\n */\n openbao: ResolvedServiceAddress | null;\n}\n\nexport interface ResolvedPlatformAddresses {\n appsManager: ResolvedServiceAddress;\n crontabsBatchesManager: ResolvedServiceAddress;\n /**\n * Module-registry endpoint. Required by\n * `ApplicationEnvConfigurationSchema.PLATFORM_MODULE_REGISTRY_URL`\n * (engine `app-env-config.backend.schemas.ts`). Without this, every\n * application backend fails Zod env-validation at startup with\n * \"Invalid input: expected string, received undefined\" on\n * `PLATFORM_MODULE_REGISTRY_URL`.\n */\n moduleRegistry: ResolvedServiceAddress;\n}\n\nexport interface ResolvedAddresses {\n infra: ResolvedInfraAddresses;\n platform: ResolvedPlatformAddresses;\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\nfunction buildAddress(host: string, port: number): ResolvedServiceAddress {\n return { host, port, url: `http://${host}:${port}` };\n}\n\n/**\n * Parse an authored S3-style endpoint (e.g. `http://localhost:9000`) into\n * its host/port parts. Returns `null` for malformed values so the\n * resolver can fall back to the per-field overrides (`s3.host` / `s3.port`)\n * or catalog defaults without throwing during topology resolution.\n *\n * The scheme (`http`/`https`) is intentionally NOT returned. The address\n * resolver constructs URLs with a hardcoded `http://` scheme today (see\n * `buildAddress`), so threading `useSsl` here would be a dead field that\n * lies about the resolver contract. If/when scheme propagation becomes\n * a real requirement, the `buildAddress` helper and downstream consumers\n * must be updated together — this signature change is the gate.\n */\nfunction parseEndpoint(endpoint: string | undefined): { host: string; port: number } | null {\n if (!endpoint) return null;\n try {\n const url = new URL(endpoint);\n const useSsl = url.protocol === 'https:';\n const port = url.port ? Number(url.port) : useSsl ? 443 : 80;\n if (!url.hostname || Number.isNaN(port)) return null;\n return { host: url.hostname, port };\n } catch {\n return null;\n }\n}\n\n/**\n * Resolve a host/port pair given an authored backing-service entry, the\n * catalog-driven defaults for that service, and the current perspective.\n *\n * The semantic model:\n * - For `BackingServiceSource.SELF` (we deploy the container): the catalog\n * container name is canonical for `CONTAINER_INTERNAL` because that is\n * the only DNS name the container network knows. Authored `host` only\n * applies to `HOST_FACING` (host-side dev tools). Authored `port` applies\n * to BOTH because the docker-compose generator maps `port:port`.\n * - For `BackingServiceSource.MANAGED`: the service is not in our\n * compose/K8s topology, so authored `host`/`port` are the only\n * canonical address for both perspectives. **Mongo-on-managed\n * special case**: when the brand is `'atlas'` (or any future\n * external-URL Mongo brand), callers detect this via\n * `addresses.infra.mongodb === null` (the resolver short-circuits\n * for managed Mongo at line 273) and read the connection URL from\n * secrets; this helper is not invoked for that branch. Slice\n * 4.B.0 (2026-05-07) replaced the prior `source: ATLAS` enum\n * value with `(source: MANAGED, provider: 'atlas')`.\n */\nfunction resolveOverriddenAddress(\n override: BackingServiceEnvConfig | undefined,\n fallback: { host: string; port: number },\n perspective: AddressPerspective,\n): { host: string; port: number } {\n if (!override) return fallback;\n const isManaged = override.source !== BackingServiceSource.SELF;\n\n if (isManaged) {\n return {\n host: override.host ?? fallback.host,\n port: override.port ?? fallback.port,\n };\n }\n\n if (perspective === AddressPerspective.HOST_FACING) {\n return {\n host: override.host ?? fallback.host,\n port: override.port ?? fallback.port,\n };\n }\n\n return {\n host: fallback.host,\n port: override.port ?? fallback.port,\n };\n}\n\n// ============================================================================\n// Resolver\n// ============================================================================\n\nexport class ServiceAddressResolver {\n static resolve(context: ServiceAddressContext): ResolvedAddresses {\n return {\n infra: ServiceAddressResolver.resolveInfra(context),\n platform: ServiceAddressResolver.resolvePlatform(context),\n };\n }\n\n static fromEnvironment(\n env: PlatformEnvironmentConfiguration,\n perspective: AddressPerspective,\n ): ServiceAddressContext {\n const isRemoteKubernetes =\n env.runtime === WildoDeploymentRuntime.KUBERNETES\n && env.locationType === WildoLocationType.REMOTE;\n const namespace = env.kubernetes?.namespace ?? (isRemoteKubernetes ? undefined : K8S_LOCAL_DEFAULTS.NAMESPACE);\n // `publicDomain` is a required top-level field on\n // `PlatformEnvironmentConfiguration` (mirrored from the schema's\n // required `WildoInfraEnvConfig.publicDomain`), but the default\n // `PUBLIC_DOMAIN_DEFAULTS.LOCAL_K8S` is kept as a defensive\n // belt-and-braces fallback for the local path so a hand-edited\n // hydrated config that drops the field still works for local\n // K8s development. Remote Kubernetes paths ALWAYS require an\n // explicitly authored value — there is no remote default.\n const publicDomain = env.publicDomain\n ?? (isRemoteKubernetes ? undefined : PUBLIC_DOMAIN_DEFAULTS.LOCAL_K8S);\n\n if (!namespace || !publicDomain) {\n throw new Error(\n `Environment '${env.name}' is missing explicit Kubernetes namespace or top-level publicDomain metadata.`,\n );\n }\n\n return {\n runtime: env.runtime,\n locationType: env.locationType,\n perspective,\n namespace,\n publicDomain,\n databaseSource: env.database.source ?? BackingServiceSource.SELF,\n backingServices: env.backingServices,\n serviceProfile: env.serviceProfile,\n };\n }\n\n // --------------------------------------------------------------------------\n // Infrastructure services\n // --------------------------------------------------------------------------\n\n private static resolveInfra(ctx: ServiceAddressContext): ResolvedInfraAddresses {\n const isK8sRemoteHostFacing =\n ctx.runtime === WildoDeploymentRuntime.KUBERNETES\n && ctx.locationType === WildoLocationType.REMOTE\n && ctx.perspective === AddressPerspective.HOST_FACING;\n\n if (isK8sRemoteHostFacing) {\n return {\n mongodb: null,\n valkey: null,\n rabbitmq: null,\n rabbitmqManagement: null,\n minio: null,\n postgresql: null,\n clamav: null,\n immudb: null,\n openbao: null,\n };\n }\n\n const mongoCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.MONGODB];\n const valkeyCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.VALKEY];\n const rabbitmqCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.RABBITMQ];\n const minioCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.MINIO];\n const pgCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.POSTGRESQL];\n const clamavCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.CLAMAV];\n const immudbCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.IMMUDB];\n const openbaoCatalog = INFRA_SERVICE_CATALOG[PlatformDataServices.OPENBAO];\n\n const mongoOverride = ctx.backingServices?.[BackingServiceKind.MONGODB];\n const redisOverride = ctx.backingServices?.[BackingServiceKind.REDIS];\n const rabbitOverride = ctx.backingServices?.[BackingServiceKind.RABBITMQ];\n const s3Override = ctx.backingServices?.[BackingServiceKind.S3];\n const pgOverride = ctx.backingServices?.[BackingServiceKind.POSTGRESQL];\n const clamavOverride = ctx.backingServices?.[BackingServiceKind.CLAMAV];\n const immudbOverride = ctx.backingServices?.[BackingServiceKind.IMMUDB];\n\n const s3EndpointParsed = parseEndpoint(s3Override?.endpoint);\n const s3OverrideMerged: BackingServiceEnvConfig | undefined = s3Override\n ? {\n ...s3Override,\n host: s3Override.host ?? s3EndpointParsed?.host,\n port: s3Override.port ?? s3EndpointParsed?.port,\n }\n : undefined;\n\n // Slice 4.B.0 (2026-05-07): the legacy `source: ATLAS` was the only\n // managed-Mongo enum value, so it stood in for \"any managed Mongo\n // — let the external service's connection URL handle it; we don't\n // need to resolve a local container address\". Post-reshape, the\n // same logic applies to every managed-Mongo brand (Atlas, future\n // DocumentDB, etc.) → loosen to the broader source check.\n const mongodb =\n ctx.databaseSource === BackingServiceSource.MANAGED\n ? null\n : ServiceAddressResolver.resolveInfraService(\n ctx,\n mongoCatalog.containerName,\n mongoCatalog.defaultPort,\n mongoCatalog.defaultPort,\n mongoOverride,\n );\n\n // #2303 slice D — no broker runs under a profile whose queue lives in the application's database: no address.\n const runsBroker = environmentServiceProfileRunsMessageBroker(ctx.serviceProfile);\n return {\n mongodb,\n valkey: ServiceAddressResolver.resolveInfraService(\n ctx, valkeyCatalog.containerName, valkeyCatalog.defaultPort, valkeyCatalog.defaultPort, redisOverride,\n ),\n rabbitmq: !runsBroker ? null : ServiceAddressResolver.resolveInfraService(\n ctx, rabbitmqCatalog.containerName, rabbitmqCatalog.defaultPort, rabbitmqCatalog.defaultPort, rabbitOverride,\n ),\n rabbitmqManagement: !runsBroker ? null : ServiceAddressResolver.resolveInfraService(\n ctx,\n rabbitmqCatalog.containerName,\n rabbitmqCatalog.additionalPorts!.management,\n rabbitmqCatalog.additionalPorts!.management,\n // The management UI rides on the same RabbitMQ container; we only\n // honor the authored host (HOST_FACING) — the management port itself\n // is image-defined and not part of the author surface today.\n rabbitOverride\n ? { ...rabbitOverride, port: undefined }\n : undefined,\n ),\n minio: ServiceAddressResolver.resolveInfraService(\n ctx, minioCatalog.containerName, minioCatalog.defaultPort, minioCatalog.defaultPort, s3OverrideMerged,\n ),\n postgresql: ServiceAddressResolver.resolveInfraService(\n ctx, pgCatalog.containerName, pgCatalog.defaultPort, pgCatalog.defaultPort, pgOverride,\n ),\n clamav: ServiceAddressResolver.resolveInfraService(\n ctx, clamavCatalog.containerName, clamavCatalog.defaultPort, clamavCatalog.defaultPort, clamavOverride,\n ),\n immudb: ServiceAddressResolver.resolveInfraService(\n ctx, immudbCatalog.containerName, immudbCatalog.defaultPort, immudbCatalog.defaultPort, immudbOverride,\n ),\n // No authored override: the platform's own Vault is not a backing service an environment addresses.\n openbao: ServiceAddressResolver.resolveInfraService(\n ctx, openbaoCatalog.containerName, openbaoCatalog.defaultPort, openbaoCatalog.defaultPort, undefined,\n ),\n };\n }\n\n /**\n * @param hostFacingPort Port exposed on the host (mapped port)\n * @param internalPort Port inside the container\n * @param override Optional authored backing-service entry; honored\n * per the precedence rules in `ServiceAddressContext.backingServices`.\n */\n private static resolveInfraService(\n ctx: ServiceAddressContext,\n serviceName: string,\n hostFacingPort: number,\n internalPort: number,\n override: BackingServiceEnvConfig | undefined,\n ): ResolvedServiceAddress {\n const isHostFacing = ctx.perspective === AddressPerspective.HOST_FACING;\n\n switch (ctx.runtime) {\n case WildoDeploymentRuntime.DOCKER_COMPOSE: {\n /*\n * A container dials the data-network ALIAS, never the bare service name.\n *\n * Both ends of this call are attached to `wildo-host-access`, the publish\n * bridge, which is created with ICC disabled — so the service name resolves\n * to an address that is deliberately unreachable, and the caller times out\n * against a service that is up. The alias is registered on the data segment\n * only, so it cannot resolve to the blocked bridge.\n *\n * @see CONTAINER_INTERNAL_ALIAS_SUFFIX for the measurement.\n *\n * HOST_FACING is untouched: a host process reaches the published port on\n * localhost and never consults Docker DNS.\n */\n const fallbackHost = isHostFacing ? DEFAULT_HOST : resolveContainerInternalAlias(serviceName);\n const fallbackPort = isHostFacing ? hostFacingPort : internalPort;\n const { host, port } = resolveOverriddenAddress(\n override,\n { host: fallbackHost, port: fallbackPort },\n ctx.perspective,\n );\n return buildAddress(host, port);\n }\n\n case WildoDeploymentRuntime.KUBERNETES: {\n if (ctx.locationType === WildoLocationType.LOCAL && isHostFacing) {\n const { host, port } = resolveOverriddenAddress(\n override,\n { host: DEFAULT_HOST, port: hostFacingPort },\n ctx.perspective,\n );\n return buildAddress(host, port);\n }\n const fallbackHost = buildK8sInternalHost(serviceName, ctx.namespace);\n const { host, port } = resolveOverriddenAddress(\n override,\n { host: fallbackHost, port: internalPort },\n ctx.perspective,\n );\n return buildAddress(host, port);\n }\n\n default: {\n const _exhaustive: never = ctx.runtime;\n throw new Error(`Unhandled runtime mode: ${_exhaustive}`);\n }\n }\n }\n\n // --------------------------------------------------------------------------\n // Platform (Wildo) services\n // --------------------------------------------------------------------------\n\n private static resolvePlatform(ctx: ServiceAddressContext): ResolvedPlatformAddresses {\n return {\n appsManager: ServiceAddressResolver.resolvePlatformService(ctx, PlatformWildoServices.APPS_MANAGER),\n crontabsBatchesManager: ServiceAddressResolver.resolvePlatformService(ctx, PlatformWildoServices.CRONTABS_BATCHES_MANAGER),\n moduleRegistry: ServiceAddressResolver.resolvePlatformService(ctx, PlatformWildoServices.MODULE_REGISTRY),\n };\n }\n\n private static resolvePlatformService(\n ctx: ServiceAddressContext,\n service: Exclude<PlatformWildoServices, PlatformWildoServices.PLATFORM_INIT>,\n ): ResolvedServiceAddress {\n const catalogEntry = PLATFORM_SERVICE_CATALOG[service];\n const port = catalogEntry.defaultPort;\n const serviceName = catalogEntry.containerName;\n const isHostFacing = ctx.perspective === AddressPerspective.HOST_FACING;\n\n switch (ctx.runtime) {\n case WildoDeploymentRuntime.DOCKER_COMPOSE:\n /*\n * Same alias rule as the infra branch, for the same reason: every platform\n * service declares `ports:` and is therefore on the ICC-disabled publish\n * bridge alongside the platform service it is calling.\n * @see CONTAINER_INTERNAL_ALIAS_SUFFIX\n */\n return isHostFacing\n ? buildAddress(DEFAULT_HOST, port)\n : buildAddress(resolveContainerInternalAlias(serviceName), port);\n\n case WildoDeploymentRuntime.KUBERNETES:\n if (isHostFacing) {\n if (ctx.locationType === WildoLocationType.REMOTE) {\n const host = `${serviceName}.${ctx.publicDomain}`;\n return { host, port: 443, url: `https://${host}` };\n }\n return buildAddress(DEFAULT_HOST, port);\n }\n return buildAddress(buildK8sInternalHost(serviceName, ctx.namespace), port);\n\n default: {\n const _exhaustive: never = ctx.runtime;\n throw new Error(`Unhandled runtime mode: ${_exhaustive}`);\n }\n }\n }\n}\n"]}
@@ -75,6 +75,12 @@ export interface SecretChangeOptions {
75
75
  */
76
76
  readonly restartCompanion?: boolean;
77
77
  }
78
+ /**
79
+ * The signal file whose touch restarts a supervised runtime, per scope path (`backend`, `companion`,
80
+ * `<family>.<key>`). Looked up by the service's folder, the label every generated `dev` script passes its
81
+ * supervisor; the companion's is fixed. Only runtimes a live supervisor runs are returned.
82
+ */
83
+ export declare function runtimeSignalFiles(saasRoot: string, runtimes: readonly string[]): Promise<Map<string, string>>;
78
84
  /**
79
85
  * Run this CLI's own `config sync --domain <domain>` for one environment, as one child run. A failure is
80
86
  * REPORTED, never swallowed: the value is already in `secrets.json`, and without the regeneration nothing
@@ -1 +1 @@
1
- {"version":3,"file":"application-secrets.service.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials/application-secrets.service.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAkB,iBAAiB,EAA0B,MAAM,+BAA+B,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAA6B,KAAK,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAYrI,OAAO,EA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H,QAAQ,CAAC,sBAAsB,EAAE,wBAAwB,GAAG,IAAI,CAAC;CAClE;AAcD,kCAAkC;AAClC,MAAM,WAAW,mBAAmB;IAClC,oHAAoH;IACpH,QAAQ,CAAC,IAAI,CAAC,EAAE,qBAAqB,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACrC;AAyFD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,WAAW,GAAG,UAAU,GAC/B;IAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAsBpE;AAED,0FAA0F;AAC1F,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG;IAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAExI;AAED,yGAAyG;AACzG,eAAO,MAAM,gCAAgC,qCAAqC,CAAC;AAmGnF;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,mBAAmB,CAAC,CAiB9B;AAED,4GAA4G;AAC5G,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,mBAAmB,CAAC,CAU9B"}
1
+ {"version":3,"file":"application-secrets.service.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials/application-secrets.service.ts"],"names":[],"mappings":"AAiBA,OAAO,E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B,CAAC,CAiB9B;AAED,4GAA4G;AAC5G,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,mBAAmB,CAAC,CAU9B"}
@@ -213,7 +213,7 @@ function liveSupervisorSignalFile(saasRoot, folder) {
213
213
  * `<family>.<key>`). Looked up by the service's folder, the label every generated `dev` script passes its
214
214
  * supervisor; the companion's is fixed. Only runtimes a live supervisor runs are returned.
215
215
  */
216
- async function runtimeSignalFiles(saasRoot, runtimes) {
216
+ export async function runtimeSignalFiles(saasRoot, runtimes) {
217
217
  const config = await loadSaasConfig(join(saasRoot, WORKSPACE_CONFIG_NAMES.SAAS));
218
218
  const byFolder = new Map();
219
219
  const add = (folder) => {
@@ -1 +1 @@
1
- {"version":3,"file":"application-secrets.service.js","sourceRoot":"","sources":["../../../../src/services/credentials/application-secrets.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAErE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAqC,MAAM,gCAAgC,CAAC;AACrI,OAAO,EAAE,oCAAoC,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAE5G,OAAO,EAAE,kCAAkC,EAAE,6BAA6B,EAAE,MAAM,6DAA6D,CAAC;AAChJ,OAAO,EAAE,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,EAA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AAM,CAAC,EAAE,CAAC;AAClJ,CAAC;AAED,4GAA4G;AAC5G,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,QAAgB,EAChB,OAAe,EACf,UAAkB,EAClB,UAA+B,EAAE;IAEjC,MAAM,MAAM,GAAG,MAAM,2BAA2B,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IACjF,MAAM,MAAM,GAAG,MAAM,0BAA0B,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3E,MAAM,GAAG,GAAG,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,IAAI,MAAM,CAAC,YAAY,KAAK,iBAAiB,CAAC,KAAK,EAAE,CAAC;QACpD,6BAA6B,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAC1E,OAAO,EAAE,GAAG,CAAC,MAAM,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;IACxJ,CAAC;IACD,4BAA4B,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IACtE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;AAClJ,CAAC","sourcesContent":["/**\n * An application's secrets per environment — provider secrets, system-of-record credentials and inbound\n * endpoint secrets (`ApplicationSecretKind`) — what it needs, what is set, and how to change one, for\n * `wildo secrets` and, through it, the workbench's secrets section (#1637).\n *\n * Local environments keep values in `infrastructure/<env>/secrets/secrets.json`, one section per kind; a\n * change is written there, the runtimes' `.env` files are regenerated, and only the runtimes that read the\n * key are restarted. Remote environments keep them as GitHub Actions secrets, written through the operator's\n * own `gh` login (`remote-secrets-store.service.ts`).\n *\n * A value never leaves this module except to the store that holds it: every report carries names and\n * standings, never a value, so a listing can be printed, logged or shown in a browser.\n */\nimport { spawnSync } from 'child_process';\nimport { existsSync, readFileSync, realpathSync, utimesSync } from 'fs';\nimport { basename, isAbsolute, join, relative, resolve } from 'path';\n\nimport { loadSaasConfig, WildoLocationType, WORKSPACE_CONFIG_NAMES } from '@wildo-ai/platform-config-lib';\nimport { ApplicationSecretKind, ApplicationSecretStanding, type ApplicationSecretRemoteLevel } from '@wildo-ai/platform-core-shared';\nimport { parseInboundEndpointSecretEnvVarName, parseSystemOfRecordEnvVarName } from '@wildo-ai/saas-models';\n\nimport { readLocalApplicationSecretPresence, updateLocalApplicationSecrets } from '~wildo-cli/services/credentials/local-secrets-store.service';\nimport { describeSecretValueProblem } from '~wildo-cli/services/credentials/provider-secret-format';\nimport { normalizePotentialMultilineSecret } from '~wildo-cli/services/credentials/ci-secrets-adapter.service';\nimport {\n describeDeployWorkflowGap,\n listRemoteApplicationSecrets,\n setRemoteApplicationSecret,\n unsetRemoteApplicationSecret,\n} from '~wildo-cli/services/credentials/remote-secrets-store.service';\nimport {\n loadSecretRequirementInputs,\n loadSecretRequirements,\n SystemOfRecordEnvironmentPresence,\n systemOfRecordPresenceOf,\n type SecretRequirement,\n type SecretRequirementInputs,\n type StoredApplicationSecrets,\n} from '~wildo-cli/services/credentials/secret-requirements.service';\nimport type { PlatformEnvConfigJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport { loadAppLocalRuntimeServiceAddresses } from '~wildo-cli/services/application/app-local-runtime-addresses.service';\nimport {\n COMPANION_UNREACHABLE_EXIT_CODE,\n CompanionClient,\n CompanionRefusalError,\n companionFailureExitCode,\n} from '~wildo-cli/services/companion/companion-client.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\n\nexport interface EnvironmentSecretsReport {\n readonly envName: string;\n readonly locationType: WildoLocationType;\n readonly requirements: readonly (SecretRequirement & { readonly remoteLevel?: ApplicationSecretRemoteLevel })[];\n /**\n * What this listing could not derive, each saying why — a backend not built (its inbound endpoints are then\n * unknown), a vendor facet that could not be read. Empty when the listing is whole.\n */\n readonly incomplete: readonly string[];\n}\n\n/** An environment's location, refused when the environment is not registered. */\nexport function resolveEnvironmentLocation(envName: string): WildoLocationType {\n const environment = EnvironmentUtils.get(envName);\n if (!environment) {\n throw new Error(`No environment '${envName}'. Registered: ${EnvironmentUtils.listNames().join(', ') || 'none'}.`);\n }\n return environment.locationType;\n}\n\nconst APPLICATION_SECRET_KINDS = Object.values(ApplicationSecretKind);\n\n/**\n * A LOCAL environment's `secrets.json`, per kind: the names with a value (`stored`), and every name the section\n * holds, an empty value included (`present`). A key stored as `\"\"` is not set, but it is still there to remove.\n */\nfunction readLocalStoredSecrets(envName: string): { readonly stored: StoredApplicationSecrets; readonly present: StoredApplicationSecrets } {\n // Names only: the report says what is set, so no value is read into it.\n const sections = APPLICATION_SECRET_KINDS.map((kind) => [kind, readLocalApplicationSecretPresence(envName, kind)] as const);\n return {\n stored: Object.fromEntries(sections.map(([kind, presence]) => [kind, new Set(presence.stored)])) as unknown as StoredApplicationSecrets,\n present: Object.fromEntries(sections.map(([kind, presence]) => [kind, new Set(presence.present)])) as unknown as StoredApplicationSecrets,\n };\n}\n\n/**\n * How the environment addresses each system of record, from its GENERATED config — the file the env builder\n * reads to decide what reaches the backend — or `null` when it cannot be read.\n */\nfunction readSystemOfRecordPresence(envName: string): Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null {\n let config: PlatformEnvConfigJson | null;\n try {\n config = EnvironmentUtils.loadConfigJson(envName);\n } catch {\n return null;\n }\n if (!config) return null;\n return systemOfRecordPresenceOf(config.systemsOfRecord);\n}\n\n/** One secret's identity across kinds: a name is unique per `secrets.json` section, not across them. */\nconst secretKey = (kind: ApplicationSecretKind, envVarName: string): string => `${kind}:${envVarName}`;\n\n/**\n * What the application needs in one environment, and what is set there. Pass `inputs` when describing\n * several environments, so the application is loaded once (`loadSecretRequirementInputs` with its owners).\n */\nexport async function describeEnvironmentSecrets(saasRoot: string, envName: string, inputs?: SecretRequirementInputs): Promise<EnvironmentSecretsReport> {\n const locationType = resolveEnvironmentLocation(envName);\n const loaded = inputs ?? await loadSecretRequirementInputs(saasRoot, { withOwners: true });\n const incomplete = loaded.owners?.incomplete ?? [];\n const systemOfRecordPresence = readSystemOfRecordPresence(envName);\n if (locationType === WildoLocationType.LOCAL) {\n const requirements = await loadSecretRequirements({ saasRoot, inputs: loaded, ...readLocalStoredSecrets(envName), systemOfRecordPresence });\n return { envName, locationType, requirements, incomplete };\n }\n const remote = new Map(listRemoteApplicationSecrets(envName, saasRoot).map((secret) => [secretKey(secret.kind, secret.envVarName), secret]));\n const stored = Object.fromEntries(APPLICATION_SECRET_KINDS.map((kind) => [\n kind,\n new Set([...remote.values()].filter((secret) => secret.kind === kind).map((secret) => secret.envVarName)),\n ])) as unknown as StoredApplicationSecrets;\n const requirements = await loadSecretRequirements({ saasRoot, inputs: loaded, stored, systemOfRecordPresence });\n return {\n envName,\n locationType,\n requirements: requirements.map((row) => {\n const held = remote.get(secretKey(row.kind, row.envVarName));\n return held ? { ...row, remoteLevel: held.level } : row;\n }),\n incomplete,\n };\n}\n\n/**\n * The requirement a name refers to, refused when nothing the application declares reads it — a key no\n * runtime would receive is a typo or a stale name.\n *\n * A NAME is not an identity: each kind is its own `secrets.json` section, and a migration can leave one key in\n * two (an Odoo credential still in `providerEnv` beside its `systemsOfRecordEnv` copy). So `kind` narrows the\n * match, and a name matching in two kinds without one is refused, naming both, rather than resolved to\n * whichever sorted first — which set or removed the other copy than the one the person meant.\n *\n * One exception, for a name whose OWNER exists but could not be enumerated: an inbound endpoint secret when\n * the backend's endpoints could not be read (it is not built), and a system-of-record slot when its vendor's\n * facet could not be. A well-formed name for such an owner is admitted, because refusing it would make the\n * secret impossible to provide until something unrelated is fixed — the env builder delivers any well-formed\n * name, and the backend is where an endpoint without its secret is reported.\n */\nfunction requirementFor(report: EnvironmentSecretsReport, inputs: SecretRequirementInputs, envVarName: string, kind?: ApplicationSecretKind): SecretRequirement {\n const matches = report.requirements\n .filter((candidate) => candidate.envVarName === envVarName && (kind === undefined || candidate.kind === kind))\n .sort((left, right) => left.kind.localeCompare(right.kind));\n if (matches.length > 1) {\n throw new Error(`${envVarName} is in more than one section of this environment's secrets (${matches.map((row) => `${row.kind}: ${row.standing}`).join(', ')}). `\n + `Name the one you mean with --kind ${matches.map((row) => row.kind).join(' | ')}.`);\n }\n if (matches[0]) return matches[0];\n const owners = inputs.owners;\n const endpoint = kind === undefined || kind === ApplicationSecretKind.INBOUND_ENDPOINT ? parseInboundEndpointSecretEnvVarName(envVarName) : null;\n if (endpoint && owners?.inboundEndpointKeys === null) {\n return unenumeratedOwnerRow(envVarName, ApplicationSecretKind.INBOUND_ENDPOINT, endpoint.endpointKey);\n }\n const slot = kind === undefined || kind === ApplicationSecretKind.SYSTEM_OF_RECORD ? parseSystemOfRecordEnvVarName(envVarName) : null;\n if (slot && owners?.systemsOfRecord.some((system) => system.name === slot.instanceName && system.secretSlots === null)) {\n return unenumeratedOwnerRow(envVarName, ApplicationSecretKind.SYSTEM_OF_RECORD, slot.instanceName);\n }\n const known = [...new Set(report.requirements.filter((candidate) => kind === undefined || candidate.kind === kind).map((candidate) => candidate.envVarName))];\n throw new Error(`Nothing this application declares reads ${envVarName}${kind === undefined ? '' : ` as a ${kind} secret`}. Known here: ${known.join(', ') || 'none'}.`);\n}\n\nfunction unenumeratedOwnerRow(envVarName: string, kind: ApplicationSecretKind, ownerRef: string): SecretRequirement {\n return {\n envVarName, kind, ownerRef, description: null, required: true, capabilities: [], runtimes: ['backend'],\n standing: ApplicationSecretStanding.NEEDED, creationEssential: false,\n };\n}\n\nexport interface SecretChangeOutcome {\n readonly envVarName: string;\n /** Which `secrets.json` section (or, remotely, which GitHub secret prefix) the change was made in. */\n readonly kind: ApplicationSecretKind;\n readonly envName: string;\n /**\n * Local only: the runtimes asked to restart to read the change — those that read the key AND run under\n * a LIVE supervisor of `wildo local dev`. A signal file outlives the stack, so its existence alone is\n * not a restart; a runtime nobody supervises reads the key at its next start.\n */\n readonly restartSignalledRuntimes: readonly string[];\n /** Local only: whether the runtimes' `.env` files were regenerated. */\n readonly envFilesRegenerated: boolean;\n /** Local only: why the `.env` files could not be regenerated, with what to run; `null` otherwise. */\n readonly envFilesRegenerationFailure: string | null;\n /**\n * Local only: the companion reads this key and was NOT asked to restart, because the caller said it\n * applies the change itself (`--no-companion-restart`). The workbench does, in-process: restarting\n * the companion from inside a request would end the process serving it and any run in flight.\n */\n readonly companionAppliesChange: boolean;\n /**\n * Local only: the RUNNING companion loaded the change in place, through `POST /api/companion/runtime/env/apply`,\n * so it was not restarted and no run in flight was ended. False when it reads no such key, is not running,\n * or the caller applies the change itself.\n */\n readonly companionLoadedInProcess: boolean;\n /**\n * Local only: the companion is running and reads this key, but could not be made to load it — with what to\n * do. `null` when nothing failed. Distinct from the workbench's `companionApplyFailure`, which the COMPANION\n * sets about its own in-process apply.\n */\n readonly companionLoadFailure: string | null;\n /**\n * The environment's rows AFTER the change, re-derived from the same application inputs the change was\n * checked against (#1782). One change can move OTHER rows too: setting one LLM provider's key can make a\n * competing provider's key no longer needed. A caller holding a listing replaces that environment's rows\n * with these instead of re-listing, which re-loads the application and takes tens of seconds.\n *\n * `null` when they could not be read after the change was MADE — for a remote environment that is one\n * more `gh` listing, which a network error, a rate limit or an expired token can fail. The change itself\n * stands, and a caller holding a listing drops it instead of patching it.\n */\n readonly environmentAfterChange: EnvironmentSecretsReport | null;\n}\n\n/**\n * The environment's rows after a change that has ALREADY been written. A failure here must never turn the\n * completed change into a reported failure: the person would be told \"not changed\" about a secret that was.\n */\nasync function describeAfterChange(saasRoot: string, envName: string, inputs: SecretRequirementInputs): Promise<EnvironmentSecretsReport | null> {\n try {\n return await describeEnvironmentSecrets(saasRoot, envName, inputs);\n } catch {\n return null;\n }\n}\n\n/** Options every change takes. */\nexport interface SecretChangeOptions {\n /** Which `secrets.json` section the name is in — needed only when it is in more than one (see `requirementFor`). */\n readonly kind?: ApplicationSecretKind;\n /**\n * Whether a change the companion reads restarts it (default). The workbench passes `false` and applies\n * the change in-process — see {@link SecretChangeOutcome.companionAppliesChange}.\n */\n readonly restartCompanion?: boolean;\n}\n\n/** The scope path the dev companion is read under (`providers.scopes.companion`). */\nconst COMPANION_RUNTIME = 'companion';\n\n/** The companion's folder under `.wildo-saas/`, which names its supervisor signal file. */\nconst COMPANION_SIGNAL_FOLDER = 'wildo-dev-companion';\n\n/** Is the pid alive (EPERM means alive and someone else's)? */\nfunction isProcessAlive(pid: unknown): boolean {\n if (typeof pid !== 'number' || !Number.isInteger(pid) || pid <= 0) return false;\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n return (error as NodeJS.ErrnoException).code === 'EPERM';\n }\n}\n\n/**\n * The restart signal of the runtime a LIVE `wildo local dev` supervisor runs under this label, or `null`.\n *\n * Its published observation (`runtime-signals/supervisors/<label>.json`, label = the runtime's folder) must name a\n * producer that is alive, and the file must exist. Which file: the one the record DECLARES (`signalFilePath`) — the\n * monorepo's `runtime-supervisor.mjs` and `wildo-dev-runtime serve` (since #2134, which is what brings a changed key to a\n * created application's backend) each declare theirs. A record declaring `null` honours no request, so nothing is\n * touched: the app-creator companion's supervisor declares `null` (#2149), since that companion loads the key in place. A record with no such field (a writer predating it) falls back to the conventional\n * `runtime-signals/<label>.signal`. A declared path outside the application's runtime-signals home is ignored: the CLI\n * touches only files of that home.\n */\nfunction liveSupervisorSignalFile(saasRoot: string, folder: string): string | null {\n const signalDir = join(saasRoot, '.wildo-saas', 'runtime-signals');\n let observation: { producerPid?: unknown; signalFilePath?: unknown };\n try {\n observation = JSON.parse(readFileSync(join(signalDir, 'supervisors', `${folder}.json`), 'utf8')) as typeof observation;\n } catch {\n return null;\n }\n if (!isProcessAlive(observation.producerPid)) return null;\n if (observation.signalFilePath === null) return null;\n if (typeof observation.signalFilePath !== 'string' || observation.signalFilePath.length === 0) {\n const conventional = join(signalDir, `${folder}.signal`);\n return existsSync(conventional) ? conventional : null;\n }\n const declared = resolve(saasRoot, observation.signalFilePath);\n // Compared as REAL paths, so a symlinked application root and a symlink inside the home pointing out are both judged by\n // where the file really is. A file that vanishes while it is read is no signal: the change is already written, and\n // must not be reported as failed.\n let within: string;\n try {\n within = relative(realpathSync(signalDir), realpathSync(declared));\n } catch {\n return null;\n }\n if (within.length === 0 || within.startsWith('..') || isAbsolute(within)) return null;\n return declared;\n}\n\n/**\n * The signal file whose touch restarts a supervised runtime, per scope path (`backend`, `companion`,\n * `<family>.<key>`). Looked up by the service's folder, the label every generated `dev` script passes its\n * supervisor; the companion's is fixed. Only runtimes a live supervisor runs are returned.\n */\nasync function runtimeSignalFiles(saasRoot: string, runtimes: readonly string[]): Promise<Map<string, string>> {\n const config = await loadSaasConfig(join(saasRoot, WORKSPACE_CONFIG_NAMES.SAAS)) as {\n services?: Record<string, { path?: string; frontendType?: unknown }>;\n minions?: Record<string, { path?: string }>;\n workers?: Record<string, { path?: string }>;\n };\n const byFolder = new Map<string, string>();\n const add = (folder: string | undefined): void => {\n if (!folder) return;\n const name = basename(folder);\n const file = liveSupervisorSignalFile(saasRoot, name);\n if (file !== null) byFolder.set(name, file);\n };\n for (const runtime of runtimes) {\n if (runtime === COMPANION_RUNTIME) add(COMPANION_SIGNAL_FOLDER);\n else if (runtime === 'backend') {\n for (const service of Object.values(config.services ?? {})) if (service.frontendType === undefined) add(service.path);\n } else {\n const [family, key] = runtime.split('.') as [string, string];\n const source = family === 'minions' ? config.minions : family === 'workers' ? config.workers : config.services;\n add(source?.[key]?.path);\n }\n }\n return byFolder;\n}\n\n/**\n * Run this CLI's own `config sync --domain <domain>` for one environment, as one child run. A failure is\n * REPORTED, never swallowed: the value is already in `secrets.json`, and without the regeneration nothing\n * can read it, which the person must be told along with what to run.\n */\nexport function runConfigSyncDomain(\n saasRoot: string,\n envName: string,\n domain: 'env-files' | 'manifest',\n): { readonly regenerated: boolean; readonly failure: string | null } {\n /*\n * `--force` is required, not a convenience. Without it a non-interactive `config sync` finds the\n * existing files, prints \"Skipping env-files regeneration in non-interactive mode\" and EXITS 0 — so\n * every local change reported `envFilesRegenerated: true` and restarted its runtimes on the OLD `.env`\n * (measured 2026-09-26: a key set from the workbench reached `secrets.json` and no `.env`). The prompt\n * that skip replaces asks \"overwrite the existing env files?\", and changing a secret is a request to\n * do exactly that. `--force` skips confirmations only; secret rotation needs `--rotate-secrets`.\n */\n const args = ['config', 'sync', '--domain', domain, '--env', envName, '--non-interactive', '--force'];\n const result = spawnSync(process.execPath, [process.argv[1]!, ...args], { cwd: saasRoot, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });\n if (result.status === 0) return { regenerated: true, failure: null };\n const lastLine = `${result.stderr ?? ''}\\n${result.stdout ?? ''}`\n .split('\\n')\n .map((line) => line.replace(/\\u001b\\[[0-9;]*m/g, '').trim())\n .filter((line) => line.length > 0)\n .at(-1);\n const what = domain === 'env-files' ? \"the runtimes' .env files were\" : 'the deployment manifests were';\n return {\n regenerated: false,\n failure: `The value is saved, but ${what} not regenerated${lastLine ? ` (${lastLine})` : ''}. Run \\`wildo ${args.join(' ')}\\`, then restart what reads it.`,\n };\n}\n\n/** Regenerate the local runtimes' `.env` files — what every application runtime reads. */\nexport function regenerateEnvFiles(saasRoot: string, envName: string): { readonly regenerated: boolean; readonly failure: string | null } {\n return runConfigSyncDomain(saasRoot, envName, 'env-files');\n}\n\n/** The companion route that loads named variables of its regenerated `.env` into the running process. */\nexport const COMPANION_RUNTIME_ENV_APPLY_PATH = '/api/companion/runtime/env/apply';\n\n/** Long enough for a registry refresh on a loaded machine; short enough that a hung companion does not hold `set`. */\nconst COMPANION_ENV_APPLY_TIMEOUT_MS = 20_000;\n\n/** What asking the running companion to load a changed variable came to. */\ntype CompanionLoadResult =\n | { readonly kind: 'loaded' }\n | { readonly kind: 'not-running' }\n | { readonly kind: 'failed'; readonly failure: string };\n\n/**\n * Ask the RUNNING companion to load one changed variable from the `.env` just regenerated (#1637).\n *\n * The answer to a key that \"is set\" and still refused: the companion reads its `.env` once, at boot, and in\n * a created application nothing supervises it (it runs as plain `node --env-file-if-exists=.env` under\n * `pnpm -r run dev`), so there is no signal file to touch and no restart to ask for. Loading in place works\n * whether or not a supervisor exists, and it spares every run in flight, which a restart would end.\n *\n * Only the NAME is sent; the companion reads the value from its own `.env`.\n *\n * Unreachable (refused connection, no token because it never booted) is `not-running`: it then reads the key\n * at its next start, which is what would happen anyway. Anything else is `failed`, including a 404 from a\n * companion older than this route and a timeout.\n */\nasync function loadInRunningCompanion(saasRoot: string, envVarName: string): Promise<CompanionLoadResult> {\n const addresses = await loadAppLocalRuntimeServiceAddresses(saasRoot).catch(() => null);\n const options = {\n appRoot: saasRoot,\n baseUrl: addresses?.devCompanion?.url,\n port: addresses?.devCompanion?.port,\n timeoutMs: COMPANION_ENV_APPLY_TIMEOUT_MS,\n };\n try {\n await CompanionClient.post(COMPANION_RUNTIME_ENV_APPLY_PATH, { envVarNames: [envVarName] }, options);\n return { kind: 'loaded' };\n } catch (error) {\n /*\n * \"Not running\" is exactly what the client already calls UNREACHABLE — a refused or reset connection, or\n * no token because the companion never booted — so the one classifier decides both. Anything else (a\n * timeout, a hung companion, an unreadable token) is a companion that may hold the old value: a failure.\n */\n if (companionFailureExitCode(error) === COMPANION_UNREACHABLE_EXIT_CODE) return { kind: 'not-running' };\n const restart = `restart \\`wildo local dev\\` so it reads the new value.`;\n if (error instanceof CompanionRefusalError && error.status === 404) {\n return { kind: 'failed', failure: `The running companion is older than this CLI and cannot load ${envVarName} in place; ${restart}` };\n }\n return { kind: 'failed', failure: `The running companion could not load ${envVarName} (${ErrorUtils.extractErrorMessage(error)}); ${restart}` };\n }\n}\n\n/**\n * Regenerate the `.env` files and bring the change to the runtimes that receive the key. ALWAYS regenerated,\n * an UNUSED key included: unconsumed is not undelivered (the companion's `.env` carries every provider key),\n * and a removal that skipped this left the value on disk and in the running process (#1637 review, H1).\n *\n * The companion is asked to LOAD the key in place first; only when it is not running, or could not, is it\n * signalled to restart like the other runtimes. Every other runtime is restarted through its supervisor's\n * signal file.\n */\nasync function applyLocalChange(saasRoot: string, envName: string, row: SecretRequirement, options: SecretChangeOptions): Promise<Omit<SecretChangeOutcome, 'environmentAfterChange'>> {\n const restartCompanion = options.restartCompanion !== false;\n const readsKey = row.runtimes.includes(COMPANION_RUNTIME);\n const companionAppliesChange = !restartCompanion && readsKey;\n const identity = { envVarName: row.envVarName, kind: row.kind, envName };\n const regeneration = regenerateEnvFiles(saasRoot, envName);\n const signalled: string[] = [];\n let companionLoad: CompanionLoadResult | null = null;\n if (regeneration.regenerated) {\n if (restartCompanion && readsKey) companionLoad = await loadInRunningCompanion(saasRoot, row.envVarName);\n const companionHandled = !restartCompanion || companionLoad?.kind === 'loaded';\n const now = new Date();\n const runtimes = row.runtimes.filter((runtime) => !companionHandled || runtime !== COMPANION_RUNTIME);\n for (const [folder, file] of await runtimeSignalFiles(saasRoot, runtimes)) {\n utimesSync(file, now, now);\n signalled.push(folder);\n }\n }\n return {\n ...identity,\n restartSignalledRuntimes: signalled,\n envFilesRegenerated: regeneration.regenerated,\n envFilesRegenerationFailure: regeneration.failure,\n companionAppliesChange,\n companionLoadedInProcess: companionLoad?.kind === 'loaded',\n // A supervised companion restarted instead has received the change, so the failure is not worth saying.\n companionLoadFailure: companionLoad?.kind === 'failed' && !signalled.includes(COMPANION_SIGNAL_FOLDER) ? companionLoad.failure : null,\n };\n}\n\nconst REMOTE_OUTCOME = {\n restartSignalledRuntimes: [],\n envFilesRegenerated: false,\n envFilesRegenerationFailure: null,\n companionAppliesChange: false,\n companionLoadedInProcess: false,\n companionLoadFailure: null,\n} as const;\n\n/**\n * Set one secret in one environment, in the section its kind names. The value is validated, never logged.\n *\n * A key holding a PEM (`…PRIVATE_KEY`, `…CERTIFICATE`, a system of record's `certificatePem`) pasted on one\n * line with literal `\\n` is turned into real line breaks locally, exactly as the CI adapter does when it reads\n * the same secret remotely (`normalizePotentialMultilineSecret`), so both lanes hand a runtime the same\n * bytes. A remote value is stored as given, because that adapter normalizes it on the way out.\n *\n * An UNUSED key is refused: nothing consumes it, so a new value would change nothing a runtime does.\n */\nexport async function setApplicationSecret(\n saasRoot: string,\n envName: string,\n envVarName: string,\n value: string,\n options: SecretChangeOptions = {},\n): Promise<SecretChangeOutcome> {\n const inputs = await loadSecretRequirementInputs(saasRoot, { withOwners: true });\n const report = await describeEnvironmentSecrets(saasRoot, envName, inputs);\n const row = requirementFor(report, inputs, envVarName, options.kind);\n if (row.standing === ApplicationSecretStanding.UNUSED) {\n throw new Error(`Nothing consumes ${envVarName}, so setting it would change nothing. Remove it with \\`wildo secrets unset ${envVarName}\\`.`);\n }\n const problem = describeSecretValueProblem(envVarName, value, true);\n if (problem) throw new Error(problem);\n if (report.locationType === WildoLocationType.LOCAL) {\n updateLocalApplicationSecrets(envName, row.kind, { set: { [envVarName]: normalizePotentialMultilineSecret(envVarName, value.trim()) } });\n return { ...(await applyLocalChange(saasRoot, envName, row, options)), environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n }\n const gap = describeDeployWorkflowGap(envName, row.kind, envVarName, saasRoot);\n if (gap) throw new Error(gap);\n setRemoteApplicationSecret(envName, row.kind, envVarName, value.trim(), saasRoot);\n return { envVarName, kind: row.kind, envName, ...REMOTE_OUTCOME, environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n}\n\n/** Remove one secret from one environment — including an UNUSED one, which is what that standing is for. */\nexport async function unsetApplicationSecret(\n saasRoot: string,\n envName: string,\n envVarName: string,\n options: SecretChangeOptions = {},\n): Promise<SecretChangeOutcome> {\n const inputs = await loadSecretRequirementInputs(saasRoot, { withOwners: true });\n const report = await describeEnvironmentSecrets(saasRoot, envName, inputs);\n const row = requirementFor(report, inputs, envVarName, options.kind);\n if (report.locationType === WildoLocationType.LOCAL) {\n updateLocalApplicationSecrets(envName, row.kind, { unset: [envVarName] });\n return { ...(await applyLocalChange(saasRoot, envName, row, options)), environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n }\n unsetRemoteApplicationSecret(envName, row.kind, envVarName, saasRoot);\n return { envVarName, kind: row.kind, envName, ...REMOTE_OUTCOME, environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n}\n"]}
1
+ {"version":3,"file":"application-secrets.service.js","sourceRoot":"","sources":["../../../../src/services/credentials/application-secrets.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAErE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAqC,MAAM,gCAAgC,CAAC;AACrI,OAAO,EAAE,oCAAoC,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAE5G,OAAO,EAAE,kCAAkC,EAAE,6BAA6B,EAAE,MAAM,6DAA6D,CAAC;AAChJ,OAAO,EAAE,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,EAAE,iCAAiC,EAAE,MAAM,4DAA4D,CAAC;AAC/G,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,8DAA8D,CAAC;AAC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AClB,UAA+B,EAAE;IAEjC,MAAM,MAAM,GAAG,MAAM,2BAA2B,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IACjF,MAAM,MAAM,GAAG,MAAM,0BAA0B,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3E,MAAM,GAAG,GAAG,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,IAAI,MAAM,CAAC,YAAY,KAAK,iBAAiB,CAAC,KAAK,EAAE,CAAC;QACpD,6BAA6B,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAC1E,OAAO,EAAE,GAAG,CAAC,MAAM,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;IACxJ,CAAC;IACD,4BAA4B,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IACtE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;AAClJ,CAAC","sourcesContent":["/**\n * An application's secrets per environment — provider secrets, system-of-record credentials and inbound\n * endpoint secrets (`ApplicationSecretKind`) — what it needs, what is set, and how to change one, for\n * `wildo secrets` and, through it, the workbench's secrets section (#1637).\n *\n * Local environments keep values in `infrastructure/<env>/secrets/secrets.json`, one section per kind; a\n * change is written there, the runtimes' `.env` files are regenerated, and only the runtimes that read the\n * key are restarted. Remote environments keep them as GitHub Actions secrets, written through the operator's\n * own `gh` login (`remote-secrets-store.service.ts`).\n *\n * A value never leaves this module except to the store that holds it: every report carries names and\n * standings, never a value, so a listing can be printed, logged or shown in a browser.\n */\nimport { spawnSync } from 'child_process';\nimport { existsSync, readFileSync, realpathSync, utimesSync } from 'fs';\nimport { basename, isAbsolute, join, relative, resolve } from 'path';\n\nimport { loadSaasConfig, WildoLocationType, WORKSPACE_CONFIG_NAMES } from '@wildo-ai/platform-config-lib';\nimport { ApplicationSecretKind, ApplicationSecretStanding, type ApplicationSecretRemoteLevel } from '@wildo-ai/platform-core-shared';\nimport { parseInboundEndpointSecretEnvVarName, parseSystemOfRecordEnvVarName } from '@wildo-ai/saas-models';\n\nimport { readLocalApplicationSecretPresence, updateLocalApplicationSecrets } from '~wildo-cli/services/credentials/local-secrets-store.service';\nimport { describeSecretValueProblem } from '~wildo-cli/services/credentials/provider-secret-format';\nimport { normalizePotentialMultilineSecret } from '~wildo-cli/services/credentials/ci-secrets-adapter.service';\nimport {\n describeDeployWorkflowGap,\n listRemoteApplicationSecrets,\n setRemoteApplicationSecret,\n unsetRemoteApplicationSecret,\n} from '~wildo-cli/services/credentials/remote-secrets-store.service';\nimport {\n loadSecretRequirementInputs,\n loadSecretRequirements,\n SystemOfRecordEnvironmentPresence,\n systemOfRecordPresenceOf,\n type SecretRequirement,\n type SecretRequirementInputs,\n type StoredApplicationSecrets,\n} from '~wildo-cli/services/credentials/secret-requirements.service';\nimport type { PlatformEnvConfigJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport { loadAppLocalRuntimeServiceAddresses } from '~wildo-cli/services/application/app-local-runtime-addresses.service';\nimport {\n COMPANION_UNREACHABLE_EXIT_CODE,\n CompanionClient,\n CompanionRefusalError,\n companionFailureExitCode,\n} from '~wildo-cli/services/companion/companion-client.service';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\n\nexport interface EnvironmentSecretsReport {\n readonly envName: string;\n readonly locationType: WildoLocationType;\n readonly requirements: readonly (SecretRequirement & { readonly remoteLevel?: ApplicationSecretRemoteLevel })[];\n /**\n * What this listing could not derive, each saying why — a backend not built (its inbound endpoints are then\n * unknown), a vendor facet that could not be read. Empty when the listing is whole.\n */\n readonly incomplete: readonly string[];\n}\n\n/** An environment's location, refused when the environment is not registered. */\nexport function resolveEnvironmentLocation(envName: string): WildoLocationType {\n const environment = EnvironmentUtils.get(envName);\n if (!environment) {\n throw new Error(`No environment '${envName}'. Registered: ${EnvironmentUtils.listNames().join(', ') || 'none'}.`);\n }\n return environment.locationType;\n}\n\nconst APPLICATION_SECRET_KINDS = Object.values(ApplicationSecretKind);\n\n/**\n * A LOCAL environment's `secrets.json`, per kind: the names with a value (`stored`), and every name the section\n * holds, an empty value included (`present`). A key stored as `\"\"` is not set, but it is still there to remove.\n */\nfunction readLocalStoredSecrets(envName: string): { readonly stored: StoredApplicationSecrets; readonly present: StoredApplicationSecrets } {\n // Names only: the report says what is set, so no value is read into it.\n const sections = APPLICATION_SECRET_KINDS.map((kind) => [kind, readLocalApplicationSecretPresence(envName, kind)] as const);\n return {\n stored: Object.fromEntries(sections.map(([kind, presence]) => [kind, new Set(presence.stored)])) as unknown as StoredApplicationSecrets,\n present: Object.fromEntries(sections.map(([kind, presence]) => [kind, new Set(presence.present)])) as unknown as StoredApplicationSecrets,\n };\n}\n\n/**\n * How the environment addresses each system of record, from its GENERATED config — the file the env builder\n * reads to decide what reaches the backend — or `null` when it cannot be read.\n */\nfunction readSystemOfRecordPresence(envName: string): Readonly<Record<string, SystemOfRecordEnvironmentPresence>> | null {\n let config: PlatformEnvConfigJson | null;\n try {\n config = EnvironmentUtils.loadConfigJson(envName);\n } catch {\n return null;\n }\n if (!config) return null;\n return systemOfRecordPresenceOf(config.systemsOfRecord);\n}\n\n/** One secret's identity across kinds: a name is unique per `secrets.json` section, not across them. */\nconst secretKey = (kind: ApplicationSecretKind, envVarName: string): string => `${kind}:${envVarName}`;\n\n/**\n * What the application needs in one environment, and what is set there. Pass `inputs` when describing\n * several environments, so the application is loaded once (`loadSecretRequirementInputs` with its owners).\n */\nexport async function describeEnvironmentSecrets(saasRoot: string, envName: string, inputs?: SecretRequirementInputs): Promise<EnvironmentSecretsReport> {\n const locationType = resolveEnvironmentLocation(envName);\n const loaded = inputs ?? await loadSecretRequirementInputs(saasRoot, { withOwners: true });\n const incomplete = loaded.owners?.incomplete ?? [];\n const systemOfRecordPresence = readSystemOfRecordPresence(envName);\n if (locationType === WildoLocationType.LOCAL) {\n const requirements = await loadSecretRequirements({ saasRoot, inputs: loaded, ...readLocalStoredSecrets(envName), systemOfRecordPresence });\n return { envName, locationType, requirements, incomplete };\n }\n const remote = new Map(listRemoteApplicationSecrets(envName, saasRoot).map((secret) => [secretKey(secret.kind, secret.envVarName), secret]));\n const stored = Object.fromEntries(APPLICATION_SECRET_KINDS.map((kind) => [\n kind,\n new Set([...remote.values()].filter((secret) => secret.kind === kind).map((secret) => secret.envVarName)),\n ])) as unknown as StoredApplicationSecrets;\n const requirements = await loadSecretRequirements({ saasRoot, inputs: loaded, stored, systemOfRecordPresence });\n return {\n envName,\n locationType,\n requirements: requirements.map((row) => {\n const held = remote.get(secretKey(row.kind, row.envVarName));\n return held ? { ...row, remoteLevel: held.level } : row;\n }),\n incomplete,\n };\n}\n\n/**\n * The requirement a name refers to, refused when nothing the application declares reads it — a key no\n * runtime would receive is a typo or a stale name.\n *\n * A NAME is not an identity: each kind is its own `secrets.json` section, and a migration can leave one key in\n * two (an Odoo credential still in `providerEnv` beside its `systemsOfRecordEnv` copy). So `kind` narrows the\n * match, and a name matching in two kinds without one is refused, naming both, rather than resolved to\n * whichever sorted first — which set or removed the other copy than the one the person meant.\n *\n * One exception, for a name whose OWNER exists but could not be enumerated: an inbound endpoint secret when\n * the backend's endpoints could not be read (it is not built), and a system-of-record slot when its vendor's\n * facet could not be. A well-formed name for such an owner is admitted, because refusing it would make the\n * secret impossible to provide until something unrelated is fixed — the env builder delivers any well-formed\n * name, and the backend is where an endpoint without its secret is reported.\n */\nfunction requirementFor(report: EnvironmentSecretsReport, inputs: SecretRequirementInputs, envVarName: string, kind?: ApplicationSecretKind): SecretRequirement {\n const matches = report.requirements\n .filter((candidate) => candidate.envVarName === envVarName && (kind === undefined || candidate.kind === kind))\n .sort((left, right) => left.kind.localeCompare(right.kind));\n if (matches.length > 1) {\n throw new Error(`${envVarName} is in more than one section of this environment's secrets (${matches.map((row) => `${row.kind}: ${row.standing}`).join(', ')}). `\n + `Name the one you mean with --kind ${matches.map((row) => row.kind).join(' | ')}.`);\n }\n if (matches[0]) return matches[0];\n const owners = inputs.owners;\n const endpoint = kind === undefined || kind === ApplicationSecretKind.INBOUND_ENDPOINT ? parseInboundEndpointSecretEnvVarName(envVarName) : null;\n if (endpoint && owners?.inboundEndpointKeys === null) {\n return unenumeratedOwnerRow(envVarName, ApplicationSecretKind.INBOUND_ENDPOINT, endpoint.endpointKey);\n }\n const slot = kind === undefined || kind === ApplicationSecretKind.SYSTEM_OF_RECORD ? parseSystemOfRecordEnvVarName(envVarName) : null;\n if (slot && owners?.systemsOfRecord.some((system) => system.name === slot.instanceName && system.secretSlots === null)) {\n return unenumeratedOwnerRow(envVarName, ApplicationSecretKind.SYSTEM_OF_RECORD, slot.instanceName);\n }\n const known = [...new Set(report.requirements.filter((candidate) => kind === undefined || candidate.kind === kind).map((candidate) => candidate.envVarName))];\n throw new Error(`Nothing this application declares reads ${envVarName}${kind === undefined ? '' : ` as a ${kind} secret`}. Known here: ${known.join(', ') || 'none'}.`);\n}\n\nfunction unenumeratedOwnerRow(envVarName: string, kind: ApplicationSecretKind, ownerRef: string): SecretRequirement {\n return {\n envVarName, kind, ownerRef, description: null, required: true, capabilities: [], runtimes: ['backend'],\n standing: ApplicationSecretStanding.NEEDED, creationEssential: false,\n };\n}\n\nexport interface SecretChangeOutcome {\n readonly envVarName: string;\n /** Which `secrets.json` section (or, remotely, which GitHub secret prefix) the change was made in. */\n readonly kind: ApplicationSecretKind;\n readonly envName: string;\n /**\n * Local only: the runtimes asked to restart to read the change — those that read the key AND run under\n * a LIVE supervisor of `wildo local dev`. A signal file outlives the stack, so its existence alone is\n * not a restart; a runtime nobody supervises reads the key at its next start.\n */\n readonly restartSignalledRuntimes: readonly string[];\n /** Local only: whether the runtimes' `.env` files were regenerated. */\n readonly envFilesRegenerated: boolean;\n /** Local only: why the `.env` files could not be regenerated, with what to run; `null` otherwise. */\n readonly envFilesRegenerationFailure: string | null;\n /**\n * Local only: the companion reads this key and was NOT asked to restart, because the caller said it\n * applies the change itself (`--no-companion-restart`). The workbench does, in-process: restarting\n * the companion from inside a request would end the process serving it and any run in flight.\n */\n readonly companionAppliesChange: boolean;\n /**\n * Local only: the RUNNING companion loaded the change in place, through `POST /api/companion/runtime/env/apply`,\n * so it was not restarted and no run in flight was ended. False when it reads no such key, is not running,\n * or the caller applies the change itself.\n */\n readonly companionLoadedInProcess: boolean;\n /**\n * Local only: the companion is running and reads this key, but could not be made to load it — with what to\n * do. `null` when nothing failed. Distinct from the workbench's `companionApplyFailure`, which the COMPANION\n * sets about its own in-process apply.\n */\n readonly companionLoadFailure: string | null;\n /**\n * The environment's rows AFTER the change, re-derived from the same application inputs the change was\n * checked against (#1782). One change can move OTHER rows too: setting one LLM provider's key can make a\n * competing provider's key no longer needed. A caller holding a listing replaces that environment's rows\n * with these instead of re-listing, which re-loads the application and takes tens of seconds.\n *\n * `null` when they could not be read after the change was MADE — for a remote environment that is one\n * more `gh` listing, which a network error, a rate limit or an expired token can fail. The change itself\n * stands, and a caller holding a listing drops it instead of patching it.\n */\n readonly environmentAfterChange: EnvironmentSecretsReport | null;\n}\n\n/**\n * The environment's rows after a change that has ALREADY been written. A failure here must never turn the\n * completed change into a reported failure: the person would be told \"not changed\" about a secret that was.\n */\nasync function describeAfterChange(saasRoot: string, envName: string, inputs: SecretRequirementInputs): Promise<EnvironmentSecretsReport | null> {\n try {\n return await describeEnvironmentSecrets(saasRoot, envName, inputs);\n } catch {\n return null;\n }\n}\n\n/** Options every change takes. */\nexport interface SecretChangeOptions {\n /** Which `secrets.json` section the name is in — needed only when it is in more than one (see `requirementFor`). */\n readonly kind?: ApplicationSecretKind;\n /**\n * Whether a change the companion reads restarts it (default). The workbench passes `false` and applies\n * the change in-process — see {@link SecretChangeOutcome.companionAppliesChange}.\n */\n readonly restartCompanion?: boolean;\n}\n\n/** The scope path the dev companion is read under (`providers.scopes.companion`). */\nconst COMPANION_RUNTIME = 'companion';\n\n/** The companion's folder under `.wildo-saas/`, which names its supervisor signal file. */\nconst COMPANION_SIGNAL_FOLDER = 'wildo-dev-companion';\n\n/** Is the pid alive (EPERM means alive and someone else's)? */\nfunction isProcessAlive(pid: unknown): boolean {\n if (typeof pid !== 'number' || !Number.isInteger(pid) || pid <= 0) return false;\n try {\n process.kill(pid, 0);\n return true;\n } catch (error) {\n return (error as NodeJS.ErrnoException).code === 'EPERM';\n }\n}\n\n/**\n * The restart signal of the runtime a LIVE `wildo local dev` supervisor runs under this label, or `null`.\n *\n * Its published observation (`runtime-signals/supervisors/<label>.json`, label = the runtime's folder) must name a\n * producer that is alive, and the file must exist. Which file: the one the record DECLARES (`signalFilePath`) — the\n * monorepo's `runtime-supervisor.mjs` and `wildo-dev-runtime serve` (since #2134, which is what brings a changed key to a\n * created application's backend) each declare theirs. A record declaring `null` honours no request, so nothing is\n * touched: the app-creator companion's supervisor declares `null` (#2149), since that companion loads the key in place. A record with no such field (a writer predating it) falls back to the conventional\n * `runtime-signals/<label>.signal`. A declared path outside the application's runtime-signals home is ignored: the CLI\n * touches only files of that home.\n */\nfunction liveSupervisorSignalFile(saasRoot: string, folder: string): string | null {\n const signalDir = join(saasRoot, '.wildo-saas', 'runtime-signals');\n let observation: { producerPid?: unknown; signalFilePath?: unknown };\n try {\n observation = JSON.parse(readFileSync(join(signalDir, 'supervisors', `${folder}.json`), 'utf8')) as typeof observation;\n } catch {\n return null;\n }\n if (!isProcessAlive(observation.producerPid)) return null;\n if (observation.signalFilePath === null) return null;\n if (typeof observation.signalFilePath !== 'string' || observation.signalFilePath.length === 0) {\n const conventional = join(signalDir, `${folder}.signal`);\n return existsSync(conventional) ? conventional : null;\n }\n const declared = resolve(saasRoot, observation.signalFilePath);\n // Compared as REAL paths, so a symlinked application root and a symlink inside the home pointing out are both judged by\n // where the file really is. A file that vanishes while it is read is no signal: the change is already written, and\n // must not be reported as failed.\n let within: string;\n try {\n within = relative(realpathSync(signalDir), realpathSync(declared));\n } catch {\n return null;\n }\n if (within.length === 0 || within.startsWith('..') || isAbsolute(within)) return null;\n return declared;\n}\n\n/**\n * The signal file whose touch restarts a supervised runtime, per scope path (`backend`, `companion`,\n * `<family>.<key>`). Looked up by the service's folder, the label every generated `dev` script passes its\n * supervisor; the companion's is fixed. Only runtimes a live supervisor runs are returned.\n */\nexport async function runtimeSignalFiles(saasRoot: string, runtimes: readonly string[]): Promise<Map<string, string>> {\n const config = await loadSaasConfig(join(saasRoot, WORKSPACE_CONFIG_NAMES.SAAS)) as {\n services?: Record<string, { path?: string; frontendType?: unknown }>;\n minions?: Record<string, { path?: string }>;\n workers?: Record<string, { path?: string }>;\n };\n const byFolder = new Map<string, string>();\n const add = (folder: string | undefined): void => {\n if (!folder) return;\n const name = basename(folder);\n const file = liveSupervisorSignalFile(saasRoot, name);\n if (file !== null) byFolder.set(name, file);\n };\n for (const runtime of runtimes) {\n if (runtime === COMPANION_RUNTIME) add(COMPANION_SIGNAL_FOLDER);\n else if (runtime === 'backend') {\n for (const service of Object.values(config.services ?? {})) if (service.frontendType === undefined) add(service.path);\n } else {\n const [family, key] = runtime.split('.') as [string, string];\n const source = family === 'minions' ? config.minions : family === 'workers' ? config.workers : config.services;\n add(source?.[key]?.path);\n }\n }\n return byFolder;\n}\n\n/**\n * Run this CLI's own `config sync --domain <domain>` for one environment, as one child run. A failure is\n * REPORTED, never swallowed: the value is already in `secrets.json`, and without the regeneration nothing\n * can read it, which the person must be told along with what to run.\n */\nexport function runConfigSyncDomain(\n saasRoot: string,\n envName: string,\n domain: 'env-files' | 'manifest',\n): { readonly regenerated: boolean; readonly failure: string | null } {\n /*\n * `--force` is required, not a convenience. Without it a non-interactive `config sync` finds the\n * existing files, prints \"Skipping env-files regeneration in non-interactive mode\" and EXITS 0 — so\n * every local change reported `envFilesRegenerated: true` and restarted its runtimes on the OLD `.env`\n * (measured 2026-09-26: a key set from the workbench reached `secrets.json` and no `.env`). The prompt\n * that skip replaces asks \"overwrite the existing env files?\", and changing a secret is a request to\n * do exactly that. `--force` skips confirmations only; secret rotation needs `--rotate-secrets`.\n */\n const args = ['config', 'sync', '--domain', domain, '--env', envName, '--non-interactive', '--force'];\n const result = spawnSync(process.execPath, [process.argv[1]!, ...args], { cwd: saasRoot, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });\n if (result.status === 0) return { regenerated: true, failure: null };\n const lastLine = `${result.stderr ?? ''}\\n${result.stdout ?? ''}`\n .split('\\n')\n .map((line) => line.replace(/\\u001b\\[[0-9;]*m/g, '').trim())\n .filter((line) => line.length > 0)\n .at(-1);\n const what = domain === 'env-files' ? \"the runtimes' .env files were\" : 'the deployment manifests were';\n return {\n regenerated: false,\n failure: `The value is saved, but ${what} not regenerated${lastLine ? ` (${lastLine})` : ''}. Run \\`wildo ${args.join(' ')}\\`, then restart what reads it.`,\n };\n}\n\n/** Regenerate the local runtimes' `.env` files — what every application runtime reads. */\nexport function regenerateEnvFiles(saasRoot: string, envName: string): { readonly regenerated: boolean; readonly failure: string | null } {\n return runConfigSyncDomain(saasRoot, envName, 'env-files');\n}\n\n/** The companion route that loads named variables of its regenerated `.env` into the running process. */\nexport const COMPANION_RUNTIME_ENV_APPLY_PATH = '/api/companion/runtime/env/apply';\n\n/** Long enough for a registry refresh on a loaded machine; short enough that a hung companion does not hold `set`. */\nconst COMPANION_ENV_APPLY_TIMEOUT_MS = 20_000;\n\n/** What asking the running companion to load a changed variable came to. */\ntype CompanionLoadResult =\n | { readonly kind: 'loaded' }\n | { readonly kind: 'not-running' }\n | { readonly kind: 'failed'; readonly failure: string };\n\n/**\n * Ask the RUNNING companion to load one changed variable from the `.env` just regenerated (#1637).\n *\n * The answer to a key that \"is set\" and still refused: the companion reads its `.env` once, at boot, and in\n * a created application nothing supervises it (it runs as plain `node --env-file-if-exists=.env` under\n * `pnpm -r run dev`), so there is no signal file to touch and no restart to ask for. Loading in place works\n * whether or not a supervisor exists, and it spares every run in flight, which a restart would end.\n *\n * Only the NAME is sent; the companion reads the value from its own `.env`.\n *\n * Unreachable (refused connection, no token because it never booted) is `not-running`: it then reads the key\n * at its next start, which is what would happen anyway. Anything else is `failed`, including a 404 from a\n * companion older than this route and a timeout.\n */\nasync function loadInRunningCompanion(saasRoot: string, envVarName: string): Promise<CompanionLoadResult> {\n const addresses = await loadAppLocalRuntimeServiceAddresses(saasRoot).catch(() => null);\n const options = {\n appRoot: saasRoot,\n baseUrl: addresses?.devCompanion?.url,\n port: addresses?.devCompanion?.port,\n timeoutMs: COMPANION_ENV_APPLY_TIMEOUT_MS,\n };\n try {\n await CompanionClient.post(COMPANION_RUNTIME_ENV_APPLY_PATH, { envVarNames: [envVarName] }, options);\n return { kind: 'loaded' };\n } catch (error) {\n /*\n * \"Not running\" is exactly what the client already calls UNREACHABLE — a refused or reset connection, or\n * no token because the companion never booted — so the one classifier decides both. Anything else (a\n * timeout, a hung companion, an unreadable token) is a companion that may hold the old value: a failure.\n */\n if (companionFailureExitCode(error) === COMPANION_UNREACHABLE_EXIT_CODE) return { kind: 'not-running' };\n const restart = `restart \\`wildo local dev\\` so it reads the new value.`;\n if (error instanceof CompanionRefusalError && error.status === 404) {\n return { kind: 'failed', failure: `The running companion is older than this CLI and cannot load ${envVarName} in place; ${restart}` };\n }\n return { kind: 'failed', failure: `The running companion could not load ${envVarName} (${ErrorUtils.extractErrorMessage(error)}); ${restart}` };\n }\n}\n\n/**\n * Regenerate the `.env` files and bring the change to the runtimes that receive the key. ALWAYS regenerated,\n * an UNUSED key included: unconsumed is not undelivered (the companion's `.env` carries every provider key),\n * and a removal that skipped this left the value on disk and in the running process (#1637 review, H1).\n *\n * The companion is asked to LOAD the key in place first; only when it is not running, or could not, is it\n * signalled to restart like the other runtimes. Every other runtime is restarted through its supervisor's\n * signal file.\n */\nasync function applyLocalChange(saasRoot: string, envName: string, row: SecretRequirement, options: SecretChangeOptions): Promise<Omit<SecretChangeOutcome, 'environmentAfterChange'>> {\n const restartCompanion = options.restartCompanion !== false;\n const readsKey = row.runtimes.includes(COMPANION_RUNTIME);\n const companionAppliesChange = !restartCompanion && readsKey;\n const identity = { envVarName: row.envVarName, kind: row.kind, envName };\n const regeneration = regenerateEnvFiles(saasRoot, envName);\n const signalled: string[] = [];\n let companionLoad: CompanionLoadResult | null = null;\n if (regeneration.regenerated) {\n if (restartCompanion && readsKey) companionLoad = await loadInRunningCompanion(saasRoot, row.envVarName);\n const companionHandled = !restartCompanion || companionLoad?.kind === 'loaded';\n const now = new Date();\n const runtimes = row.runtimes.filter((runtime) => !companionHandled || runtime !== COMPANION_RUNTIME);\n for (const [folder, file] of await runtimeSignalFiles(saasRoot, runtimes)) {\n utimesSync(file, now, now);\n signalled.push(folder);\n }\n }\n return {\n ...identity,\n restartSignalledRuntimes: signalled,\n envFilesRegenerated: regeneration.regenerated,\n envFilesRegenerationFailure: regeneration.failure,\n companionAppliesChange,\n companionLoadedInProcess: companionLoad?.kind === 'loaded',\n // A supervised companion restarted instead has received the change, so the failure is not worth saying.\n companionLoadFailure: companionLoad?.kind === 'failed' && !signalled.includes(COMPANION_SIGNAL_FOLDER) ? companionLoad.failure : null,\n };\n}\n\nconst REMOTE_OUTCOME = {\n restartSignalledRuntimes: [],\n envFilesRegenerated: false,\n envFilesRegenerationFailure: null,\n companionAppliesChange: false,\n companionLoadedInProcess: false,\n companionLoadFailure: null,\n} as const;\n\n/**\n * Set one secret in one environment, in the section its kind names. The value is validated, never logged.\n *\n * A key holding a PEM (`…PRIVATE_KEY`, `…CERTIFICATE`, a system of record's `certificatePem`) pasted on one\n * line with literal `\\n` is turned into real line breaks locally, exactly as the CI adapter does when it reads\n * the same secret remotely (`normalizePotentialMultilineSecret`), so both lanes hand a runtime the same\n * bytes. A remote value is stored as given, because that adapter normalizes it on the way out.\n *\n * An UNUSED key is refused: nothing consumes it, so a new value would change nothing a runtime does.\n */\nexport async function setApplicationSecret(\n saasRoot: string,\n envName: string,\n envVarName: string,\n value: string,\n options: SecretChangeOptions = {},\n): Promise<SecretChangeOutcome> {\n const inputs = await loadSecretRequirementInputs(saasRoot, { withOwners: true });\n const report = await describeEnvironmentSecrets(saasRoot, envName, inputs);\n const row = requirementFor(report, inputs, envVarName, options.kind);\n if (row.standing === ApplicationSecretStanding.UNUSED) {\n throw new Error(`Nothing consumes ${envVarName}, so setting it would change nothing. Remove it with \\`wildo secrets unset ${envVarName}\\`.`);\n }\n const problem = describeSecretValueProblem(envVarName, value, true);\n if (problem) throw new Error(problem);\n if (report.locationType === WildoLocationType.LOCAL) {\n updateLocalApplicationSecrets(envName, row.kind, { set: { [envVarName]: normalizePotentialMultilineSecret(envVarName, value.trim()) } });\n return { ...(await applyLocalChange(saasRoot, envName, row, options)), environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n }\n const gap = describeDeployWorkflowGap(envName, row.kind, envVarName, saasRoot);\n if (gap) throw new Error(gap);\n setRemoteApplicationSecret(envName, row.kind, envVarName, value.trim(), saasRoot);\n return { envVarName, kind: row.kind, envName, ...REMOTE_OUTCOME, environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n}\n\n/** Remove one secret from one environment — including an UNUSED one, which is what that standing is for. */\nexport async function unsetApplicationSecret(\n saasRoot: string,\n envName: string,\n envVarName: string,\n options: SecretChangeOptions = {},\n): Promise<SecretChangeOutcome> {\n const inputs = await loadSecretRequirementInputs(saasRoot, { withOwners: true });\n const report = await describeEnvironmentSecrets(saasRoot, envName, inputs);\n const row = requirementFor(report, inputs, envVarName, options.kind);\n if (report.locationType === WildoLocationType.LOCAL) {\n updateLocalApplicationSecrets(envName, row.kind, { unset: [envVarName] });\n return { ...(await applyLocalChange(saasRoot, envName, row, options)), environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n }\n unsetRemoteApplicationSecret(envName, row.kind, envVarName, saasRoot);\n return { envVarName, kind: row.kind, envName, ...REMOTE_OUTCOME, environmentAfterChange: await describeAfterChange(saasRoot, envName, inputs) };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"provider-env-vars.utils.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials/provider-env-vars.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AASnH,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,oBAAY,wBAAwB;IAClC;;;;OAIG;IACH,2BAA2B,gCAAgC;IAC3D;;;;;OAKG;IACH,QAAQ,aAAa;CACtB;AAED,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC,2BAA2B,CAAA;CAAE,GACvE;IAAE,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC,QAAQ,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAEnG;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,oBAAoB,CAc3F;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,IAAI,oBAAoB,CAEpE;AA6CD;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C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ACjD,iFAAiF;IACjF,gBAAgB,qBAAqB;IACrC,0FAA0F;IAC1F,sBAAsB,2BAA2B;CAClD;AAED,MAAM,MAAM,wBAAwB,GAChC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACxF;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,qBAAqB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvF,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,YAAY,EAAE,oBAAoB,CAAC;IACnC,8FAA8F;IAC9F,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,6FAA6F;IAC7F,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,qBAAqB,GAAG,wBAAwB,CA+ExF"}
1
+ {"version":3,"file":"provider-env-vars.utils.d.ts","sourceRoot":"","sources":["../../../../src/services/credentials/provider-env-vars.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AASnH,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH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,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,qBAAqB,GAAG,wBAAwB,CA+ExF"}
@@ -180,8 +180,10 @@ export function getProtocolSecretEnvBindings(providerRef, protocol, configuredPr
180
180
  pushSecret(runtimeContract.apiKey.secretRef);
181
181
  break;
182
182
  case ProviderProtocolRuntimeKind.ELECTRONIC_SIGNATURE:
183
- // An electronic-signature vendor (#2293): one API key in a header, like the classifier above.
183
+ // An electronic-signature vendor (#2293): one API key in a header, like the classifier above, or the JWT-grant key it
184
+ // is exchanged from; and, for a vendor whose base URL differs per account (DocuSign), the slot that holds it.
184
185
  pushSecret(runtimeContract.apiKey.secretRef);
186
+ pushSecret(runtimeContract.baseUrlEnvVarName);
185
187
  break;
186
188
  case ProviderProtocolRuntimeKind.EMAIL:
187
189
  // The `email` runtime contract is a discriminated union on `delivery`: