@wildo-ai/platform-config-lib 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts +49 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js +36 -2
- package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +2 -3
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js +2 -3
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.d.ts +0 -1
- package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.js +0 -2
- package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
- package/dist/esm/config-authoring.entry.d.ts +1 -2
- package/dist/esm/config-authoring.entry.d.ts.map +1 -1
- package/dist/esm/config-authoring.entry.js +35 -2
- package/dist/esm/config-authoring.entry.js.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +0 -20
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +0 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.d.ts +3 -39
- package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.js +2 -2
- package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/define-saas-config.d.ts +366 -14
- package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-saas-config.js +121 -11
- package/dist/esm/project-config/define-saas-config.js.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.d.ts +74 -1
- package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.js +203 -6
- package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts +41 -15
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.js +75 -6
- package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts +7 -43
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.js +13 -30
- package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.d.ts +36 -5
- package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.js +65 -5
- package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.d.ts +46 -10
- package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.js +45 -10
- package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.d.ts +8 -6
- package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js +7 -5
- package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +18 -3
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.js +34 -2
- package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +0 -2
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +0 -2
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.d.ts +70 -10
- package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.js +75 -11
- package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts +15 -15
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js +15 -15
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts +30 -0
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.js +31 -0
- package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +14 -0
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.js +2 -0
- package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -7
|
@@ -75,16 +75,14 @@ export function k8sServiceConfigMapName(service) {
|
|
|
75
75
|
* (`k8s-secrets-generator.service.ts` § 5) calls this helper with the app's
|
|
76
76
|
* backend `serviceName`.
|
|
77
77
|
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* template's secret name or pinning the emit to the canonical app identity —
|
|
87
|
-
* see `.claude/plans/self-host-domain-subdomain-model.md`.
|
|
78
|
+
* The name-mismatch gap this JSDoc used to warn about is CLOSED (#377): the templates no longer
|
|
79
|
+
* spell a Secret name at all — each receives the resolved `{{runtimeEnvSecretName}}` from
|
|
80
|
+
* {@link k8sRuntimeEnvSecretName}, which is the same function the emit side calls. The mount stays
|
|
81
|
+
* fail-closed (no `optional: true`), so were the two ever to diverge again the pod would refuse to
|
|
82
|
+
* boot rather than start without its environment.
|
|
83
|
+
*
|
|
84
|
+
* ⚠️ Still true: the K8s app lane has never had a live cluster run. What is verified is that emit
|
|
85
|
+
* and mount agree, pinned from both sides.
|
|
88
86
|
*
|
|
89
87
|
* Application backends emit a single Secret per app (no companion ConfigMap):
|
|
90
88
|
* envFrom mounts every entry as `process.env.*`, so splitting sensitive vs
|
|
@@ -92,6 +90,72 @@ export function k8sServiceConfigMapName(service) {
|
|
|
92
90
|
* See `k8s-secrets-generator.service.ts` § 5 for the design note.
|
|
93
91
|
*/
|
|
94
92
|
export function k8sAppBackendSecretName(serviceName) {
|
|
95
|
-
return
|
|
93
|
+
return k8sRuntimeEnvSecretName(serviceName);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* K8s Secret name carrying ONE runtime's ENVIRONMENT: `<runtimeServiceName>-secret`.
|
|
97
|
+
*
|
|
98
|
+
* The companion of {@link k8sRuntimeProvidersSecretName} — that one carries a runtime's provider
|
|
99
|
+
* CREDENTIALS, this one everything else it boots with. Same keying: the app slug for the backend
|
|
100
|
+
* pod, {@link buildMinionServiceName} / {@link buildWorkerServiceName} for a minion or worker.
|
|
101
|
+
*
|
|
102
|
+
* ## Why minions and workers stopped sharing the backend's (issue #377)
|
|
103
|
+
*
|
|
104
|
+
* Every minion and worker pod used to `envFrom`-mount the BACKEND's `{appSlug}-secret`, so each
|
|
105
|
+
* received the backend's whole environment: the platform bootstrap contract, MongoDB / PostgreSQL /
|
|
106
|
+
* Redis / RabbitMQ topology, storage configuration — and, once #360 composed it, the backend's
|
|
107
|
+
* `OTEL_EXPORTER_OTLP_HEADERS`, which carries the telemetry provider's token. So the per-runtime
|
|
108
|
+
* confinement that #329, #360 and #369 established was defeated one level up: a minion scoped to
|
|
109
|
+
* `openai` alone got no telemetry token in its own provider Secret and received it anyway, from a
|
|
110
|
+
* different runtime's environment.
|
|
111
|
+
*
|
|
112
|
+
* `buildApplicationMinionEnv` and `buildApplicationWorkerEnv` already existed, already took a
|
|
113
|
+
* `RuntimeProviderScope`, and already produced the correctly-scoped environment for the compose
|
|
114
|
+
* lane. The Kubernetes lane simply never called them.
|
|
115
|
+
*
|
|
116
|
+
* ## Every mount name is now resolved here, including the backend's
|
|
117
|
+
*
|
|
118
|
+
* `k8sAppBackendSecretName` delegates rather than repeating `${x}-secret`, so there is ONE format
|
|
119
|
+
* string for this concept. The templates receive the resolved name as `{{runtimeEnvSecretName}}`
|
|
120
|
+
* and no longer compose `{{appName}}-secret` themselves — which is what the older JSDoc on
|
|
121
|
+
* `k8sAppBackendSecretName` warned about, from the era when a template hardcoded a name the emit
|
|
122
|
+
* never produced and the pod failed closed at boot.
|
|
123
|
+
*
|
|
124
|
+
* Unlike the provider Secret, this mount is NOT `optional`: a runtime cannot boot without its
|
|
125
|
+
* environment, and a missing one must fail loudly rather than start a pod that cannot work.
|
|
126
|
+
*/
|
|
127
|
+
export function k8sRuntimeEnvSecretName(runtimeServiceName) {
|
|
128
|
+
return `${runtimeServiceName}-secret`;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* K8s Secret name carrying ONE runtime's provider credentials:
|
|
132
|
+
* `<runtimeServiceName>-providers-secret`.
|
|
133
|
+
*
|
|
134
|
+
* `runtimeServiceName` is the runtime's own DNS name — the app slug for the backend pod,
|
|
135
|
+
* {@link buildMinionServiceName} / {@link buildWorkerServiceName} for a minion or worker — so every
|
|
136
|
+
* application runtime gets its own Secret and no two can collide.
|
|
137
|
+
*
|
|
138
|
+
* ## Why this replaced one shared `providers-secret` (issue #369)
|
|
139
|
+
*
|
|
140
|
+
* There used to be a single cluster-wide `providers-secret` holding the application's ENTIRE
|
|
141
|
+
* `providerEnv`, `envFrom`-mounted by the backend, every minion AND every worker. `envFrom` merges,
|
|
142
|
+
* so a provider key the per-app Secret withheld arrived from that second reference: on Kubernetes a
|
|
143
|
+
* worker authoring `providers: {}` received every provider key the application had, in its process
|
|
144
|
+
* environment, which is exactly what LLM-driven minion code reads. The per-runtime confinement
|
|
145
|
+
* (#329) held in the compose lane and did not exist here at all — one contract, two deployment
|
|
146
|
+
* lanes, one swept.
|
|
147
|
+
*
|
|
148
|
+
* **The name is a function, not a format string repeated in a template, and that is the point.**
|
|
149
|
+
* This file already carries a scar from the other direction: `k8sAppBackendSecretName` documents a
|
|
150
|
+
* mount whose name the template hardcodes, and a mismatch there means a pod that cannot boot. Here
|
|
151
|
+
* the emit side (`k8s-secrets-generator.service.ts`) and the mount side (the three
|
|
152
|
+
* `*.deployment.yaml.hbs` renderers) both call THIS function, and the templates receive the
|
|
153
|
+
* resolved name as `{{providersSecretName}}` rather than composing it themselves.
|
|
154
|
+
*
|
|
155
|
+
* The mount stays `optional: true`: a runtime that declares no providers gets no Secret emitted,
|
|
156
|
+
* which is the correct outcome and must not fail pod start.
|
|
157
|
+
*/
|
|
158
|
+
export function k8sRuntimeProvidersSecretName(runtimeServiceName) {
|
|
159
|
+
return `${runtimeServiceName}-providers-secret`;
|
|
96
160
|
}
|
|
97
161
|
//# sourceMappingURL=k8s-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"k8s-utils.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/k8s-utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe,EAAE,IAAY,EAAE,SAAiB;IAClF,OAAO,UAAU,OAAO,IAAI,SAAS,sBAAsB,IAAI,EAAE,CAAC;AACpE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe,EAAE,SAAiB;IACrE,OAAO,GAAG,OAAO,IAAI,SAAS,oBAAoB,CAAC;AACrD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe,EAAE,YAAoB;IACrE,OAAO,WAAW,OAAO,IAAI,YAAY,EAAE,CAAC;AAC9C,CAAC;AAgCD;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAA+B;IACpE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;IAC1D,6EAA6E;IAC7E,8EAA8E;IAC9E,8EAA8E;IAC9E,4EAA4E;IAC5E,+EAA+E;IAC/E,4EAA4E;IAC5E,6CAA6C;IAC7C,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;IACpE,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,YAAY,EAAE,CAAC;AAChE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAA+B;IACnE,OAAO,WAAW,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,OAAO,GAAG,OAAO,SAAS,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAe;IACrD,OAAO,GAAG,OAAO,SAAS,CAAC;AAC7B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,uBAAuB,CAAC,WAAmB;IACzD,OAAO,GAAG,WAAW,SAAS,CAAC;AACjC,CAAC","sourcesContent":["/**\n * Kubernetes URL builders and naming conventions.\n * Single source of truth for constructing K8s-style addresses and resource names.\n *\n * Used by CLI (ServiceAddressResolver, K8s manifest gen) and apps-manager\n * (application lifecycle) to ensure consistent URL/naming patterns.\n */\n\n/**\n * Builds a K8s cluster-internal URL: `http://<service>.<namespace>.svc.cluster.local:<port>`\n */\nexport function buildK8sInternalUrl(service: string, port: number, namespace: string): string {\n return `http://${service}.${namespace}.svc.cluster.local:${port}`;\n}\n\n/**\n * Builds a K8s cluster-internal hostname (without scheme/port).\n */\nexport function buildK8sInternalHost(service: string, namespace: string): string {\n return `${service}.${namespace}.svc.cluster.local`;\n}\n\n/**\n * Builds an ingress-based public URL: `https://<service>.<publicDomain>`\n *\n * `publicDomain` is the runtime-agnostic external hostname (browsers /\n * reverse proxy / DNS terminate here). See `WildoInfraEnvConfig.publicDomain`.\n *\n * Used for PLATFORM services (apps-manager, module-registry, …) whose\n * subdomain is always the service name. Application services (frontends +\n * backend API) resolve their public host through {@link buildServicePublicHost}\n * so the operator's authored `serviceHosts` map wins.\n */\nexport function buildK8sPublicUrl(service: string, publicDomain: string): string {\n return `https://${service}.${publicDomain}`;\n}\n\n// ============================================================================\n// Application public-host resolution (serviceHosts-driven)\n// ============================================================================\n//\n// Single source of truth for an application service's PUBLIC hostname, shared\n// by every producer so ingress routing, `runtime.endPoints[*].publicUrl`, and\n// CORS never diverge (a divergence breaks the browser's next `fetch` on CORS —\n// see `.claude/plans/self-host-domain-subdomain-model.md`).\n//\n// The self-hosted, single-app, mono-env model: each service lives at a\n// subdomain of the operator's own `publicDomain`. Greenfield — there is NO\n// multi-tenant `{service}-{appSlug}-{env}` fan-out.\n//\n// - `serviceHosts[serviceKey]` authored → `<host>.<publicDomain>`\n// (`app` → `app.example.com`), or `<publicDomain>` when the authored value\n// is the empty string (apex — `''` → `example.com`).\n// - key NOT authored → `<serviceKey>.<publicDomain>`: the service key IS its\n// own subdomain, the same convention platform services use via\n// {@link buildK8sPublicUrl}. A DEFINED fallback (never a silent error — the\n// `serviceHosts` schema requires consumers handle \"not mapped\" explicitly).\n\nexport interface ServicePublicHostParams {\n /** The application service key (`config.services.<key>` / `serviceHosts` key). */\n serviceKey: string;\n /** Authored per-service subdomain map from `wildo.infra.<env>.config.ts`. */\n serviceHosts: Record<string, string> | undefined;\n /** The operator's public domain (`WildoInfraEnvConfig.publicDomain`). */\n publicDomain: string;\n}\n\n/**\n * Resolve an application service's PUBLIC hostname (no scheme). `serviceHosts`\n * wins; the service key is its own subdomain when unauthored; `''` = apex.\n * See the section header.\n */\nexport function buildServicePublicHost(params: ServicePublicHostParams): string {\n const { serviceKey, serviceHosts, publicDomain } = params;\n // Fallback uses the service key AS the subdomain, lowercased: DNS labels are\n // case-insensitive and Let's Encrypt / `new URL()` canonicalize to lowercase,\n // so a camelCase key like `backendApi` must become `backendapi` to round-trip\n // (and to match the ingress host). Authored serviceHosts values are already\n // lowercase-validated upstream (`SERVICE_HOST_LABEL`). NOTE: a config key with\n // a DNS-invalid char (e.g. `_`) still yields an invalid host — the operator\n // must author a `serviceHosts` entry for it.\n const host = serviceHosts?.[serviceKey] ?? serviceKey.toLowerCase();\n return host === '' ? publicDomain : `${host}.${publicDomain}`;\n}\n\n/**\n * Resolve an application service's PUBLIC URL (`https://<host>`), where the\n * host comes from {@link buildServicePublicHost}.\n */\nexport function buildServicePublicUrl(params: ServicePublicHostParams): string {\n return `https://${buildServicePublicHost(params)}`;\n}\n\n/**\n * K8s Secret name for a platform service: `<service>-secret`\n */\nexport function k8sServiceSecretName(service: string): string {\n return `${service}-secret`;\n}\n\n/**\n * K8s ConfigMap name for a platform service: `<service>-config`\n */\nexport function k8sServiceConfigMapName(service: string): string {\n return `${service}-config`;\n}\n\n/**\n * K8s Secret name for an app backend: `<serviceName>-secret`\n *\n * The emitted name MUST match the `envFrom: secretRef.name` the application\n * deployment template mounts. The CLI static emit lane\n * (`k8s-secrets-generator.service.ts` § 5) calls this helper with the app's\n * backend `serviceName`.\n *\n * ⚠️ KNOWN GAP — the K8s app lane is not yet runtime-verified (no live cluster\n * run). `wildo-ai-application/deployment.yaml.hbs` hardcodes the mount name\n * `wildo-ai-application-secret` (and the image `wildo-ai-application:{{imageTag}}`),\n * i.e. the manifests assume one canonical app identity, while this helper is\n * called with the app's REAL backend `serviceName` (e.g.\n * `wonder-todos-backend-api`). The two only line up when the backend is literally\n * named `wildo-ai-application`. The mount is fail-closed (no `optional: true`),\n * so a mismatch means the pod cannot boot. Resolve by either parameterizing the\n * template's secret name or pinning the emit to the canonical app identity —\n * see `.claude/plans/self-host-domain-subdomain-model.md`.\n *\n * Application backends emit a single Secret per app (no companion ConfigMap):\n * envFrom mounts every entry as `process.env.*`, so splitting sensitive vs\n * non-sensitive added zero runtime value and fragmented the canonical sink.\n * See `k8s-secrets-generator.service.ts` § 5 for the design note.\n */\nexport function k8sAppBackendSecretName(serviceName: string): string {\n return `${serviceName}-secret`;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"k8s-utils.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/k8s-utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe,EAAE,IAAY,EAAE,SAAiB;IAClF,OAAO,UAAU,OAAO,IAAI,SAAS,sBAAsB,IAAI,EAAE,CAAC;AACpE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe,EAAE,SAAiB;IACrE,OAAO,GAAG,OAAO,IAAI,SAAS,oBAAoB,CAAC;AACrD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe,EAAE,YAAoB;IACrE,OAAO,WAAW,OAAO,IAAI,YAAY,EAAE,CAAC;AAC9C,CAAC;AAgCD;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAA+B;IACpE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;IAC1D,6EAA6E;IAC7E,8EAA8E;IAC9E,8EAA8E;IAC9E,4EAA4E;IAC5E,+EAA+E;IAC/E,4EAA4E;IAC5E,6CAA6C;IAC7C,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;IACpE,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,YAAY,EAAE,CAAC;AAChE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAA+B;IACnE,OAAO,WAAW,sBAAsB,CAAC,MAAM,CAAC,EAAE,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,OAAO,GAAG,OAAO,SAAS,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAe;IACrD,OAAO,GAAG,OAAO,SAAS,CAAC;AAC7B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,uBAAuB,CAAC,WAAmB;IACzD,OAAO,uBAAuB,CAAC,WAAW,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,uBAAuB,CAAC,kBAA0B;IAChE,OAAO,GAAG,kBAAkB,SAAS,CAAC;AACxC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,6BAA6B,CAAC,kBAA0B;IACtE,OAAO,GAAG,kBAAkB,mBAAmB,CAAC;AAClD,CAAC","sourcesContent":["/**\n * Kubernetes URL builders and naming conventions.\n * Single source of truth for constructing K8s-style addresses and resource names.\n *\n * Used by CLI (ServiceAddressResolver, K8s manifest gen) and apps-manager\n * (application lifecycle) to ensure consistent URL/naming patterns.\n */\n\n/**\n * Builds a K8s cluster-internal URL: `http://<service>.<namespace>.svc.cluster.local:<port>`\n */\nexport function buildK8sInternalUrl(service: string, port: number, namespace: string): string {\n return `http://${service}.${namespace}.svc.cluster.local:${port}`;\n}\n\n/**\n * Builds a K8s cluster-internal hostname (without scheme/port).\n */\nexport function buildK8sInternalHost(service: string, namespace: string): string {\n return `${service}.${namespace}.svc.cluster.local`;\n}\n\n/**\n * Builds an ingress-based public URL: `https://<service>.<publicDomain>`\n *\n * `publicDomain` is the runtime-agnostic external hostname (browsers /\n * reverse proxy / DNS terminate here). See `WildoInfraEnvConfig.publicDomain`.\n *\n * Used for PLATFORM services (apps-manager, module-registry, …) whose\n * subdomain is always the service name. Application services (frontends +\n * backend API) resolve their public host through {@link buildServicePublicHost}\n * so the operator's authored `serviceHosts` map wins.\n */\nexport function buildK8sPublicUrl(service: string, publicDomain: string): string {\n return `https://${service}.${publicDomain}`;\n}\n\n// ============================================================================\n// Application public-host resolution (serviceHosts-driven)\n// ============================================================================\n//\n// Single source of truth for an application service's PUBLIC hostname, shared\n// by every producer so ingress routing, `runtime.endPoints[*].publicUrl`, and\n// CORS never diverge (a divergence breaks the browser's next `fetch` on CORS —\n// see `.claude/plans/self-host-domain-subdomain-model.md`).\n//\n// The self-hosted, single-app, mono-env model: each service lives at a\n// subdomain of the operator's own `publicDomain`. Greenfield — there is NO\n// multi-tenant `{service}-{appSlug}-{env}` fan-out.\n//\n// - `serviceHosts[serviceKey]` authored → `<host>.<publicDomain>`\n// (`app` → `app.example.com`), or `<publicDomain>` when the authored value\n// is the empty string (apex — `''` → `example.com`).\n// - key NOT authored → `<serviceKey>.<publicDomain>`: the service key IS its\n// own subdomain, the same convention platform services use via\n// {@link buildK8sPublicUrl}. A DEFINED fallback (never a silent error — the\n// `serviceHosts` schema requires consumers handle \"not mapped\" explicitly).\n\nexport interface ServicePublicHostParams {\n /** The application service key (`config.services.<key>` / `serviceHosts` key). */\n serviceKey: string;\n /** Authored per-service subdomain map from `wildo.infra.<env>.config.ts`. */\n serviceHosts: Record<string, string> | undefined;\n /** The operator's public domain (`WildoInfraEnvConfig.publicDomain`). */\n publicDomain: string;\n}\n\n/**\n * Resolve an application service's PUBLIC hostname (no scheme). `serviceHosts`\n * wins; the service key is its own subdomain when unauthored; `''` = apex.\n * See the section header.\n */\nexport function buildServicePublicHost(params: ServicePublicHostParams): string {\n const { serviceKey, serviceHosts, publicDomain } = params;\n // Fallback uses the service key AS the subdomain, lowercased: DNS labels are\n // case-insensitive and Let's Encrypt / `new URL()` canonicalize to lowercase,\n // so a camelCase key like `backendApi` must become `backendapi` to round-trip\n // (and to match the ingress host). Authored serviceHosts values are already\n // lowercase-validated upstream (`SERVICE_HOST_LABEL`). NOTE: a config key with\n // a DNS-invalid char (e.g. `_`) still yields an invalid host — the operator\n // must author a `serviceHosts` entry for it.\n const host = serviceHosts?.[serviceKey] ?? serviceKey.toLowerCase();\n return host === '' ? publicDomain : `${host}.${publicDomain}`;\n}\n\n/**\n * Resolve an application service's PUBLIC URL (`https://<host>`), where the\n * host comes from {@link buildServicePublicHost}.\n */\nexport function buildServicePublicUrl(params: ServicePublicHostParams): string {\n return `https://${buildServicePublicHost(params)}`;\n}\n\n/**\n * K8s Secret name for a platform service: `<service>-secret`\n */\nexport function k8sServiceSecretName(service: string): string {\n return `${service}-secret`;\n}\n\n/**\n * K8s ConfigMap name for a platform service: `<service>-config`\n */\nexport function k8sServiceConfigMapName(service: string): string {\n return `${service}-config`;\n}\n\n/**\n * K8s Secret name for an app backend: `<serviceName>-secret`\n *\n * The emitted name MUST match the `envFrom: secretRef.name` the application\n * deployment template mounts. The CLI static emit lane\n * (`k8s-secrets-generator.service.ts` § 5) calls this helper with the app's\n * backend `serviceName`.\n *\n * The name-mismatch gap this JSDoc used to warn about is CLOSED (#377): the templates no longer\n * spell a Secret name at all — each receives the resolved `{{runtimeEnvSecretName}}` from\n * {@link k8sRuntimeEnvSecretName}, which is the same function the emit side calls. The mount stays\n * fail-closed (no `optional: true`), so were the two ever to diverge again the pod would refuse to\n * boot rather than start without its environment.\n *\n * ⚠️ Still true: the K8s app lane has never had a live cluster run. What is verified is that emit\n * and mount agree, pinned from both sides.\n *\n * Application backends emit a single Secret per app (no companion ConfigMap):\n * envFrom mounts every entry as `process.env.*`, so splitting sensitive vs\n * non-sensitive added zero runtime value and fragmented the canonical sink.\n * See `k8s-secrets-generator.service.ts` § 5 for the design note.\n */\nexport function k8sAppBackendSecretName(serviceName: string): string {\n return k8sRuntimeEnvSecretName(serviceName);\n}\n\n/**\n * K8s Secret name carrying ONE runtime's ENVIRONMENT: `<runtimeServiceName>-secret`.\n *\n * The companion of {@link k8sRuntimeProvidersSecretName} — that one carries a runtime's provider\n * CREDENTIALS, this one everything else it boots with. Same keying: the app slug for the backend\n * pod, {@link buildMinionServiceName} / {@link buildWorkerServiceName} for a minion or worker.\n *\n * ## Why minions and workers stopped sharing the backend's (issue #377)\n *\n * Every minion and worker pod used to `envFrom`-mount the BACKEND's `{appSlug}-secret`, so each\n * received the backend's whole environment: the platform bootstrap contract, MongoDB / PostgreSQL /\n * Redis / RabbitMQ topology, storage configuration — and, once #360 composed it, the backend's\n * `OTEL_EXPORTER_OTLP_HEADERS`, which carries the telemetry provider's token. So the per-runtime\n * confinement that #329, #360 and #369 established was defeated one level up: a minion scoped to\n * `openai` alone got no telemetry token in its own provider Secret and received it anyway, from a\n * different runtime's environment.\n *\n * `buildApplicationMinionEnv` and `buildApplicationWorkerEnv` already existed, already took a\n * `RuntimeProviderScope`, and already produced the correctly-scoped environment for the compose\n * lane. The Kubernetes lane simply never called them.\n *\n * ## Every mount name is now resolved here, including the backend's\n *\n * `k8sAppBackendSecretName` delegates rather than repeating `${x}-secret`, so there is ONE format\n * string for this concept. The templates receive the resolved name as `{{runtimeEnvSecretName}}`\n * and no longer compose `{{appName}}-secret` themselves — which is what the older JSDoc on\n * `k8sAppBackendSecretName` warned about, from the era when a template hardcoded a name the emit\n * never produced and the pod failed closed at boot.\n *\n * Unlike the provider Secret, this mount is NOT `optional`: a runtime cannot boot without its\n * environment, and a missing one must fail loudly rather than start a pod that cannot work.\n */\nexport function k8sRuntimeEnvSecretName(runtimeServiceName: string): string {\n return `${runtimeServiceName}-secret`;\n}\n\n/**\n * K8s Secret name carrying ONE runtime's provider credentials:\n * `<runtimeServiceName>-providers-secret`.\n *\n * `runtimeServiceName` is the runtime's own DNS name — the app slug for the backend pod,\n * {@link buildMinionServiceName} / {@link buildWorkerServiceName} for a minion or worker — so every\n * application runtime gets its own Secret and no two can collide.\n *\n * ## Why this replaced one shared `providers-secret` (issue #369)\n *\n * There used to be a single cluster-wide `providers-secret` holding the application's ENTIRE\n * `providerEnv`, `envFrom`-mounted by the backend, every minion AND every worker. `envFrom` merges,\n * so a provider key the per-app Secret withheld arrived from that second reference: on Kubernetes a\n * worker authoring `providers: {}` received every provider key the application had, in its process\n * environment, which is exactly what LLM-driven minion code reads. The per-runtime confinement\n * (#329) held in the compose lane and did not exist here at all — one contract, two deployment\n * lanes, one swept.\n *\n * **The name is a function, not a format string repeated in a template, and that is the point.**\n * This file already carries a scar from the other direction: `k8sAppBackendSecretName` documents a\n * mount whose name the template hardcodes, and a mismatch there means a pod that cannot boot. Here\n * the emit side (`k8s-secrets-generator.service.ts`) and the mount side (the three\n * `*.deployment.yaml.hbs` renderers) both call THIS function, and the templates receive the\n * resolved name as `{{providersSecretName}}` rather than composing it themselves.\n *\n * The mount stays `optional: true`: a runtime that declares no providers gets no Secret emitted,\n * which is the correct outcome and must not fail pod start.\n */\nexport function k8sRuntimeProvidersSecretName(runtimeServiceName: string): string {\n return `${runtimeServiceName}-providers-secret`;\n}\n"]}
|
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
*
|
|
4
4
|
* ## Why it lives under `project-config` and not beside its derivation
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* invisible to the very file that has to name it.
|
|
6
|
+
* The split is by AUDIENCE: the vocabulary an app author writes lives with the
|
|
7
|
+
* other authoring vocabularies; {@link buildOwnCronRecordFilter} and the
|
|
8
|
+
* declaration type stay in `bootstrap/`, because a runtime derivation is not
|
|
9
|
+
* something an authored config should be reaching for.
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
11
|
+
* It first moved here for a worse reason, kept as history because the defect
|
|
12
|
+
* shape recurred. Until 2026-09-09 the config loader resolved
|
|
13
|
+
* `@wildo-ai/platform-config-lib` to a `config-authoring.entry.ts` that exported
|
|
14
|
+
* `./project-config` and `./workspace-scope` and nothing else, so an app config
|
|
15
|
+
* importing this enum from `bootstrap/` beside `AppFrontendType` — same package,
|
|
16
|
+
* same statement — got `AppFrontendType` and `undefined` for this one, and
|
|
17
|
+
* `wildo config sync` died on `reading 'OWN_CRON_RECORDS'`. Moving the enum cured
|
|
18
|
+
* that name; the next symbol the engine composed at module load from the same
|
|
19
|
+
* package hit the same wall. The entry now re-exports the whole root (see its
|
|
20
|
+
* header), so placement under `project-config` is a statement about who authors
|
|
21
|
+
* the value, no longer about what the loader can see.
|
|
22
22
|
*/
|
|
23
23
|
export declare enum MinionPlatformAccessScope {
|
|
24
24
|
/**
|
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
*
|
|
4
4
|
* ## Why it lives under `project-config` and not beside its derivation
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* invisible to the very file that has to name it.
|
|
6
|
+
* The split is by AUDIENCE: the vocabulary an app author writes lives with the
|
|
7
|
+
* other authoring vocabularies; {@link buildOwnCronRecordFilter} and the
|
|
8
|
+
* declaration type stay in `bootstrap/`, because a runtime derivation is not
|
|
9
|
+
* something an authored config should be reaching for.
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
11
|
+
* It first moved here for a worse reason, kept as history because the defect
|
|
12
|
+
* shape recurred. Until 2026-09-09 the config loader resolved
|
|
13
|
+
* `@wildo-ai/platform-config-lib` to a `config-authoring.entry.ts` that exported
|
|
14
|
+
* `./project-config` and `./workspace-scope` and nothing else, so an app config
|
|
15
|
+
* importing this enum from `bootstrap/` beside `AppFrontendType` — same package,
|
|
16
|
+
* same statement — got `AppFrontendType` and `undefined` for this one, and
|
|
17
|
+
* `wildo config sync` died on `reading 'OWN_CRON_RECORDS'`. Moving the enum cured
|
|
18
|
+
* that name; the next symbol the engine composed at module load from the same
|
|
19
|
+
* package hit the same wall. The entry now re-exports the whole root (see its
|
|
20
|
+
* header), so placement under `project-config` is a statement about who authors
|
|
21
|
+
* the value, no longer about what the loader can see.
|
|
22
22
|
*/
|
|
23
23
|
export var MinionPlatformAccessScope;
|
|
24
24
|
(function (MinionPlatformAccessScope) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minion-platform-access.vocabulary.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/minion-platform-access.vocabulary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,CAAN,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACnC;;;;OAIG;IACH,kEAAqC,CAAA;AACvC,CAAC,EAPW,yBAAyB,KAAzB,yBAAyB,QAOpC","sourcesContent":["/**\n * The PLATFORM-ACCESS vocabulary a minion declaration is authored with (R4 / R5).\n *\n * ## Why it lives under `project-config` and not beside its derivation\n *\n *
|
|
1
|
+
{"version":3,"file":"minion-platform-access.vocabulary.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/minion-platform-access.vocabulary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,CAAN,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACnC;;;;OAIG;IACH,kEAAqC,CAAA;AACvC,CAAC,EAPW,yBAAyB,KAAzB,yBAAyB,QAOpC","sourcesContent":["/**\n * The PLATFORM-ACCESS vocabulary a minion declaration is authored with (R4 / R5).\n *\n * ## Why it lives under `project-config` and not beside its derivation\n *\n * The split is by AUDIENCE: the vocabulary an app author writes lives with the\n * other authoring vocabularies; {@link buildOwnCronRecordFilter} and the\n * declaration type stay in `bootstrap/`, because a runtime derivation is not\n * something an authored config should be reaching for.\n *\n * It first moved here for a worse reason, kept as history because the defect\n * shape recurred. Until 2026-09-09 the config loader resolved\n * `@wildo-ai/platform-config-lib` to a `config-authoring.entry.ts` that exported\n * `./project-config` and `./workspace-scope` and nothing else, so an app config\n * importing this enum from `bootstrap/` beside `AppFrontendType` — same package,\n * same statement — got `AppFrontendType` and `undefined` for this one, and\n * `wildo config sync` died on `reading 'OWN_CRON_RECORDS'`. Moving the enum cured\n * that name; the next symbol the engine composed at module load from the same\n * package hit the same wall. The entry now re-exports the whole root (see its\n * header), so placement under `project-config` is a statement about who authors\n * the value, no longer about what the loader can see.\n */\n\nexport enum MinionPlatformAccessScope {\n /**\n * The minion's OWN cron/schedule records. There is deliberately no\n * `ALL_CRON_RECORDS` member: a scope that could name another minion is a scope\n * somebody will eventually grant.\n */\n OWN_CRON_RECORDS = 'own_cron_records',\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PlatformApplicationType } from '@wildo-ai/platform-core-shared';
|
|
1
2
|
/**
|
|
2
3
|
* Platform microservices. All use the same Docker image (wildo-platform)
|
|
3
4
|
* differentiated at runtime via PLATFORM_SERVICE env var.
|
|
@@ -18,6 +19,35 @@ export declare enum PlatformWildoServices {
|
|
|
18
19
|
}
|
|
19
20
|
export declare const BOOTSTRAP_PLATFORM_SERVICES: readonly [PlatformWildoServices.CRONTABS_BATCHES_MANAGER, PlatformWildoServices.MODULE_REGISTRY];
|
|
20
21
|
export type BootstrapPlatformService = (typeof BOOTSTRAP_PLATFORM_SERVICES)[number];
|
|
22
|
+
/**
|
|
23
|
+
* The platform-application TYPES the platform provisions credentials for — the same three the
|
|
24
|
+
* apps-manager provisioner iterates. Named here so the runtime-slug ledger below can be REQUIRED per
|
|
25
|
+
* member: a fourth provisioned service that is not mapped fails to compile before it provisions a
|
|
26
|
+
* grant nobody can use.
|
|
27
|
+
*/
|
|
28
|
+
export type ProvisionedPlatformApplicationType = PlatformApplicationType.PLATFORM_APPS_MANAGER | PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER | PlatformApplicationType.PLATFORM_MODULE_REGISTRY;
|
|
29
|
+
/**
|
|
30
|
+
* ONE service, TWO spellings — and this is the join between them.
|
|
31
|
+
*
|
|
32
|
+
* `PlatformApplicationType` (`platform_crontabs_batches_manager`, underscores) is the platform-
|
|
33
|
+
* application RECORD type: the row in `platformApplications`, the Redis ACL USERNAME, the RabbitMQ
|
|
34
|
+
* user. `PlatformWildoServices` (`platform-crontabs-batches-manager`, hyphens) is the RUNTIME SLUG:
|
|
35
|
+
* the Docker/K8s service name and, since 2026-09-09, the `appSlug` each service process boots with.
|
|
36
|
+
*
|
|
37
|
+
* Why the join matters: every Redis key a platform process writes is rooted at its runtime slug —
|
|
38
|
+
* the engine's `RedisService` roots at `${appSlug}:`, the platform's `PlatformRedisService` at the
|
|
39
|
+
* same slug through this ledger — and the ACL grant minted for the service must therefore be
|
|
40
|
+
* `~<runtime slug>:*`. Two writers rooted at the USERNAME instead (the provisioner's grant, then the
|
|
41
|
+
* platform Redis service's prefix) each produced `NOPERM` on the service's first key, one after the
|
|
42
|
+
* other, once the other side was corrected. Both sides now read this one table.
|
|
43
|
+
*/
|
|
44
|
+
export declare const PLATFORM_SERVICE_RUNTIME_SLUG: Record<ProvisionedPlatformApplicationType, PlatformWildoServices>;
|
|
45
|
+
/**
|
|
46
|
+
* The runtime slug for a platform-application type name, or `undefined` when the name is not a
|
|
47
|
+
* provisioned platform service — a caller then reports or refuses rather than rooting a key
|
|
48
|
+
* namespace, or a grant, on a guess.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolvePlatformServiceRuntimeSlug(serviceName: string | undefined): PlatformWildoServices | undefined;
|
|
21
51
|
export declare enum AppsManagerMode {
|
|
22
52
|
NORMAL = "normal",
|
|
23
53
|
INIT = "init"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-services.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/platform-services.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,oBAAY,qBAAqB;IAC/B,aAAa,kBAAkB;IAC/B,YAAY,0BAA0B;IACtC,wBAAwB,sCAAsC;IAC9D;;;;OAIG;IACH,eAAe,6BAA6B;CAC7C;AA4BD,eAAO,MAAM,2BAA2B,kGAGyB,CAAC;AAElE,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"platform-services.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/platform-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;;;;;GAMG;AACH,oBAAY,qBAAqB;IAC/B,aAAa,kBAAkB;IAC/B,YAAY,0BAA0B;IACtC,wBAAwB,sCAAsC;IAC9D;;;;OAIG;IACH,eAAe,6BAA6B;CAC7C;AA4BD,eAAO,MAAM,2BAA2B,kGAGyB,CAAC;AAElE,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpF;;;;;GAKG;AACH,MAAM,MAAM,kCAAkC,GAC1C,uBAAuB,CAAC,qBAAqB,GAC7C,uBAAuB,CAAC,iCAAiC,GACzD,uBAAuB,CAAC,wBAAwB,CAAC;AAErD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,kCAAkC,EAAE,qBAAqB,CAI3G,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,qBAAqB,GAAG,SAAS,CAGpH;AAeD,oBAAY,eAAe;IACzB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PlatformApplicationType } from '@wildo-ai/platform-core-shared';
|
|
1
2
|
/**
|
|
2
3
|
* Platform microservices. All use the same Docker image (wildo-platform)
|
|
3
4
|
* differentiated at runtime via PLATFORM_SERVICE env var.
|
|
@@ -21,6 +22,36 @@ export const BOOTSTRAP_PLATFORM_SERVICES = [
|
|
|
21
22
|
PlatformWildoServices.CRONTABS_BATCHES_MANAGER,
|
|
22
23
|
PlatformWildoServices.MODULE_REGISTRY,
|
|
23
24
|
];
|
|
25
|
+
/**
|
|
26
|
+
* ONE service, TWO spellings — and this is the join between them.
|
|
27
|
+
*
|
|
28
|
+
* `PlatformApplicationType` (`platform_crontabs_batches_manager`, underscores) is the platform-
|
|
29
|
+
* application RECORD type: the row in `platformApplications`, the Redis ACL USERNAME, the RabbitMQ
|
|
30
|
+
* user. `PlatformWildoServices` (`platform-crontabs-batches-manager`, hyphens) is the RUNTIME SLUG:
|
|
31
|
+
* the Docker/K8s service name and, since 2026-09-09, the `appSlug` each service process boots with.
|
|
32
|
+
*
|
|
33
|
+
* Why the join matters: every Redis key a platform process writes is rooted at its runtime slug —
|
|
34
|
+
* the engine's `RedisService` roots at `${appSlug}:`, the platform's `PlatformRedisService` at the
|
|
35
|
+
* same slug through this ledger — and the ACL grant minted for the service must therefore be
|
|
36
|
+
* `~<runtime slug>:*`. Two writers rooted at the USERNAME instead (the provisioner's grant, then the
|
|
37
|
+
* platform Redis service's prefix) each produced `NOPERM` on the service's first key, one after the
|
|
38
|
+
* other, once the other side was corrected. Both sides now read this one table.
|
|
39
|
+
*/
|
|
40
|
+
export const PLATFORM_SERVICE_RUNTIME_SLUG = {
|
|
41
|
+
[PlatformApplicationType.PLATFORM_APPS_MANAGER]: PlatformWildoServices.APPS_MANAGER,
|
|
42
|
+
[PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER]: PlatformWildoServices.CRONTABS_BATCHES_MANAGER,
|
|
43
|
+
[PlatformApplicationType.PLATFORM_MODULE_REGISTRY]: PlatformWildoServices.MODULE_REGISTRY,
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The runtime slug for a platform-application type name, or `undefined` when the name is not a
|
|
47
|
+
* provisioned platform service — a caller then reports or refuses rather than rooting a key
|
|
48
|
+
* namespace, or a grant, on a guess.
|
|
49
|
+
*/
|
|
50
|
+
export function resolvePlatformServiceRuntimeSlug(serviceName) {
|
|
51
|
+
if (serviceName === undefined)
|
|
52
|
+
return undefined;
|
|
53
|
+
return PLATFORM_SERVICE_RUNTIME_SLUG[serviceName];
|
|
54
|
+
}
|
|
24
55
|
const _assertExhaustiveBootstrapCoverage = true;
|
|
25
56
|
void _assertExhaustiveBootstrapCoverage;
|
|
26
57
|
export var AppsManagerMode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-services.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/platform-services.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,qBAUX;AAVD,WAAY,qBAAqB;IAC/B,wDAA+B,CAAA;IAC/B,+DAAsC,CAAA;IACtC,uFAA8D,CAAA;IAC9D;;;;OAIG;IACH,qEAA4C,CAAA;AAC9C,CAAC,EAVW,qBAAqB,KAArB,qBAAqB,QAUhC;AA4BD,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,qBAAqB,CAAC,wBAAwB;IAC9C,qBAAqB,CAAC,eAAe;CAC0B,CAAC;
|
|
1
|
+
{"version":3,"file":"platform-services.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/platform-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,qBAUX;AAVD,WAAY,qBAAqB;IAC/B,wDAA+B,CAAA;IAC/B,+DAAsC,CAAA;IACtC,uFAA8D,CAAA;IAC9D;;;;OAIG;IACH,qEAA4C,CAAA;AAC9C,CAAC,EAVW,qBAAqB,KAArB,qBAAqB,QAUhC;AA4BD,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,qBAAqB,CAAC,wBAAwB;IAC9C,qBAAqB,CAAC,eAAe;CAC0B,CAAC;AAelE;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAsE;IAC9G,CAAC,uBAAuB,CAAC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC,YAAY;IACnF,CAAC,uBAAuB,CAAC,iCAAiC,CAAC,EAAE,qBAAqB,CAAC,wBAAwB;IAC3G,CAAC,uBAAuB,CAAC,wBAAwB,CAAC,EAAE,qBAAqB,CAAC,eAAe;CAC1F,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAAC,WAA+B;IAC/E,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAChD,OAAQ,6BAAmF,CAAC,WAAW,CAAC,CAAC;AAC3G,CAAC;AAYD,MAAM,kCAAkC,GAAuC,IAAI,CAAC;AACpF,KAAK,kCAAkC,CAAC;AAExC,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,gCAAa,CAAA;AACf,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["import { PlatformApplicationType } from '@wildo-ai/platform-core-shared';\n\n/**\n * Platform microservices. All use the same Docker image (wildo-platform)\n * differentiated at runtime via PLATFORM_SERVICE env var.\n *\n * For app developers: deployed as Docker containers.\n * For framework developers: run natively from source (hot-reload).\n */\nexport enum PlatformWildoServices {\n PLATFORM_INIT = 'platform-init',\n APPS_MANAGER = 'platform-apps-manager',\n CRONTABS_BATCHES_MANAGER = 'platform-crontabs-batches-manager',\n /**\n * Module-registry server (`platform-module-registry`, KD-7).\n * Hosts the central `wildo registry *` HTTP surface; pinned port\n * `PLATFORM_DEFAULT_PORTS.MODULE_REGISTRY` (5154).\n */\n MODULE_REGISTRY = 'platform-module-registry',\n}\n\n/**\n * Bootstrap platform services — long-running platform microservices that boot\n * from the same env contract via `PlatformEnvVarsBuilder.buildBootstrapEnv`.\n *\n * Excludes:\n * - `PLATFORM_INIT` — one-shot initialization job, not a long-running service.\n * - `APPS_MANAGER` — has its own dedicated full-env builder\n * (`PlatformEnvVarsBuilder.buildAppsManagerFullEnv`) with extra wiring\n * (Atlas creds, GitHub provisioning keys, etc.).\n *\n * Single source of truth for everything that iterates \"all bootstrap services\":\n * K8s Secret/ConfigMap emit (`k8s-secrets-generator.service.ts`), Compose\n * runtime catalog, and tests asserting cross-service env contracts.\n *\n * The `satisfies` clause below forces this list to cover every member of\n * `PlatformWildoServices` other than the two explicitly excluded ones —\n * adding a new enum member without listing it here is a compile error.\n * Without that coupling, the previous `Exclude<…>`-based local type alias\n * silently widened to include any future enum member, which masked the\n * \"service in enum but not yet handled by the bootstrap path\" drift class.\n */\ntype BootstrapPlatformServiceCandidate = Exclude<\n PlatformWildoServices,\n PlatformWildoServices.PLATFORM_INIT | PlatformWildoServices.APPS_MANAGER\n>;\n\nexport const BOOTSTRAP_PLATFORM_SERVICES = [\n PlatformWildoServices.CRONTABS_BATCHES_MANAGER,\n PlatformWildoServices.MODULE_REGISTRY,\n] as const satisfies readonly BootstrapPlatformServiceCandidate[];\n\nexport type BootstrapPlatformService = (typeof BOOTSTRAP_PLATFORM_SERVICES)[number];\n\n/**\n * The platform-application TYPES the platform provisions credentials for — the same three the\n * apps-manager provisioner iterates. Named here so the runtime-slug ledger below can be REQUIRED per\n * member: a fourth provisioned service that is not mapped fails to compile before it provisions a\n * grant nobody can use.\n */\nexport type ProvisionedPlatformApplicationType =\n | PlatformApplicationType.PLATFORM_APPS_MANAGER\n | PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER\n | PlatformApplicationType.PLATFORM_MODULE_REGISTRY;\n\n/**\n * ONE service, TWO spellings — and this is the join between them.\n *\n * `PlatformApplicationType` (`platform_crontabs_batches_manager`, underscores) is the platform-\n * application RECORD type: the row in `platformApplications`, the Redis ACL USERNAME, the RabbitMQ\n * user. `PlatformWildoServices` (`platform-crontabs-batches-manager`, hyphens) is the RUNTIME SLUG:\n * the Docker/K8s service name and, since 2026-09-09, the `appSlug` each service process boots with.\n *\n * Why the join matters: every Redis key a platform process writes is rooted at its runtime slug —\n * the engine's `RedisService` roots at `${appSlug}:`, the platform's `PlatformRedisService` at the\n * same slug through this ledger — and the ACL grant minted for the service must therefore be\n * `~<runtime slug>:*`. Two writers rooted at the USERNAME instead (the provisioner's grant, then the\n * platform Redis service's prefix) each produced `NOPERM` on the service's first key, one after the\n * other, once the other side was corrected. Both sides now read this one table.\n */\nexport const PLATFORM_SERVICE_RUNTIME_SLUG: Record<ProvisionedPlatformApplicationType, PlatformWildoServices> = {\n [PlatformApplicationType.PLATFORM_APPS_MANAGER]: PlatformWildoServices.APPS_MANAGER,\n [PlatformApplicationType.PLATFORM_CRONTABS_BATCHES_MANAGER]: PlatformWildoServices.CRONTABS_BATCHES_MANAGER,\n [PlatformApplicationType.PLATFORM_MODULE_REGISTRY]: PlatformWildoServices.MODULE_REGISTRY,\n};\n\n/**\n * The runtime slug for a platform-application type name, or `undefined` when the name is not a\n * provisioned platform service — a caller then reports or refuses rather than rooting a key\n * namespace, or a grant, on a guess.\n */\nexport function resolvePlatformServiceRuntimeSlug(serviceName: string | undefined): PlatformWildoServices | undefined {\n if (serviceName === undefined) return undefined;\n return (PLATFORM_SERVICE_RUNTIME_SLUG as Record<string, PlatformWildoServices | undefined>)[serviceName];\n}\n\n/**\n * Compile-time assertion: every non-excluded `PlatformWildoServices` member\n * MUST appear in `BOOTSTRAP_PLATFORM_SERVICES`. Adding a new member to the\n * enum without listing it above triggers a `Type 'X' is not assignable to\n * type 'never'` error pointing here, so the exhaustiveness check the\n * `addServiceExtras` switch used to provide for `Exclude<…>`-derived types\n * is preserved.\n */\ntype _AssertExhaustiveBootstrapCoverage =\n Exclude<BootstrapPlatformServiceCandidate, BootstrapPlatformService> extends never ? true : never;\nconst _assertExhaustiveBootstrapCoverage: _AssertExhaustiveBootstrapCoverage = true;\nvoid _assertExhaustiveBootstrapCoverage;\n\nexport enum AppsManagerMode {\n NORMAL = 'normal',\n INIT = 'init',\n}\n\n"]}
|
|
@@ -22,6 +22,20 @@ export interface FrameworkLayoutPaths {
|
|
|
22
22
|
pnpmLockfilePath: string;
|
|
23
23
|
engineHome: string;
|
|
24
24
|
platformHome: string;
|
|
25
|
+
/**
|
|
26
|
+
* The THIRD workspace home (plan D9): one package per provider, several facet barrels each,
|
|
27
|
+
* deliberately OUTSIDE `engine/` so that "out of the core engine" is a directory rather than a
|
|
28
|
+
* convention. Named for the HOME, never for a package in it — which provider inhabits it first is
|
|
29
|
+
* a decision of the slice that generates providers, not of the layout.
|
|
30
|
+
*
|
|
31
|
+
* It is a field here because this interface is what makes a home VISIBLE to tooling: publish
|
|
32
|
+
* discovery, framework-knowledge generation and the anchor audit all take their scan roots from
|
|
33
|
+
* `engineHome` + `platformHome`, and a home absent from that pair is not excluded — it is
|
|
34
|
+
* unseen. An unseen home reports clean, which is the shape
|
|
35
|
+
* `negative-results-require-a-positive-probe.md` exists for: a `@wildo_source` anchor in a
|
|
36
|
+
* provider package would never reach a skill, and nothing would say so.
|
|
37
|
+
*/
|
|
38
|
+
providersHome: string;
|
|
25
39
|
examplesHome: string;
|
|
26
40
|
markerHome: string;
|
|
27
41
|
declarationConfigPath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-homes.schemas.d.ts","sourceRoot":"","sources":["../../../../src/workspace-scope/workspace-homes.schemas.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAML,cAAc,EACf,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,4EAA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G,IAAI,CAAC;IAC1B,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACpC;;;;;;;;;;OAUG;IACH,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9B,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,WAAW,wBAAwB;IACvC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,eAAe,EAAE,OAAO,CAAC;IACzB,iCAAiC,EAAE,OAAO,CAAC;IAC3C,qBAAqB,EAAE,OAAO,CAAC;IAC/B,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,oBAAoB,CAAC;IACrC,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,SAAS,EAAE,sBAAsB,CAAC;IAClC,GAAG,EAAE,gBAAgB,CAAC;IACtB,YAAY,EAAE,wBAAwB,CAAC;CACxC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,GAAE,MAAkB,GAAG,kBAAkB,CAarF;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,oBAAoB,
|
|
1
|
+
{"version":3,"file":"workspace-homes.schemas.d.ts","sourceRoot":"","sources":["../../../../src/workspace-scope/workspace-homes.schemas.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC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a,EAAE,MAAM,GAAG,oBAAoB,CAsElF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CA2DhE"}
|
|
@@ -22,6 +22,7 @@ export function resolveFrameworkLayout(frameworkRoot) {
|
|
|
22
22
|
const markerHome = join(frameworkRoot, WORKSPACE_HOME_NAMES.FRAMEWORK_HOME);
|
|
23
23
|
const engineHome = join(frameworkRoot, 'engine');
|
|
24
24
|
const platformHome = join(frameworkRoot, 'platform');
|
|
25
|
+
const providersHome = join(frameworkRoot, 'providers');
|
|
25
26
|
const examplesHome = join(frameworkRoot, 'examples');
|
|
26
27
|
const templatesHome = join(frameworkRoot, 'templates');
|
|
27
28
|
const infraTemplatesHome = join(templatesHome, 'infra');
|
|
@@ -39,6 +40,7 @@ export function resolveFrameworkLayout(frameworkRoot) {
|
|
|
39
40
|
pnpmLockfilePath: join(frameworkRoot, 'pnpm-lock.yaml'),
|
|
40
41
|
engineHome,
|
|
41
42
|
platformHome,
|
|
43
|
+
providersHome,
|
|
42
44
|
examplesHome,
|
|
43
45
|
markerHome,
|
|
44
46
|
declarationConfigPath: join(markerHome, AUTHORED_CONFIG_FILE_NAMES.FRAMEWORK),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-homes.schemas.js","sourceRoot":"","sources":["../../../../src/workspace-scope/workspace-homes.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,2BAA2B,CAAC;AA8MnC;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,WAAmB,OAAO,EAAE;IAC/D,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,kBAAkB,CAAC,YAAY,CAAC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aceScopeResult } from './workspace-scope.schemas';\nimport {\n AUTHORED_CONFIG_FILE_NAMES,\n APP_CONTINUITY_FILE_NAMES,\n APP_RUNTIME_SUBDIR_NAMES,\n MACHINE_HOME_NAMES,\n WORKSPACE_HOME_NAMES,\n WorkspaceScope,\n} from './workspace-scope.schemas';\n\nexport interface MachineLayoutPaths {\n home: string;\n preferencesPath: string;\n /** Machine-local root for all continuity authority domains and subjects. */\n continuityHome: string;\n /**\n * Machine-local authority-domain manifest.\n *\n * The manifest identifies a storage/writer namespace. It is deliberately\n * outside every subject directory because one local authority domain may\n * own several application subjects.\n */\n continuityAuthorityDomainManifestPath: string;\n /** Root containing `domains/<authority-domain-id>/subjects/...`. */\n continuityDomainsHome: string;\n}\n\nexport interface FrameworkLayoutPaths {\n repositoryRoot: string;\n rootPackageJsonPath: string;\n pnpmLockfilePath: string;\n engineHome: string;\n platformHome: string;\n examplesHome: string;\n markerHome: string;\n declarationConfigPath: string;\n templatesHome: string;\n infraTemplatesHome: string;\n dockerComposeTemplatesHome: string;\n ciTemplatesHome: string;\n k8sTemplatesHome: string;\n dockerImagesTemplatesHome: string;\n platformBaseDockerfilePath: string;\n backendBaseDockerfilePath: string;\n backendJavaDockerfilePath: string;\n docsHome: string;\n frameworkKnowledgePackageHome: string;\n frameworkKnowledgeSourceHome: string;\n /**\n * Home of **authored** skill folders (`src/skills/<skill_id>/SKILL.md` + supporting\n * markdown). Distinct from {@link frameworkKnowledgeSkillsHome}, which is the\n * **materialized** output home under `dist/knowledge/skills/`. Keeping the two\n * names clearly separated prevents accidental conflation between authored\n * source and generated artifact.\n */\n frameworkKnowledgeAuthoredSkillsHome: string;\n /**\n * Home of **authored** playbook folders\n * (`src/playbooks/<ref>/playbook.json` + `method.md`). Playbooks are the\n * meta-workflow artifact kind (app-creation methodology definitions) — a\n * distinct compilation lane from skills, so they get their own authored\n * home instead of polluting the skills router. Mirrors the\n * authored-vs-materialized split of\n * {@link frameworkKnowledgeAuthoredSkillsHome} /\n * {@link frameworkKnowledgeSkillsHome}.\n */\n frameworkKnowledgeAuthoredPlaybooksHome: string;\n /**\n * Home of **authored** always-on rules (`src/rules/*.md`).\n *\n * A rule is policy an application's coding agent should have at its elbow WITHOUT routing to a\n * skill first — the distinction the skills router cannot express, because a router match requires\n * the agent to already suspect the topic. Authored-vs-materialized split as above:\n * {@link frameworkKnowledgeRulesHome} is the compiled output.\n */\n frameworkKnowledgeAuthoredRulesHome: string;\n frameworkKnowledgeOutputHome: string;\n frameworkKnowledgeReferencesHome: string;\n frameworkKnowledgeSkillsHome: string;\n frameworkKnowledgeRegistriesHome: string;\n /** Materialized playbook output home under `dist/knowledge/playbooks/`. */\n frameworkKnowledgePlaybooksHome: string;\n /** Materialized rule output home under `dist/knowledge/rules/`. */\n frameworkKnowledgeRulesHome: string;\n releaseHome: string;\n releaseDistHome: string;\n releasePublishHome: string;\n releaseSecretsHome: string;\n releaseSecretsPath: string;\n npmPublishManifestsHome: string;\n configLoaderArtifactsHome: string;\n}\n\nexport interface AppLayoutPaths {\n declarationRoot: string;\n declarationConfigPath: string;\n authoredInfrastructureHome: string;\n runtimeHome: string;\n /** Tracked portable identity/bootstrap inputs for local continuity. */\n continuityHome: string;\n applicationSubjectManifestPath: string;\n applicationContinuityBootstrapProfilePath: string;\n distHome: string;\n /** Generated application-specification runtime outputs. */\n applicationSpecificationsDistHome: string;\n applicationSpecificationProjectionsHome: string;\n stateHome: string;\n /** Disposable application-owned workspaces; never application truth. */\n temporaryHome: string;\n integrationTestsTemporaryHome: string;\n logsHome: string;\n companionLogsHome: string;\n localDataHome: string;\n runtimeInfrastructureHome: string;\n runtimeEnvironmentsHome: string;\n /**\n * Root of the env-scoped deployment-artifact staging area\n * (`.wildo-saas/deploy/`). Per-env renders live at `<home>/<envName>/`.\n * Always secret-bearing — see {@link APP_RUNTIME_SUBDIR_NAMES.DEPLOY}.\n */\n deployArtifactsHome: string;\n frameworkScriptsHome: string;\n runtimeSignalsHome: string;\n companionHome: string;\n preferencesOverlayPath: string;\n configLoaderArtifactsHome: string;\n}\n\nexport interface ResolvedMachineHomes {\n layout: MachineLayoutPaths;\n hasPreferencesFile: boolean;\n}\n\nexport interface ResolvedFrameworkHomes {\n repositoryRoot: string | null;\n markerHome: string | null;\n declarationConfigPath: string | null;\n layout: FrameworkLayoutPaths | null;\n /**\n * True ONLY when the caller's `cwd` sits inside a framework workspace that\n * was discovered by walking up for `wildo-framework.info.json`. A framework\n * root derived from `frameworkPathHint` (machine preferences) populates\n * `repositoryRoot` and `layout`, but leaves this flag `false` because the\n * caller is NOT operating from inside the framework repo — they merely have\n * a pointer to it. Consumers that need \"am I currently developing the\n * framework?\" must read this field; consumers that need \"can I read\n * framework-owned assets from here?\" must read\n * `ResolvedHomeCapabilities.canUseFrameworkAssets`.\n */\n isInFrameworkWorkspace: boolean;\n}\n\nexport interface ResolvedAppHomes {\n declarationRoot: string | null;\n runtimeHome: string | null;\n saasConfigPath: string | null;\n layout: AppLayoutPaths | null;\n isInAppWorkspace: boolean;\n}\n\n/**\n * Pre-computed, semantic booleans that gate downstream CLI / companion /\n * runtime behavior based on the resolved-homes snapshot.\n *\n * Each flag is intentionally separate because they answer different questions\n * — merging any two of them (\"are we in a framework workspace?\" vs \"can we\n * reach framework assets?\") would silently reintroduce the Phase 5\n * env-vs-context confusion we explicitly killed:\n *\n * - `hasMachinePreferences` — A `preferences.json` file exists under the\n * machine Wildo home. `canUseFrameworkAssets` can be true without this\n * flag being true (e.g. the preferences hint was seeded in a session that\n * never persisted), and vice versa.\n * - `hasFrameworkWorkspace` — The caller's `cwd` is inside a framework\n * workspace (walk-up found `wildo-framework.info.json`). Equivalent to\n * `framework.isInFrameworkWorkspace`; duplicated here so capability checks\n * are one-stop-shop without having to reach into the nested roots.\n * - `hasAppWorkspace` — The caller's `cwd` is inside a SaaS app workspace\n * (walk-up found `wildo.saas.config.ts`). Equivalent to\n * `app.isInAppWorkspace`.\n * - `hasFrameworkDeveloperCapabilities` — Either the operator is actually\n * sitting inside the framework workspace (`hasFrameworkWorkspace`) OR the\n * `isFrameworkDeveloperHint` from preferences is true. This is metadata\n * used by commands that surface framework-dev-only tooling — it never\n * participates in path resolution.\n * - `canUseFrameworkAssets` — The resolved snapshot has a usable framework\n * `repositoryRoot` (either because the caller is inside one, or because a\n * validated hint pointed at one). This is the flag used by consumers that\n * need to READ framework-owned paths (scripts, shared dist, etc.) — it is\n * intentionally broader than `hasFrameworkWorkspace` so that apps can\n * reach framework assets without the caller pretending to be \"in\" the\n * framework workspace.\n * - `canUseAppRuntimeHome` — The resolved snapshot has a usable\n * `.wildo-saas/` runtime home. Required by anything that writes runtime\n * signals, caches, generated files, etc.\n */\nexport interface ResolvedHomeCapabilities {\n hasMachinePreferences: boolean;\n hasFrameworkWorkspace: boolean;\n hasAppWorkspace: boolean;\n hasFrameworkDeveloperCapabilities: boolean;\n canUseFrameworkAssets: boolean;\n canUseAppRuntimeHome: boolean;\n}\n\nexport interface ResolvedHomes {\n workspaceScope: WorkspaceScopeResult;\n scope: WorkspaceScope;\n machine: ResolvedMachineHomes;\n framework: ResolvedFrameworkHomes;\n app: ResolvedAppHomes;\n capabilities: ResolvedHomeCapabilities;\n}\n\n/**\n * Build the machine-global Wildo home layout under the current user's home.\n */\nexport function resolveMachineLayout(userHome: string = homedir()): MachineLayoutPaths {\n const home = join(userHome, MACHINE_HOME_NAMES.MACHINE_HOME);\n const continuityHome = join(home, 'continuity');\n return {\n home,\n preferencesPath: join(home, AUTHORED_CONFIG_FILE_NAMES.PREFERENCES),\n continuityHome,\n continuityAuthorityDomainManifestPath: join(\n continuityHome,\n 'authority-domain.json',\n ),\n continuityDomainsHome: join(continuityHome, 'domains'),\n };\n}\n\n/**\n * Build the framework-owned homes and asset roots for a framework repository.\n */\nexport function resolveFrameworkLayout(frameworkRoot: string): FrameworkLayoutPaths {\n const markerHome = join(frameworkRoot, WORKSPACE_HOME_NAMES.FRAMEWORK_HOME);\n const engineHome = join(frameworkRoot, 'engine');\n const platformHome = join(frameworkRoot, 'platform');\n const examplesHome = join(frameworkRoot, 'examples');\n const templatesHome = join(frameworkRoot, 'templates');\n const infraTemplatesHome = join(templatesHome, 'infra');\n const dockerImagesTemplatesHome = join(infraTemplatesHome, 'docker-images');\n const backendDockerImagesHome = join(dockerImagesTemplatesHome, 'backend');\n const frameworkKnowledgePackageHome = join(platformHome, 'factory', 'framework-knowledge');\n const frameworkKnowledgeSourceHome = join(frameworkKnowledgePackageHome, 'src');\n const frameworkKnowledgeOutputHome = join(frameworkKnowledgePackageHome, 'dist', 'knowledge');\n const releaseDistHome = join(markerHome, APP_RUNTIME_SUBDIR_NAMES.DIST);\n const releasePublishHome = join(releaseDistHome, 'publish');\n const releaseSecretsHome = join(markerHome, 'framework-secrets');\n return {\n repositoryRoot: frameworkRoot,\n rootPackageJsonPath: join(frameworkRoot, 'package.json'),\n pnpmLockfilePath: join(frameworkRoot, 'pnpm-lock.yaml'),\n engineHome,\n platformHome,\n examplesHome,\n markerHome,\n declarationConfigPath: join(markerHome, AUTHORED_CONFIG_FILE_NAMES.FRAMEWORK),\n templatesHome,\n infraTemplatesHome,\n dockerComposeTemplatesHome: join(infraTemplatesHome, 'docker-compose'),\n ciTemplatesHome: join(infraTemplatesHome, 'ci'),\n k8sTemplatesHome: join(infraTemplatesHome, 'k8s'),\n dockerImagesTemplatesHome,\n platformBaseDockerfilePath: join(\n dockerImagesTemplatesHome,\n 'platform',\n 'Dockerfile.platform-base',\n ),\n backendBaseDockerfilePath: join(\n backendDockerImagesHome,\n 'Dockerfile.backend-base',\n ),\n backendJavaDockerfilePath: join(\n backendDockerImagesHome,\n 'Dockerfile.backend-base-java',\n ),\n docsHome: join(frameworkRoot, 'docs'),\n frameworkKnowledgePackageHome,\n frameworkKnowledgeSourceHome,\n frameworkKnowledgeAuthoredSkillsHome: join(frameworkKnowledgeSourceHome, 'skills'),\n frameworkKnowledgeAuthoredPlaybooksHome: join(frameworkKnowledgeSourceHome, 'playbooks'),\n frameworkKnowledgeAuthoredRulesHome: join(frameworkKnowledgeSourceHome, 'rules'),\n frameworkKnowledgeOutputHome,\n frameworkKnowledgeReferencesHome: join(frameworkKnowledgeOutputHome, 'references'),\n frameworkKnowledgeSkillsHome: join(frameworkKnowledgeOutputHome, 'skills'),\n frameworkKnowledgeRegistriesHome: join(frameworkKnowledgeOutputHome, 'registries'),\n frameworkKnowledgePlaybooksHome: join(frameworkKnowledgeOutputHome, 'playbooks'),\n frameworkKnowledgeRulesHome: join(frameworkKnowledgeOutputHome, 'rules'),\n releaseHome: markerHome,\n releaseDistHome,\n releasePublishHome,\n releaseSecretsHome,\n releaseSecretsPath: join(releaseSecretsHome, 'secrets.json'),\n npmPublishManifestsHome: join(releasePublishHome, 'npm-manifests'),\n configLoaderArtifactsHome: join(\n markerHome,\n APP_RUNTIME_SUBDIR_NAMES.DIST,\n APP_RUNTIME_SUBDIR_NAMES.CONFIG_LOADER,\n 'framework',\n ),\n };\n}\n\n/**\n * Build the app declaration-root and runtime-home layout for a SaaS app.\n */\nexport function resolveAppLayout(appRoot: string): AppLayoutPaths {\n const runtimeHome = join(appRoot, WORKSPACE_HOME_NAMES.APP_RUNTIME_HOME);\n const continuityHome = join(\n runtimeHome,\n APP_RUNTIME_SUBDIR_NAMES.CONTINUITY,\n );\n const distHome = join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.DIST);\n const applicationSpecificationsDistHome = join(\n distHome,\n APP_RUNTIME_SUBDIR_NAMES.APPLICATION_SPECIFICATIONS,\n );\n const temporaryHome = join(\n runtimeHome,\n APP_RUNTIME_SUBDIR_NAMES.TEMPORARY,\n );\n const runtimeInfrastructureHome = join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.INFRASTRUCTURE);\n const logsHome = join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.LOGS);\n return {\n declarationRoot: appRoot,\n declarationConfigPath: join(appRoot, AUTHORED_CONFIG_FILE_NAMES.SAAS),\n authoredInfrastructureHome: join(appRoot, APP_RUNTIME_SUBDIR_NAMES.INFRASTRUCTURE),\n runtimeHome,\n continuityHome,\n applicationSubjectManifestPath: join(\n continuityHome,\n APP_CONTINUITY_FILE_NAMES.APPLICATION_SUBJECT_MANIFEST,\n ),\n applicationContinuityBootstrapProfilePath: join(\n continuityHome,\n APP_CONTINUITY_FILE_NAMES.BOOTSTRAP_PROFILE,\n ),\n distHome,\n applicationSpecificationsDistHome,\n applicationSpecificationProjectionsHome: join(\n applicationSpecificationsDistHome,\n APP_RUNTIME_SUBDIR_NAMES.PROJECTIONS,\n ),\n stateHome: join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.STATE),\n temporaryHome,\n integrationTestsTemporaryHome: join(\n temporaryHome,\n APP_RUNTIME_SUBDIR_NAMES.INTEGRATION_TESTS,\n ),\n logsHome,\n companionLogsHome: join(logsHome, 'dev-companion'),\n localDataHome: join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.LOCAL_DATA),\n runtimeInfrastructureHome,\n runtimeEnvironmentsHome: join(runtimeInfrastructureHome, APP_RUNTIME_SUBDIR_NAMES.ENVIRONMENTS),\n deployArtifactsHome: join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.DEPLOY),\n frameworkScriptsHome: join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.FRAMEWORK_SCRIPTS),\n runtimeSignalsHome: join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.RUNTIME_SIGNALS),\n companionHome: join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.COMPANION),\n preferencesOverlayPath: join(runtimeHome, AUTHORED_CONFIG_FILE_NAMES.APP_LOCAL_PREFERENCES),\n configLoaderArtifactsHome: join(\n distHome,\n APP_RUNTIME_SUBDIR_NAMES.CONFIG_LOADER,\n 'saas',\n ),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"workspace-homes.schemas.js","sourceRoot":"","sources":["../../../../src/workspace-scope/workspace-homes.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,I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CAAC,iBAAiB,CAAC;QACnF,kBAAkB,EAAE,IAAI,CAAC,WAAW,EAAE,wBAAwB,CAAC,eAAe,CAAC;QAC/E,aAAa,EAAE,IAAI,CAAC,WAAW,EAAE,wBAAwB,CAAC,SAAS,CAAC;QACpE,sBAAsB,EAAE,IAAI,CAAC,WAAW,EAAE,0BAA0B,CAAC,qBAAqB,CAAC;QAC3F,yBAAyB,EAAE,IAAI,CAC7B,QAAQ,EACR,wBAAwB,CAAC,aAAa,EACtC,MAAM,CACP;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { homedir } from 'os';\nimport { join } from 'path';\nimport type { WorkspaceScopeResult } from './workspace-scope.schemas';\nimport {\n AUTHORED_CONFIG_FILE_NAMES,\n APP_CONTINUITY_FILE_NAMES,\n APP_RUNTIME_SUBDIR_NAMES,\n MACHINE_HOME_NAMES,\n WORKSPACE_HOME_NAMES,\n WorkspaceScope,\n} from './workspace-scope.schemas';\n\nexport interface MachineLayoutPaths {\n home: string;\n preferencesPath: string;\n /** Machine-local root for all continuity authority domains and subjects. */\n continuityHome: string;\n /**\n * Machine-local authority-domain manifest.\n *\n * The manifest identifies a storage/writer namespace. It is deliberately\n * outside every subject directory because one local authority domain may\n * own several application subjects.\n */\n continuityAuthorityDomainManifestPath: string;\n /** Root containing `domains/<authority-domain-id>/subjects/...`. */\n continuityDomainsHome: string;\n}\n\nexport interface FrameworkLayoutPaths {\n repositoryRoot: string;\n rootPackageJsonPath: string;\n pnpmLockfilePath: string;\n engineHome: string;\n platformHome: string;\n /**\n * The THIRD workspace home (plan D9): one package per provider, several facet barrels each,\n * deliberately OUTSIDE `engine/` so that \"out of the core engine\" is a directory rather than a\n * convention. Named for the HOME, never for a package in it — which provider inhabits it first is\n * a decision of the slice that generates providers, not of the layout.\n *\n * It is a field here because this interface is what makes a home VISIBLE to tooling: publish\n * discovery, framework-knowledge generation and the anchor audit all take their scan roots from\n * `engineHome` + `platformHome`, and a home absent from that pair is not excluded — it is\n * unseen. An unseen home reports clean, which is the shape\n * `negative-results-require-a-positive-probe.md` exists for: a `@wildo_source` anchor in a\n * provider package would never reach a skill, and nothing would say so.\n */\n providersHome: string;\n examplesHome: string;\n markerHome: string;\n declarationConfigPath: string;\n templatesHome: string;\n infraTemplatesHome: string;\n dockerComposeTemplatesHome: string;\n ciTemplatesHome: string;\n k8sTemplatesHome: string;\n dockerImagesTemplatesHome: string;\n platformBaseDockerfilePath: string;\n backendBaseDockerfilePath: string;\n backendJavaDockerfilePath: string;\n docsHome: string;\n frameworkKnowledgePackageHome: string;\n frameworkKnowledgeSourceHome: string;\n /**\n * Home of **authored** skill folders (`src/skills/<skill_id>/SKILL.md` + supporting\n * markdown). Distinct from {@link frameworkKnowledgeSkillsHome}, which is the\n * **materialized** output home under `dist/knowledge/skills/`. Keeping the two\n * names clearly separated prevents accidental conflation between authored\n * source and generated artifact.\n */\n frameworkKnowledgeAuthoredSkillsHome: string;\n /**\n * Home of **authored** playbook folders\n * (`src/playbooks/<ref>/playbook.json` + `method.md`). Playbooks are the\n * meta-workflow artifact kind (app-creation methodology definitions) — a\n * distinct compilation lane from skills, so they get their own authored\n * home instead of polluting the skills router. Mirrors the\n * authored-vs-materialized split of\n * {@link frameworkKnowledgeAuthoredSkillsHome} /\n * {@link frameworkKnowledgeSkillsHome}.\n */\n frameworkKnowledgeAuthoredPlaybooksHome: string;\n /**\n * Home of **authored** always-on rules (`src/rules/*.md`).\n *\n * A rule is policy an application's coding agent should have at its elbow WITHOUT routing to a\n * skill first — the distinction the skills router cannot express, because a router match requires\n * the agent to already suspect the topic. Authored-vs-materialized split as above:\n * {@link frameworkKnowledgeRulesHome} is the compiled output.\n */\n frameworkKnowledgeAuthoredRulesHome: string;\n frameworkKnowledgeOutputHome: string;\n frameworkKnowledgeReferencesHome: string;\n frameworkKnowledgeSkillsHome: string;\n frameworkKnowledgeRegistriesHome: string;\n /** Materialized playbook output home under `dist/knowledge/playbooks/`. */\n frameworkKnowledgePlaybooksHome: string;\n /** Materialized rule output home under `dist/knowledge/rules/`. */\n frameworkKnowledgeRulesHome: string;\n releaseHome: string;\n releaseDistHome: string;\n releasePublishHome: string;\n releaseSecretsHome: string;\n releaseSecretsPath: string;\n npmPublishManifestsHome: string;\n configLoaderArtifactsHome: string;\n}\n\nexport interface AppLayoutPaths {\n declarationRoot: string;\n declarationConfigPath: string;\n authoredInfrastructureHome: string;\n runtimeHome: string;\n /** Tracked portable identity/bootstrap inputs for local continuity. */\n continuityHome: string;\n applicationSubjectManifestPath: string;\n applicationContinuityBootstrapProfilePath: string;\n distHome: string;\n /** Generated application-specification runtime outputs. */\n applicationSpecificationsDistHome: string;\n applicationSpecificationProjectionsHome: string;\n stateHome: string;\n /** Disposable application-owned workspaces; never application truth. */\n temporaryHome: string;\n integrationTestsTemporaryHome: string;\n logsHome: string;\n companionLogsHome: string;\n localDataHome: string;\n runtimeInfrastructureHome: string;\n runtimeEnvironmentsHome: string;\n /**\n * Root of the env-scoped deployment-artifact staging area\n * (`.wildo-saas/deploy/`). Per-env renders live at `<home>/<envName>/`.\n * Always secret-bearing — see {@link APP_RUNTIME_SUBDIR_NAMES.DEPLOY}.\n */\n deployArtifactsHome: string;\n frameworkScriptsHome: string;\n runtimeSignalsHome: string;\n companionHome: string;\n preferencesOverlayPath: string;\n configLoaderArtifactsHome: string;\n}\n\nexport interface ResolvedMachineHomes {\n layout: MachineLayoutPaths;\n hasPreferencesFile: boolean;\n}\n\nexport interface ResolvedFrameworkHomes {\n repositoryRoot: string | null;\n markerHome: string | null;\n declarationConfigPath: string | null;\n layout: FrameworkLayoutPaths | null;\n /**\n * True ONLY when the caller's `cwd` sits inside a framework workspace that\n * was discovered by walking up for `wildo-framework.info.json`. A framework\n * root derived from `frameworkPathHint` (machine preferences) populates\n * `repositoryRoot` and `layout`, but leaves this flag `false` because the\n * caller is NOT operating from inside the framework repo — they merely have\n * a pointer to it. Consumers that need \"am I currently developing the\n * framework?\" must read this field; consumers that need \"can I read\n * framework-owned assets from here?\" must read\n * `ResolvedHomeCapabilities.canUseFrameworkAssets`.\n */\n isInFrameworkWorkspace: boolean;\n}\n\nexport interface ResolvedAppHomes {\n declarationRoot: string | null;\n runtimeHome: string | null;\n saasConfigPath: string | null;\n layout: AppLayoutPaths | null;\n isInAppWorkspace: boolean;\n}\n\n/**\n * Pre-computed, semantic booleans that gate downstream CLI / companion /\n * runtime behavior based on the resolved-homes snapshot.\n *\n * Each flag is intentionally separate because they answer different questions\n * — merging any two of them (\"are we in a framework workspace?\" vs \"can we\n * reach framework assets?\") would silently reintroduce the Phase 5\n * env-vs-context confusion we explicitly killed:\n *\n * - `hasMachinePreferences` — A `preferences.json` file exists under the\n * machine Wildo home. `canUseFrameworkAssets` can be true without this\n * flag being true (e.g. the preferences hint was seeded in a session that\n * never persisted), and vice versa.\n * - `hasFrameworkWorkspace` — The caller's `cwd` is inside a framework\n * workspace (walk-up found `wildo-framework.info.json`). Equivalent to\n * `framework.isInFrameworkWorkspace`; duplicated here so capability checks\n * are one-stop-shop without having to reach into the nested roots.\n * - `hasAppWorkspace` — The caller's `cwd` is inside a SaaS app workspace\n * (walk-up found `wildo.saas.config.ts`). Equivalent to\n * `app.isInAppWorkspace`.\n * - `hasFrameworkDeveloperCapabilities` — Either the operator is actually\n * sitting inside the framework workspace (`hasFrameworkWorkspace`) OR the\n * `isFrameworkDeveloperHint` from preferences is true. This is metadata\n * used by commands that surface framework-dev-only tooling — it never\n * participates in path resolution.\n * - `canUseFrameworkAssets` — The resolved snapshot has a usable framework\n * `repositoryRoot` (either because the caller is inside one, or because a\n * validated hint pointed at one). This is the flag used by consumers that\n * need to READ framework-owned paths (scripts, shared dist, etc.) — it is\n * intentionally broader than `hasFrameworkWorkspace` so that apps can\n * reach framework assets without the caller pretending to be \"in\" the\n * framework workspace.\n * - `canUseAppRuntimeHome` — The resolved snapshot has a usable\n * `.wildo-saas/` runtime home. Required by anything that writes runtime\n * signals, caches, generated files, etc.\n */\nexport interface ResolvedHomeCapabilities {\n hasMachinePreferences: boolean;\n hasFrameworkWorkspace: boolean;\n hasAppWorkspace: boolean;\n hasFrameworkDeveloperCapabilities: boolean;\n canUseFrameworkAssets: boolean;\n canUseAppRuntimeHome: boolean;\n}\n\nexport interface ResolvedHomes {\n workspaceScope: WorkspaceScopeResult;\n scope: WorkspaceScope;\n machine: ResolvedMachineHomes;\n framework: ResolvedFrameworkHomes;\n app: ResolvedAppHomes;\n capabilities: ResolvedHomeCapabilities;\n}\n\n/**\n * Build the machine-global Wildo home layout under the current user's home.\n */\nexport function resolveMachineLayout(userHome: string = homedir()): MachineLayoutPaths {\n const home = join(userHome, MACHINE_HOME_NAMES.MACHINE_HOME);\n const continuityHome = join(home, 'continuity');\n return {\n home,\n preferencesPath: join(home, AUTHORED_CONFIG_FILE_NAMES.PREFERENCES),\n continuityHome,\n continuityAuthorityDomainManifestPath: join(\n continuityHome,\n 'authority-domain.json',\n ),\n continuityDomainsHome: join(continuityHome, 'domains'),\n };\n}\n\n/**\n * Build the framework-owned homes and asset roots for a framework repository.\n */\nexport function resolveFrameworkLayout(frameworkRoot: string): FrameworkLayoutPaths {\n const markerHome = join(frameworkRoot, WORKSPACE_HOME_NAMES.FRAMEWORK_HOME);\n const engineHome = join(frameworkRoot, 'engine');\n const platformHome = join(frameworkRoot, 'platform');\n const providersHome = join(frameworkRoot, 'providers');\n const examplesHome = join(frameworkRoot, 'examples');\n const templatesHome = join(frameworkRoot, 'templates');\n const infraTemplatesHome = join(templatesHome, 'infra');\n const dockerImagesTemplatesHome = join(infraTemplatesHome, 'docker-images');\n const backendDockerImagesHome = join(dockerImagesTemplatesHome, 'backend');\n const frameworkKnowledgePackageHome = join(platformHome, 'factory', 'framework-knowledge');\n const frameworkKnowledgeSourceHome = join(frameworkKnowledgePackageHome, 'src');\n const frameworkKnowledgeOutputHome = join(frameworkKnowledgePackageHome, 'dist', 'knowledge');\n const releaseDistHome = join(markerHome, APP_RUNTIME_SUBDIR_NAMES.DIST);\n const releasePublishHome = join(releaseDistHome, 'publish');\n const releaseSecretsHome = join(markerHome, 'framework-secrets');\n return {\n repositoryRoot: frameworkRoot,\n rootPackageJsonPath: join(frameworkRoot, 'package.json'),\n pnpmLockfilePath: join(frameworkRoot, 'pnpm-lock.yaml'),\n engineHome,\n platformHome,\n providersHome,\n examplesHome,\n markerHome,\n declarationConfigPath: join(markerHome, AUTHORED_CONFIG_FILE_NAMES.FRAMEWORK),\n templatesHome,\n infraTemplatesHome,\n dockerComposeTemplatesHome: join(infraTemplatesHome, 'docker-compose'),\n ciTemplatesHome: join(infraTemplatesHome, 'ci'),\n k8sTemplatesHome: join(infraTemplatesHome, 'k8s'),\n dockerImagesTemplatesHome,\n platformBaseDockerfilePath: join(\n dockerImagesTemplatesHome,\n 'platform',\n 'Dockerfile.platform-base',\n ),\n backendBaseDockerfilePath: join(\n backendDockerImagesHome,\n 'Dockerfile.backend-base',\n ),\n backendJavaDockerfilePath: join(\n backendDockerImagesHome,\n 'Dockerfile.backend-base-java',\n ),\n docsHome: join(frameworkRoot, 'docs'),\n frameworkKnowledgePackageHome,\n frameworkKnowledgeSourceHome,\n frameworkKnowledgeAuthoredSkillsHome: join(frameworkKnowledgeSourceHome, 'skills'),\n frameworkKnowledgeAuthoredPlaybooksHome: join(frameworkKnowledgeSourceHome, 'playbooks'),\n frameworkKnowledgeAuthoredRulesHome: join(frameworkKnowledgeSourceHome, 'rules'),\n frameworkKnowledgeOutputHome,\n frameworkKnowledgeReferencesHome: join(frameworkKnowledgeOutputHome, 'references'),\n frameworkKnowledgeSkillsHome: join(frameworkKnowledgeOutputHome, 'skills'),\n frameworkKnowledgeRegistriesHome: join(frameworkKnowledgeOutputHome, 'registries'),\n frameworkKnowledgePlaybooksHome: join(frameworkKnowledgeOutputHome, 'playbooks'),\n frameworkKnowledgeRulesHome: join(frameworkKnowledgeOutputHome, 'rules'),\n releaseHome: markerHome,\n releaseDistHome,\n releasePublishHome,\n releaseSecretsHome,\n releaseSecretsPath: join(releaseSecretsHome, 'secrets.json'),\n npmPublishManifestsHome: join(releasePublishHome, 'npm-manifests'),\n configLoaderArtifactsHome: join(\n markerHome,\n APP_RUNTIME_SUBDIR_NAMES.DIST,\n APP_RUNTIME_SUBDIR_NAMES.CONFIG_LOADER,\n 'framework',\n ),\n };\n}\n\n/**\n * Build the app declaration-root and runtime-home layout for a SaaS app.\n */\nexport function resolveAppLayout(appRoot: string): AppLayoutPaths {\n const runtimeHome = join(appRoot, WORKSPACE_HOME_NAMES.APP_RUNTIME_HOME);\n const continuityHome = join(\n runtimeHome,\n APP_RUNTIME_SUBDIR_NAMES.CONTINUITY,\n );\n const distHome = join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.DIST);\n const applicationSpecificationsDistHome = join(\n distHome,\n APP_RUNTIME_SUBDIR_NAMES.APPLICATION_SPECIFICATIONS,\n );\n const temporaryHome = join(\n runtimeHome,\n APP_RUNTIME_SUBDIR_NAMES.TEMPORARY,\n );\n const runtimeInfrastructureHome = join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.INFRASTRUCTURE);\n const logsHome = join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.LOGS);\n return {\n declarationRoot: appRoot,\n declarationConfigPath: join(appRoot, AUTHORED_CONFIG_FILE_NAMES.SAAS),\n authoredInfrastructureHome: join(appRoot, APP_RUNTIME_SUBDIR_NAMES.INFRASTRUCTURE),\n runtimeHome,\n continuityHome,\n applicationSubjectManifestPath: join(\n continuityHome,\n APP_CONTINUITY_FILE_NAMES.APPLICATION_SUBJECT_MANIFEST,\n ),\n applicationContinuityBootstrapProfilePath: join(\n continuityHome,\n APP_CONTINUITY_FILE_NAMES.BOOTSTRAP_PROFILE,\n ),\n distHome,\n applicationSpecificationsDistHome,\n applicationSpecificationProjectionsHome: join(\n applicationSpecificationsDistHome,\n APP_RUNTIME_SUBDIR_NAMES.PROJECTIONS,\n ),\n stateHome: join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.STATE),\n temporaryHome,\n integrationTestsTemporaryHome: join(\n temporaryHome,\n APP_RUNTIME_SUBDIR_NAMES.INTEGRATION_TESTS,\n ),\n logsHome,\n companionLogsHome: join(logsHome, 'dev-companion'),\n localDataHome: join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.LOCAL_DATA),\n runtimeInfrastructureHome,\n runtimeEnvironmentsHome: join(runtimeInfrastructureHome, APP_RUNTIME_SUBDIR_NAMES.ENVIRONMENTS),\n deployArtifactsHome: join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.DEPLOY),\n frameworkScriptsHome: join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.FRAMEWORK_SCRIPTS),\n runtimeSignalsHome: join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.RUNTIME_SIGNALS),\n companionHome: join(runtimeHome, APP_RUNTIME_SUBDIR_NAMES.COMPANION),\n preferencesOverlayPath: join(runtimeHome, AUTHORED_CONFIG_FILE_NAMES.APP_LOCAL_PREFERENCES),\n configLoaderArtifactsHome: join(\n distHome,\n APP_RUNTIME_SUBDIR_NAMES.CONFIG_LOADER,\n 'saas',\n ),\n };\n}\n"]}
|