@wildo-ai/platform-config-lib 1.1.6 → 1.1.7
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/_unimplemented/index.d.ts.map +1 -1
- package/dist/esm/_unimplemented/index.js.map +1 -1
- package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
- package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
- package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +1 -1
- package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +1 -1
- package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
- package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
- package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
- package/dist/esm/config-authoring.entry.d.ts.map +1 -1
- package/dist/esm/config-authoring.entry.js.map +1 -1
- package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
- package/dist/esm/credentials/credential-generator.service.js.map +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
- package/dist/esm/lockfile/build-parallelism.js.map +1 -1
- package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
- package/dist/esm/lockfile/canonical-json.js.map +1 -1
- package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
- package/dist/esm/lockfile/lockfile-io.js.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
- package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
- package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
- package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-framework-config.js.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-minion-config.js.map +1 -1
- package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-saas-config.js.map +1 -1
- package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-worker-config.js.map +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/index.d.ts.map +1 -1
- package/dist/esm/project-config/index.js.map +1 -1
- package/dist/esm/project-config/loader.d.ts.map +1 -1
- package/dist/esm/project-config/loader.js.map +1 -1
- package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
- package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
- package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
- package/dist/esm/project-config/npm-version-range.js.map +1 -1
- package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
- package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -1
- package/dist/esm/project-config/shared/cdn.example.js.map +1 -1
- package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
- package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
- package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/schema-version.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
- package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
- package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
- package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
- package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
- package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/digest.schemas.js.map +1 -1
- package/dist/esm/registry/index.d.ts.map +1 -1
- package/dist/esm/registry/index.js.map +1 -1
- package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
- package/dist/esm/registry/local-checkout-source.js.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
- package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
- package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-search.schemas.js.map +1 -1
- package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-config.schemas.js.map +1 -1
- package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
- package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
- package/dist/esm/registry/registry-errors.d.ts.map +1 -1
- package/dist/esm/registry/registry-errors.js.map +1 -1
- package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
- package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
- package/dist/esm/release/framework-release.constants.js.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
- package/dist/esm/workspace-scope/index.d.ts.map +1 -1
- package/dist/esm/workspace-scope/index.js.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
- package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +7 -7
- package/dist/esm/registry/companion-api.schemas.d.ts +0 -0
- package/dist/esm/registry/companion-api.schemas.d.ts.map +0 -0
- package/dist/esm/registry/companion-api.schemas.js.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-keys.schemas.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"registry-keys.schemas.js","sourceRoot":"","sources":["../../../src/registry/registry-keys.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAErE,uHAAuH;AACvH,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,qGAAqG;IACrG,gCAAa,CAAA;IACb,uFAAuF;IACvF,sCAAmB,CAAA;AACrB,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,CAAC;AACnD,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAEhD,uFAAuF;AACvF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,6BAA6B,EAAE;IACnF,KAAK,EAAE,iFAAiF;CACzF,CAAC,CAAC;AAEH,4FAA4F;AAC5F,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AAE9E,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,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S,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;AAGxI,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,gBAAgB,EAAE,iCAAiC,EAAE,CAAC,CAAC;AAElH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,gBAAgB,EAAE,iCAAiC,EAAE,CAAC,CAAC;AAEtH,iDAAiD;AACjD,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAC/D,MAAM,UAAU,0BAA0B,CAAC,QAAgB;IACzD,OAAO,GAAG,wBAAwB,IAAI,kBAAkB,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC9E,CAAC","sourcesContent":["/**\n * Wire contract of the platform's module-registry key door (#1756): apps-manager\n * `/admin/registry/keys`, called by `wildo registry key`. Shared here because the two ends are\n * different packages and neither may import the other.\n *\n * ## A key belongs to an ORGANIZATION, and says so\n *\n * The registry authorizes against `ownerOrganizationId` on its domain and module rows, so a registry\n * key's authority is its organization: a publish key may publish into EVERY domain that organization\n * owns. The door therefore addresses an organization, not an application. An earlier draft took an\n * `appSlug` and resolved its owner, which read as a per-application key while narrowing nothing: every\n * application a platform registers is owned by the one platform owner organization\n * (`WILDO_OWNER_ORGANIZATION`), so a key \"for application A\" could publish into application B's domains.\n * A parameter that looks like a scope and scopes nothing is a false control, so it was removed.\n * Omit `organizationSlug` for the platform owner organization, the common case.\n */\n\nimport { z } from 'zod';\nimport { ApiKeyStatus, CORE_ORG_ROLES } from '@wildo-ai/saas-models';\n\n/** The roles a registry key may carry — mapped by apps-manager onto the two roles the registry's resources declare. */\nexport enum RegistryKeyRole {\n /** Read RESTRICTED modules (resolve, info, download) — an install / CI key. Carries `ORG_MEMBER`. */\n READ = 'read',\n /** Publish, yank and tag in the owning organization's domains. Carries `ORG_ADMIN`. */\n PUBLISH = 'publish',\n}\n\n/** A registry key always expires; the operator re-mints rather than extending. */\nexport const REGISTRY_KEY_DEFAULT_EXPIRY_DAYS = 90;\nexport const REGISTRY_KEY_MAX_EXPIRY_DAYS = 365;\n\n/** A key's operator-facing name: lowercase letters, digits, `.`, `_`, `-` (max 64). */\nexport const RegistryKeyNameSchema = z.string().regex(/^[a-z0-9][a-z0-9._-]{0,63}$/, {\n error: 'a registry key name must be lowercase letters, digits, \".\", \"_\" or \"-\" (max 64)',\n});\n\n/** The organization a key belongs to, by slug. Absent = the platform owner organization. */\nexport const RegistryKeyOrganizationSlugSchema = z.string().min(1).optional();\n\nexport const RegistryKeyMintRequestSchema = z.strictObject({\n organizationSlug: RegistryKeyOrganizationSlugSchema,\n name: RegistryKeyNameSchema,\n role: z.enum(RegistryKeyRole),\n expiresInDays: z.number().int().min(1).max(REGISTRY_KEY_MAX_EXPIRY_DAYS).optional(),\n});\nexport type RegistryKeyMintRequest = z.infer<typeof RegistryKeyMintRequestSchema>;\n\nexport const RegistryKeyMintResponseSchema = z.object({\n apiKeyId: z.string().min(1),\n /** The secret — returned exactly once, never stored by the platform. */\n plainKey: z.string().min(1),\n keyPrefix: z.string().min(1),\n organizationId: z.string().min(1),\n organizationSlug: z.string().min(1),\n role: z.enum(RegistryKeyRole),\n expiresAt: z.iso.datetime(),\n});\nexport type RegistryKeyMintResponse = z.infer<typeof RegistryKeyMintResponseSchema>;\n\nexport const RegistryKeySummarySchema = z.object({\n apiKeyId: z.string().min(1),\n name: z.string(),\n keyPrefix: z.string(),\n roles: z.array(z.enum(CORE_ORG_ROLES)),\n status: z.enum(ApiKeyStatus),\n expiresAt: z.iso.datetime().optional(),\n});\nexport type RegistryKeySummary = z.infer<typeof RegistryKeySummarySchema>;\n\nexport const RegistryKeyListResponseSchema = z.object({ organizationSlug: z.string().min(1), keys: z.array(RegistryKeySummarySchema) });\nexport type RegistryKeyListResponse = z.infer<typeof RegistryKeyListResponseSchema>;\n\nexport const RegistryKeyListQuerySchema = z.strictObject({ organizationSlug: RegistryKeyOrganizationSlugSchema });\n\nexport const RegistryKeyRevokeRequestSchema = z.strictObject({ organizationSlug: RegistryKeyOrganizationSlugSchema });\n\n/** Admin-door paths, one place for both ends. */\nexport const REGISTRY_KEYS_ADMIN_PATH = '/admin/registry/keys';\nexport function buildRegistryKeyRevokePath(apiKeyId: string): string {\n return `${REGISTRY_KEYS_ADMIN_PATH}/${encodeURIComponent(apiKeyId)}/revoke`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-section-schemas.constants.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"registry-section-schemas.constants.d.ts","sourceRoot":"","sources":["../../../src/registry/registry-section-schemas.constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEnC,CAAC;AAEX,MAAM,MAAM,6BAA6B,GAAG,OAAO,gCAAgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-section-schemas.constants.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"registry-section-schemas.constants.js","sourceRoot":"","sources":["../../../src/registry/registry-section-schemas.constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAEtF,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,OAAO,EAAE,gCAAgC;CACjC,CAAC","sourcesContent":["/**\n * `DEFAULT_REGISTRY_SECTION_SCHEMAS` — the section-schema registry\n * every CLI-side lockfile reader/writer should pass to the shared\n * lockfile library.\n *\n * The lockfile envelope (`SaasLockfileEnvelopeSchema`) is permissive\n * about unknown sections (`.catchall(z.unknown())`), so a reader\n * that does not validate `sections.modules` at parse time will\n * silently see whatever bytes happen to be there. The\n * `DEFAULT_REGISTRY_SECTION_SCHEMAS` map keeps every CLI caller\n * honest by giving them a single import to validate the registry's\n * own section.\n *\n * Companion callers extend this map with their own i18n schema\n * (and any other companion-owned section) — see KD-4. The CLI\n * uses this constant as-is.\n */\n\nimport { RegistryModulesLockSectionSchema } from './lockfile-modules-section.schemas';\n\nexport const DEFAULT_REGISTRY_SECTION_SCHEMAS = {\n modules: RegistryModulesLockSectionSchema,\n} as const;\n\nexport type DefaultRegistrySectionSchemas = typeof DEFAULT_REGISTRY_SECTION_SCHEMAS;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-release.constants.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"framework-release.constants.d.ts","sourceRoot":"","sources":["../../../src/release/framework-release.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,sCAAsC,cAAc,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-release.constants.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"framework-release.constants.js","sourceRoot":"","sources":["../../../src/release/framework-release.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG,WAAW,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,WAAW,CAAC;AAElE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,SAAS,CAAC","sourcesContent":["export const FRAMEWORK_RELEASE_NPM_SCOPE = '@wildo-ai';\n\n/**\n * Container registry that hosts the published framework images.\n *\n * Declared EXPLICITLY rather than left to Docker's default resolution: a bare\n * `<namespace>/<image>` reference silently means Docker Hub, and naming the host\n * makes the choice reviewable and a future move a config change instead of an\n * archaeology exercise. Every consumer-side reference (the compose template's\n * `platformImageRef`) is built from these two constants, and the publish lane\n * refuses any framework config that names a different pair.\n *\n * ## History, because it moved twice\n *\n * Docker Hub (`wildoai`) was the original home; the images `wildoai/wildo-platform:0.2.0`\n * and `:1.0.1` were pushed there in April 2026. On 2026-08-26 the lane was moved to GHCR\n * (`ghcr.io/wildo-ai`) for two reasons: publication could authenticate with a workflow's\n * own run-scoped `GITHUB_TOKEN`, and public GHCR pulls carry no anonymous pull-rate limit.\n * Neither reason was ever exercised — no publish CI exists, and the lane runs from a\n * developer machine — while the only container credential the framework holds is the\n * Docker Hub one. The first real GHCR publish (2026-09-04) was refused for exactly that.\n * Paul decided on 2026-09-05 to go BACK to Docker Hub rather than mint a second credential.\n *\n * If the lane ever moves to CI, the GHCR argument returns; move both constants and the\n * framework config together, and the publish-lane pin and the compose pins will say so.\n */\nexport const FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST = 'docker.io';\n\n/**\n * Owner namespace under {@link FRAMEWORK_RELEASE_DOCKER_REGISTRY_HOST} — the Docker Hub\n * organization (`wildoai`, no hyphen: Docker Hub namespaces cannot carry one, which is why\n * it differs from the GitHub organization `wildo-ai` and the npm scope `@wildo-ai`).\n */\nexport const FRAMEWORK_RELEASE_DOCKER_NAMESPACE = 'wildoai';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-info.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"framework-info.schemas.d.ts","sourceRoot":"","sources":["../../../src/schemas/framework-info.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,wBAAwB;;;;iBAInC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-info.schemas.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"framework-info.schemas.js","sourceRoot":"","sources":["../../../src/schemas/framework-info.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CACnC,iBAAiB,EACjB,kDAAkD,CACnD,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IAC3C,OAAO,EAAE,YAAY;IACrB,aAAa,EAAE,YAAY;CAC5B,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\nconst SemverSchema = z.string().regex(\n /^\\d+\\.\\d+\\.\\d+$/,\n 'must be a simple semver string in the form x.y.z',\n);\n\nexport const WildoFrameworkInfoSchema = z.object({\n name: z.string().min(1).default('wildo-ai'),\n version: SemverSchema,\n minCliVersion: SemverSchema,\n});\nexport type WildoFrameworkInfo = z.infer<typeof WildoFrameworkInfoSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-secrets.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"framework-secrets.schemas.d.ts","sourceRoot":"","sources":["../../../src/schemas/framework-secrets.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,qCAAqC;;iBAEhD,CAAC;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG,eAAO,MAAM,wCAAwC;;;iBAGnD,CAAC;AACH,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;AAE1G;;;;;;;;GAQG;AACH,eAAO,MAAM,kCAAkC,2EAG7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,eAAO,MAAM,2BAA2B;;;;;;;;;iBAItC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framework-secrets.schemas.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"framework-secrets.schemas.js","sourceRoot":"","sources":["../../../src/schemas/framework-secrets.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5D,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAChC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,wCAAwC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/D,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC7C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAChC,CAAC,CAAC;AAGH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC;IACxD,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;CACjC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,kCAAkC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC1F,MAAM,EAAE,wCAAwC,CAAC,QAAQ,EAAE;IAC3D,GAAG,EAAE,qCAAqC,CAAC,QAAQ,EAAE;CACtD,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\nexport const WildoFrameworkPublishNpmSecretsSchema = z.object({\n publishToken: z.string().min(1),\n});\nexport type WildoFrameworkPublishNpmSecrets = z.infer<typeof WildoFrameworkPublishNpmSecretsSchema>;\n\nexport const WildoFrameworkPublishDockerSecretsSchema = z.object({\n publishUsername: z.string().min(1).optional(),\n publishToken: z.string().min(1),\n});\nexport type WildoFrameworkPublishDockerSecrets = z.infer<typeof WildoFrameworkPublishDockerSecretsSchema>;\n\n/**\n * One provider's credentials in the framework secrets file: a single secret (an API key), or a named\n * set of them when the provider issues several — Slack issues a bot token, an app token, OAuth\n * access/refresh tokens and identifiers that belong together.\n *\n * Until 2026-09-24 only the single-string form was accepted. A Slack credential set stored under\n * `providers.slack` then made the WHOLE file unparseable, and `wildo fwk publish npm` — which reads\n * nothing but `npm.publishToken` — refused every release with a Zod error about Slack.\n */\nexport const WildoFrameworkProviderSecretSchema = z.union([\n z.string().min(1),\n z.record(z.string(), z.string()),\n]);\nexport type WildoFrameworkProviderSecret = z.infer<typeof WildoFrameworkProviderSecretSchema>;\n\nexport const WildoFrameworkSecretsSchema = z.object({\n providers: z.record(z.string(), WildoFrameworkProviderSecretSchema).optional().default({}),\n docker: WildoFrameworkPublishDockerSecretsSchema.optional(),\n npm: WildoFrameworkPublishNpmSecretsSchema.optional(),\n});\nexport type WildoFrameworkSecrets = z.infer<typeof WildoFrameworkSecretsSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-application-config.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-application-config.schemas.d.ts","sourceRoot":"","sources":["../../../src/schemas/platform-application-config.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kCAAkC;;;;iBAe7C,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-application-config.schemas.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-application-config.schemas.js","sourceRoot":"","sources":["../../../src/schemas/platform-application-config.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD;;;;;;;;OAQG;IACH,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE,CAAC,iBAAiB,EAAE;IAEhG,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAEtD,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC3D,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * Platform Application Config Schema\n * \n * Stored in MongoDB, fetched by platform services via\n * GET /platform-services-to-manager/config-secrets.\n * \n * After T4, platform service URLs and infrastructure addresses are sourced from\n * each service's env vars (generated by CLI). This schema only contains data\n * that apps-manager manages dynamically:\n * - jwtPublicKeys: rotatable public keys for inter-service JWT verification\n * - customConfig: service-specific key-value configuration\n */\nexport const Platform_Application_Config_Schema = z.object({\n /**\n * The owning platform service — and the SINGLETON key of this document, declared unique\n * 2026-08-12, for the same reason as its sibling on `Platform_Application_Secrets_Schema`:\n * exactly one config row per platform service, addressed and upserted by this filter, and a\n * PostgreSQL `ON CONFLICT (platformApplicationId)` target must name a UNIQUE constraint.\n *\n * Cleared against the live MongoDB platform before declaring it (no duplicates, no missing\n * values); the engine reconciles the plain → unique index drift at boot.\n */\n platformApplicationId: z.string().isUnique().isForeignKey().isSummaryField().excludeFromUpdate(),\n \n jwtPublicKeys: z.record(z.string(), z.string().min(1)),\n \n customConfig: z.record(z.string(), z.unknown()).optional(),\n});\n\nexport type Platform_Application_Config = z.infer<typeof Platform_Application_Config_Schema>;\n\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-application-secrets.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-application-secrets.schemas.d.ts","sourceRoot":"","sources":["../../../src/schemas/platform-application-secrets.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuE9C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-application-secrets.schemas.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-application-secrets.schemas.js","sourceR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AC7D,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;KACzC,CAAC,CAAC,QAAQ,EAAE;IAEb,uEAAuE;IACvE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;QAChB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC5B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;KACrC,CAAC,CAAC,QAAQ,EAAE;CACd,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * Platform Application Secrets Schema\n * \n * This schema defines all secrets for platform microservices.\n * These secrets are stored in MongoDB and fetched by platform services via the\n * GET /platform-services-to-manager/config-secrets endpoint.\n * \n * Structure:\n * - primarySecret: The primary authentication secret for the service\n * - jwt: Private/public keys for JWT signing/verification\n * - redis: Redis ACL credentials\n * - rabbitmq: RabbitMQ user credentials\n * - mongo: MongoDB connection credentials (optional, for services that need direct DB access)\n * - storage: S3/MinIO credentials (optional, for services that need storage access)\n */\nexport const Platform_Application_Secrets_Schema = z.object({\n /**\n * The owning platform service — and the SINGLETON key of this document, declared unique\n * 2026-08-12.\n *\n * One secrets document per platform service is what every reader and writer already assumes:\n * the infra-manager reads it with `findOne({ platformApplicationId })` and writes it with an\n * upsert on the same filter. A second row would silently shadow the first, and which one won\n * would depend on natural order.\n *\n * The constraint becomes REQUIRED when that upsert moves to the repositories plane: PostgreSQL\n * spells it `INSERT … ON CONFLICT (platformApplicationId)`, and a conflict target must name a\n * UNIQUE constraint. See the same reasoning on `Platform_Application_Schema.name`, including the\n * measurement clearing the existing MongoDB platform (no duplicates, no missing values, and the\n * engine's unique-index drift reconciliation covers the plain → unique transition).\n */\n platformApplicationId: z.string().isUnique().isForeignKey().isSummaryField().excludeFromUpdate(),\n \n // Primary authentication secret for inter-service auth\n primarySecret: z.string().min(1).optional(),\n \n // JWT private/public keys for signing/verification\n jwt: z.object({\n privateKey: z.record(z.string(), z.string().min(1).optional()),\n publicKey: z.record(z.string(), z.string().min(1).optional()).optional(),\n }),\n \n // Redis ACL credentials\n redis: z.object({\n username: z.string().min(1),\n password: z.string().min(1),\n }).optional(),\n \n // RabbitMQ user credentials\n rabbitmq: z.object({\n username: z.string().min(1),\n password: z.string().min(1),\n vhost: z.string().default('/'),\n }).optional(),\n \n // MongoDB credentials (for services that need direct DB access)\n mongo: z.object({\n username: z.string().min(1).optional(),\n password: z.string().min(1).optional(),\n databaseName: z.string().min(1).optional(),\n // Full connection URL (alternative to username/password)\n connectUrl: z.string().min(1).optional(),\n }).optional(),\n \n // PostgreSQL credentials (for services that need PostgreSQL access)\n postgresql: z.object({\n /** PostgreSQL host */\n host: z.string().min(1).optional(),\n /** PostgreSQL port (default: 5432) */\n port: z.number().int().default(5432),\n /** Database username */\n username: z.string().min(1).optional(),\n /** Database password */\n password: z.string().min(1).optional(),\n /** Database name */\n databaseName: z.string().min(1).optional(),\n /** Full connection URL (alternative to individual fields) */\n connectUrl: z.string().min(1).optional(),\n }).optional(),\n \n // S3/MinIO storage credentials (for services that need storage access)\n storage: z.object({\n accessKey: z.string().min(1),\n secretKey: z.string().min(1),\n bucket: z.string().min(1).optional(),\n }).optional(),\n});\n\nexport type Platform_Application_Secrets = z.infer<typeof Platform_Application_Secrets_Schema>;\n\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-config.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-config.schemas.d.ts","sourceRoot":"","sources":["../../../src/schemas/platform-config.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,oCAAoC;;iBAE/C,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAE3F;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;iBAKnC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqBpC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACzE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE3E,MAAM,MAAM,6BAA6B,GAAG;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-config.schemas.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"platform-config.schemas.js","sourceRoot":"","sources":["../../../src/schemas/platform-config.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kCAAkC,EAAE,MAAM,uCAAuC,CAAC;AAC3F,OAAO,EAAE,mCAAmC,EAAE,MAAM,wCAAwC,CAAC;AAE7F,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3D,mBAAmB,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,kCAAkC,CAAC,MAAM,CAAC;IAChF,gBAAgB,EAAE,CAAC,CAAC,MAAM,CAAC;QACzB,WAAW,EAAE,CAAC,CAAC,GAAG,EAAE;QACpB,sBAAsB,EAAE,CAAC,CAAC,GAAG,EAAE;KAChC,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,mCAAmC,CAAC,MAAM,CAAC;IAClF;;;;;;;;;;;;OAYG;IACH,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;YACd,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;YAC5B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;SAC9B,CAAC,CAAC,QAAQ,EAAE;QACb,UAAU,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;KAC/B,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { Platform_Application_Config_Schema } from \"./platform-application-config.schemas\";\nimport { Platform_Application_Secrets_Schema } from \"./platform-application-secrets.schemas\";\n\nexport const AppsManagerStaticConfigurationSchema = z.object({\n githubActionMetaUrl: z.url().optional(),\n});\n\nexport type AppsManagerStaticConfig = z.infer<typeof AppsManagerStaticConfigurationSchema>;\n\n/**\n * Apps-manager runtime config: base Platform_Application_Config + platformServices from env.\n * Apps-manager is the only service that stores/manages jwtPublicKeys in MongoDB;\n * all other platform services get them via the fetch endpoint.\n */\nexport const AppsManagerConfig_Schema = Platform_Application_Config_Schema.extend({\n platformServices: z.object({\n appsManager: z.url(),\n crontabsBatchesManager: z.url(),\n }),\n});\n\nexport const AppsManagerSecrets_Schema = Platform_Application_Secrets_Schema.extend({\n /**\n * MongoDB credentials — `connectUrl` OPTIONAL since 2026-08-28, matching every other store in the\n * platform secrets shape (`postgresql`, `redis` and friends are all `.optional()` already).\n *\n * It was a required `z.url()`, which made this schema the last thing forcing a mongod onto a\n * PostgreSQL platform. `wonder-crm` — PostgreSQL on both planes, no mongod declared — got through\n * INIT and then died in NORMAL mode with `ZodError: [\"mongo\",\"connectUrl\"] expected string,\n * received undefined`, hydrating a secret for a store it does not have.\n *\n * Absent means the platform runs no MongoDB. Every reader already optional-chains it\n * (`_platformSecrets?.mongo?.connectUrl` in crontabs is the pattern), because absence has been\n * representable at the READ side for longer than it was at the SCHEMA side.\n */\n mongo: z.object({\n atlas: z.object({\n publicKey: z.string().min(1),\n privateKey: z.string().min(1),\n }).optional(),\n connectUrl: z.url().optional(),\n })\n});\n\nexport type AppsManagerConfig = z.infer<typeof AppsManagerConfig_Schema>;\nexport type AppsManagerSecrets = z.infer<typeof AppsManagerSecrets_Schema>;\n\nexport type AppsManagerAtlasRuntimeConfig = {\n baseUrl: string;\n projectId: string;\n publicKey: string;\n privateKey: string;\n};\n\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-subject-manifest.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-subject-manifest.d.ts","sourceRoot":"","sources":["../../../src/workspace-scope/application-subject-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,KAAK,4BAA4B,EAClC,MAAM,uBAAuB,CAAC;AAK/B,4EAA4E;AAC5E,eAAO,MAAM,sCAAsC,4BACK,CAAC;AAEzD;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC,EAC/C,OAAO,kCAAuE,CAAC;AAEjF;;;GAGG;AACH,wBAAgB,qCAAqC,CACnD,eAAe,EAAE,MAAM,GACtB,MAAM,CAKR;AAED;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,MAAM,GACb,4BAA4B,CAQ9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-subject-manifest.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-subject-manifest.js","sourceRoot":"","sources":["../../../src/workspace-scope/application-subject-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,GAEnC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,4EAA4E;AAC5E,MAAM,CAAC,MAAM,sCAAsC,GACjD,yBAAyB,CAAC,4BAA4B,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oCAAoC,GACH,kCAAkC,CAAC;AAEjF;;;GAGG;AACH,MAAM,UAAU,qCAAqC,CACnD,eAAuB;IAEvB,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,SAAS,CAAC,2CAA2C,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,gBAAgB,CAAC,eAAe,CAAC,CAAC,8BAA8B,CAAC;AAC1E,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mCAAmC,CACjD,MAAc;IAEd,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAY,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,WAAW,CAAC,gDAAgD,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,oCAAoC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["import {\n ApplicationSubjectManifestV1Schema,\n type ApplicationSubjectManifestV1,\n} from '@wildo-ai/saas-models';\nimport { isAbsolute } from 'node:path';\nimport { APP_CONTINUITY_FILE_NAMES } from './workspace-scope.schemas';\nimport { resolveAppLayout } from './workspace-homes.schemas';\n\n/** Portable application-subject manifest in the tracked continuity home. */\nexport const APPLICATION_SUBJECT_MANIFEST_FILE_NAME =\n APP_CONTINUITY_FILE_NAMES.APPLICATION_SUBJECT_MANIFEST;\n\n/**\n * File-boundary schema for the portable application-subject manifest.\n *\n * This is an alias of the one canonical portable schema in `saas-models`, not\n * a second shape. `platform-config-lib` owns file discovery/parsing while\n * `saas-models` remains the named runtime source for the portable contract.\n */\nexport const ApplicationSubjectManifestFileSchema:\n typeof ApplicationSubjectManifestV1Schema = ApplicationSubjectManifestV1Schema;\n\n/**\n * Resolve the repository-maintained subject manifest without probing the\n * filesystem or importing executable application configuration.\n */\nexport function resolveApplicationSubjectManifestPath(\n applicationRoot: string,\n): string {\n if (!isAbsolute(applicationRoot)) {\n throw new TypeError('Application root must be an absolute path');\n }\n return resolveAppLayout(applicationRoot).applicationSubjectManifestPath;\n}\n\n/**\n * Parse untrusted subject-manifest JSON through the strict portable schema.\n *\n * The function intentionally performs no filesystem I/O and does not infer an\n * identity from a path, slug, database id, or executable configuration. Digest\n * recomputation belongs to the backend continuity boundary that owns the\n * canonical JSON/SHA implementation.\n */\nexport function parseApplicationSubjectManifestJson(\n source: string,\n): ApplicationSubjectManifestV1 {\n let parsed: unknown;\n try {\n parsed = JSON.parse(source) as unknown;\n } catch {\n throw new SyntaxError('Application subject manifest is not valid JSON');\n }\n return ApplicationSubjectManifestFileSchema.parse(parsed);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/workspace-scope/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,gCAAgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/workspace-scope/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './workspace-scope.schemas';\nexport * from './workspace-scope-detector';\nexport * from './workspace-homes.schemas';\nexport * from './resolve-homes';\nexport * from './application-subject-manifest';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-homes.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"resolve-homes.d.ts","sourceRoot":"","sources":["../../../src/workspace-scope/resolve-homes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAOtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,cAAc,EAAE,oBAAoB,EACpC,OAAO,GAAE,mBAAwB,GAChC,aAAa,CA0Cf;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,GAAG,GAAE,MAAsB,EAC3B,OAAO,GAAE,mBAAwB,GAChC,aAAa,CAEf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-homes.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"resolve-homes.js","sourceRoot":"","sources":["../../../src/workspace-scope/resolve-homes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;AASnC;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,cAAoC,EACpC,UAA+B,EAAE;IA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AAC,QAAQ,KAAK,IAAI;YACjD,iCAAiC,EAC/B,uBAAuB,KAAK,IAAI,IAAI,CAClC,cAAc,CAAC,aAAa,KAAK,IAAI;gBACrC,OAAO,CAAC,wBAAwB,KAAK,IAAI,CAC1C;YACH,qBAAqB,EAAE,uBAAuB,KAAK,IAAI;YACvD,oBAAoB,EAAE,SAAS,KAAK,IAAI;SACzC;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAc,OAAO,CAAC,GAAG,EAAE,EAC3B,UAA+B,EAAE;IAEjC,OAAO,kBAAkB,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC;AAED,SAAS,qBAAqB,CAAC,IAA+B;IAC5D,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["import { resolve as resolvePath } from 'path';\nimport { resolveWorkspaceScope } from './workspace-scope-detector';\nimport type { WorkspaceScopeResult } from './workspace-scope.schemas';\nimport { WorkspaceScope } from './workspace-scope.schemas';\nimport {\n resolveAppLayout,\n resolveFrameworkLayout,\n resolveMachineLayout,\n} from './workspace-homes.schemas';\nimport type { ResolvedHomes } from './workspace-homes.schemas';\n\nexport interface ResolveHomesOptions {\n userHome?: string;\n frameworkPathHint?: string | null;\n isFrameworkDeveloperHint?: boolean;\n}\n\n/**\n * Compute the trusted home/layout snapshot from an already resolved workspace scope.\n *\n * The optional framework hint lets callers outside the framework repository\n * retain access to framework-owned assets without reintroducing ad hoc path\n * probing throughout the CLI.\n */\nexport function buildResolvedHomes(\n workspaceScope: WorkspaceScopeResult,\n options: ResolveHomesOptions = {},\n): ResolvedHomes {\n const machineLayout = resolveMachineLayout(options.userHome);\n const frameworkRepositoryRoot = workspaceScope.frameworkRoot ?? normalizeOptionalPath(options.frameworkPathHint);\n const frameworkLayout = frameworkRepositoryRoot\n ? resolveFrameworkLayout(frameworkRepositoryRoot)\n : null;\n const appLayout = workspaceScope.saasRoot ? resolveAppLayout(workspaceScope.saasRoot) : null;\n\n return {\n workspaceScope,\n scope: workspaceScope.scope,\n machine: {\n layout: machineLayout,\n hasPreferencesFile: workspaceScope.machinePreferencesPath !== null,\n },\n framework: {\n repositoryRoot: frameworkLayout?.repositoryRoot ?? null,\n markerHome: frameworkLayout?.markerHome ?? null,\n declarationConfigPath: frameworkLayout?.declarationConfigPath ?? null,\n layout: frameworkLayout,\n isInFrameworkWorkspace: workspaceScope.frameworkRoot !== null,\n },\n app: {\n declarationRoot: appLayout?.declarationRoot ?? null,\n runtimeHome: appLayout?.runtimeHome ?? null,\n saasConfigPath: appLayout?.declarationConfigPath ?? workspaceScope.saasConfigPath ?? null,\n layout: appLayout,\n isInAppWorkspace: workspaceScope.saasRoot !== null,\n },\n capabilities: {\n hasMachinePreferences: workspaceScope.machinePreferencesPath !== null,\n hasFrameworkWorkspace: workspaceScope.frameworkRoot !== null,\n hasAppWorkspace: workspaceScope.saasRoot !== null,\n hasFrameworkDeveloperCapabilities:\n frameworkRepositoryRoot !== null && (\n workspaceScope.frameworkRoot !== null ||\n options.isFrameworkDeveloperHint === true\n ),\n canUseFrameworkAssets: frameworkRepositoryRoot !== null,\n canUseAppRuntimeHome: appLayout !== null,\n },\n };\n}\n\n/**\n * Resolve the trusted home/layout snapshot directly from a working directory.\n */\nexport function resolveHomes(\n cwd: string = process.cwd(),\n options: ResolveHomesOptions = {},\n): ResolvedHomes {\n return buildResolvedHomes(resolveWorkspaceScope(cwd), options);\n}\n\nfunction normalizeOptionalPath(path: string | null | undefined): string | null {\n if (!path) {\n return null;\n }\n\n return resolvePath(path);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-homes.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"workspace-homes.schemas.d.ts","sourceRoot":"","sources":["../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AAC,EAAE,MAAM,GAAG,kBAAkB,CAa1E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,oBAAoB,CAsElF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CA2DhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-homes.schemas.js","sourceRoot":"","sources":["../../../../src/workspace-scope/workspace-homes.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,2BAA2B,EAC3B,oBAAoB,GAGrB,MAAM,2BAA2B,CAAC;AA8NnC;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAiB;IACpD,MAAM,IAAI,GAAG,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAChD,OAAO;QACL,IAAI;QACJ,eAAe,EAAE,IAAI,CAAC,IAAI,EAAE,0BAA0B,CAAC,WAAW,CAAC;QACnE,cAAc;QACd,qCAAqC,EAAE,IAAI,CACzC,cAAc,EACd,uBAAuB,CACxB;QACD,qBAAqB,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC;KACvD,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,aAAqB;IAC1D,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,oBAAoB,CAAC,cAAc,CAAC,CAAC;IAC5E,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACjD,MAAM,YAAY,GAAG,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IACrD,MAAM,qBAAqB,GAAG,IAAI,CAAC,aAAa,EAAE,oBAAoB,C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AC;QAClD,aAAa,EAAE,IAAI,CAAC,WAAW,EAAE,wBAAwB,CAAC,UAAU,CAAC;QACrE,yBAAyB;QACzB,uBAAuB,EAAE,IAAI,CAAC,yBAAyB,EAAE,wBAAwB,CAAC,YAAY,CAAC;QAC/F,mBAAmB,EAAE,IAAI,CAAC,WAAW,EAAE,wBAAwB,CAAC,MAAM,CAAC;QACvE,oBAAoB,EAAE,IAAI,CAAC,WAAW,EAAE,wBAAwB,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 { join } from 'path';\nimport {\n AUTHORED_CONFIG_FILE_NAMES,\n APP_CONTINUITY_FILE_NAMES,\n APP_RUNTIME_SUBDIR_NAMES,\n resolveMachineWildoHomePath,\n WORKSPACE_HOME_NAMES,\n WorkspaceScope,\n type WorkspaceScopeResult,\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): where the framework AUTHORS the provider modules it distributes through the\n * module registry, one directory per provider (`providers-registry/<ref>/`, holding `wildo.module.json` and one\n * package per facet). An application installs one with `wildo registry add wildo/providers/<ref>` (#2015 reads this\n * directory when the CLI runs inside a checkout) and owns the copy from then on.\n *\n * It replaced `providersHome` (`providers/`, the generated `@wildo-ai/providers` catalogue) at the cut-over, #2019:\n * that catalogue is archived under `_code_archive/providers/` and nothing reads it any more.\n *\n * It is a field here because this interface is what makes a home VISIBLE to tooling: framework-knowledge generation\n * and the anchor audit take their scan roots from it, and a home absent from those roots is not excluded, it is\n * unseen. An unseen home reports clean (`negative-results-require-a-positive-probe.md`): an anchor in a registry\n * provider would never reach a skill. Publish discovery deliberately does NOT read it: a registry module is\n * published to the module registry, never to npm.\n */\n providersRegistryHome: 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 `$WILDO_HOME` when set, else the current user's\n * `~/.wildo` — the one rule `resolveMachineWildoHomePath` owns and both launchers apply. An explicit\n * `userHome` answers about that home and ignores the environment.\n */\nexport function resolveMachineLayout(userHome?: string): MachineLayoutPaths {\n const home = resolveMachineWildoHomePath(userHome);\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 providersRegistryHome = join(frameworkRoot, 'providers-registry');\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 providersRegistryHome,\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":[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AAkB,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 { join } from 'path';\nimport {\n AUTHORED_CONFIG_FILE_NAMES,\n APP_CONTINUITY_FILE_NAMES,\n APP_RUNTIME_SUBDIR_NAMES,\n resolveMachineWildoHomePath,\n WORKSPACE_HOME_NAMES,\n WorkspaceScope,\n type WorkspaceScopeResult,\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): where the framework AUTHORS the provider modules it distributes through the\n * module registry, one directory per provider (`providers-registry/<ref>/`, holding `wildo.module.json` and one\n * package per facet). An application installs one with `wildo registry add wildo/providers/<ref>` (#2015 reads this\n * directory when the CLI runs inside a checkout) and owns the copy from then on.\n *\n * It replaced `providersHome` (`providers/`, the generated `@wildo-ai/providers` catalogue) at the cut-over, #2019:\n * that catalogue is archived under `_code_archive/providers/` and nothing reads it any more.\n *\n * It is a field here because this interface is what makes a home VISIBLE to tooling: framework-knowledge generation\n * and the anchor audit take their scan roots from it, and a home absent from those roots is not excluded, it is\n * unseen. An unseen home reports clean (`negative-results-require-a-positive-probe.md`): an anchor in a registry\n * provider would never reach a skill. Publish discovery deliberately does NOT read it: a registry module is\n * published to the module registry, never to npm.\n */\n providersRegistryHome: 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 `$WILDO_HOME` when set, else the current user's\n * `~/.wildo` — the one rule `resolveMachineWildoHomePath` owns and both launchers apply. An explicit\n * `userHome` answers about that home and ignores the environment.\n */\nexport function resolveMachineLayout(userHome?: string): MachineLayoutPaths {\n const home = resolveMachineWildoHomePath(userHome);\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 providersRegistryHome = join(frameworkRoot, 'providers-registry');\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 providersRegistryHome,\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-scope-detector.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"workspace-scope-detector.d.ts","sourceRoot":"","sources":["../../../src/workspace-scope/workspace-scope-detector.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAItE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,GAAE,MAAsB,GAAG,oBAAoB,CA4CvF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-scope-detector.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"workspace-scope-detector.js","sourceRoot":"","sources":["../../../src/workspace-scope/workspace-scope-detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,cAAc,EACd,6BAA6B,GAC9B,MAAM,2BAA2B,CAAC;AAGnC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAc,OAAO,CAAC,GAAG,EAAE;IAC/D,MAAM,MAAM,GAAyB;QACnC,KAAK,EAAE,cAAc,CAAC,aAAa;QACnC,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE,IAAI;QACd,aAAa,EAAE,IAAI;QACnB,sBAAsB,EAAE,IAAI;KAC7B,CAAC;IAEF,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,kBAAkB,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5C,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;YAC3B,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,0BAA0B,CAAC,IAAI,CAAC,CAAC;YACjE,IAAI,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;gBAC9B,MAAM,CAAC,cAAc,GAAG,aAAa,CAAC;gBACtC,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC;YACxB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;YAC1B,MAAM,wBAAwB,GAAG,IAAI,CAAC,GAAG,EAAE,+BAA+B,CAAC,CAAC;YAC5E,IAAI,UAAU,CAAC,wBAAwB,CAAC,EAAE,CAAC;gBACzC,MAAM,CAAC,aAAa,GAAG,GAAG,CAAC;YAC7B,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;YAClD,MAAM;QACR,CAAC;QAED,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAClC,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM;QAC1B,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IAED,MAAM,sBAAsB,GAAG,6BAA6B,EAAE,CAAC;IAC/D,IAAI,UAAU,CAAC,sBAAsB,CAAC,EAAE,CAAC;QACvC,MAAM,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;IACzD,CAAC;IAED,MAAM,CAAC,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAEpC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CAAC,MAA4B;IAChD,IAAI,MAAM,CAAC,cAAc;QAAE,OAAO,cAAc,CAAC,QAAQ,CAAC;IAC1D,IAAI,MAAM,CAAC,aAAa;QAAE,OAAO,cAAc,CAAC,SAAS,CAAC;IAC1D,IAAI,MAAM,CAAC,sBAAsB;QAAE,OAAO,cAAc,CAAC,MAAM,CAAC;IAChE,OAAO,cAAc,CAAC,aAAa,CAAC;AACtC,CAAC","sourcesContent":["import { existsSync } from 'fs';\nimport { join, resolve } from 'path';\nimport {\n AUTHORED_CONFIG_FILE_NAMES,\n FRAMEWORK_WORKSPACE_MARKER_FILE,\n WorkspaceScope,\n resolveMachinePreferencesPath,\n} from './workspace-scope.schemas';\nimport type { WorkspaceScopeResult } from './workspace-scope.schemas';\n\nconst MAX_WALK_UP_LEVELS = 20;\n\n/**\n * Resolves the workspace scope from a given working directory.\n *\n * Performs a single upward traversal from `cwd`, checking for authored\n * declaration anchors at each directory level:\n *\n * - `wildo.saas.config.ts` — SaaS app workspace marker.\n * - `wildo-framework.info.json` — framework workspace marker. See the\n * `FRAMEWORK_WORKSPACE_MARKER_FILE` JSDoc for why the marker file is used\n * instead of the `.wildo-framework/` home directory.\n *\n * After the walk-up, checks for `~/.wildo/preferences.json` to determine\n * whether machine preferences exist.\n *\n * @param cwd - Starting directory (defaults to `process.cwd()`)\n * @returns Fully resolved scope result with all discovered paths\n */\nexport function resolveWorkspaceScope(cwd: string = process.cwd()): WorkspaceScopeResult {\n const result: WorkspaceScopeResult = {\n scope: WorkspaceScope.UNINITIALIZED,\n saasConfigPath: null,\n saasRoot: null,\n frameworkRoot: null,\n machinePreferencesPath: null,\n };\n\n let dir = resolve(cwd);\n\n for (let i = 0; i < MAX_WALK_UP_LEVELS; i++) {\n if (!result.saasConfigPath) {\n const saasCandidate = join(dir, AUTHORED_CONFIG_FILE_NAMES.SAAS);\n if (existsSync(saasCandidate)) {\n result.saasConfigPath = saasCandidate;\n result.saasRoot = dir;\n }\n }\n\n if (!result.frameworkRoot) {\n const frameworkMarkerCandidate = join(dir, FRAMEWORK_WORKSPACE_MARKER_FILE);\n if (existsSync(frameworkMarkerCandidate)) {\n result.frameworkRoot = dir;\n }\n }\n\n if (result.saasConfigPath && result.frameworkRoot) {\n break;\n }\n\n const parent = resolve(dir, '..');\n if (parent === dir) break;\n dir = parent;\n }\n\n const machinePreferencesPath = resolveMachinePreferencesPath();\n if (existsSync(machinePreferencesPath)) {\n result.machinePreferencesPath = machinePreferencesPath;\n }\n\n result.scope = computeScope(result);\n\n return result;\n}\n\n/**\n * Determines the most specific scope from the resolved anchors.\n * Order: SAAS_APP > FRAMEWORK > GLOBAL > UNINITIALIZED\n */\nfunction computeScope(result: WorkspaceScopeResult): WorkspaceScope {\n if (result.saasConfigPath) return WorkspaceScope.SAAS_APP;\n if (result.frameworkRoot) return WorkspaceScope.FRAMEWORK;\n if (result.machinePreferencesPath) return WorkspaceScope.GLOBAL;\n return WorkspaceScope.UNINITIALIZED;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-scope.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"workspace-scope.schemas.d.ts","sourceRoot":"","sources":["../../../src/workspace-scope/workspace-scope.schemas.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH;;;;;GAKG;AACH,oBAAY,cAAc;IACxB,gFAAgF;IAChF,aAAa,IAAI;IACjB,8EAA8E;IAC9E,MAAM,IAAI;IACV,sFAAsF;IACtF,SAAS,IAAI;IACb,gFAAgF;IAChF,QAAQ,IAAI;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,KAAK,EAAE,cAAc,CAAC;IAEtB,wDAAwD;IACxD,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,kDAAkD;IAClD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;;;;;;;OAQG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B,kEAAkE;IAClE,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;CAK7B,CAAC;AAEX;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,+BAA+B,8BAA8B,CAAC;AAE3E;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB;;;CAGvB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;CAErB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;IAanC;;;;;;;;;;;;;;;OAeG;;;;;CAKK,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB;;;CAG5B,CAAC;AAEX;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB;;CAEzB,CAAC;AAEX;;;;;;;;GAQG;AACH,oBAAY,mBAAmB;IAC7B,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,mBAAmB,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAMrE;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvE;AAwCD;;;;;GAKG;AACH,wBAAgB,8BAA8B,IAAI,IAAI,CAErD;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,8BAA8B,GAAG,MAAM,CAAC;AAC/F,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;AA+BxE;;;;GAIG;AACH,wBAAgB,oCAAoC,CAAC,OAAO,EAAE,8BAA8B,GAAG,MAAM,CAqBpG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-scope.schemas.js","sourceRoot":"","sources":["../../../../src/workspace-scope/workspace-scope.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;;;;;;;;;;GAaG;AAEH;;;;;GAKG;AACH,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB,gFAAgF;IAChF,qEAAiB,CAAA;IACjB,8EAA8E;IAC9E,uDAAU,CAAA;IACV,sFAAsF;IACtF,6DAAa,CAAA;IACb,gFAAgF;IAChF,2DAAY,CAAA;AACd,CAAC,EATW,cAAc,KAAd,cAAc,QASzB;AA+BD;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,IAAI,EAAE,sBAAsB;IAC5B,SAAS,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WAAW,CACZ,CAAC;QACJ,KAAK,mBAAmB,CAAC,IAAI;YAC3B,OAAO,IAAI,CACT,OAAO,CAAC,SAAS,EACjB,oBAAoB,CAAC,gBAAgB,EACrC,wBAAwB,CAAC,IAAI,EAC7B,wBAAwB,CAAC,aAAa,EACtC,MAAM,CACP,CAAC;QACJ,KAAK,mBAAmB,CAAC,IAAI;YAC3B,OAAO,IAAI,CAAC,MAAM,EAAE,EAAE,kBAAkB,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC","sourcesContent":["import { homedir, tmpdir } from 'os';\nimport { dirname, join, relative, resolve } from 'path';\nimport { resolveWorkspaceScope } from './workspace-scope-detector';\n\n/**\n * Workspace scope detection types.\n *\n * Provides a hierarchical scope model for determining where a tool\n * (CLI, companion, IDE extension) is being invoked from within the\n * Wildo project structure.\n *\n * Scope hierarchy (most specific wins, each implies parent scopes):\n * UNINITIALIZED → GLOBAL → FRAMEWORK → SAAS_APP\n *\n * Detection is based on authored declaration anchors and the framework\n * workspace marker file, not on generated runtime state such as\n * `.wildo-saas/` or ownership directories such as `.wildo-framework/`.\n */\n\n/**\n * Hierarchical workspace scope.\n *\n * Numeric values are ordered so that higher = more specific.\n * This enables `>=` comparisons for \"at least this scope\" checks.\n */\nexport enum WorkspaceScope {\n /** No machine preferences file found and CWD is outside any app or framework */\n UNINITIALIZED = 0,\n /** Machine preferences file exists but CWD is outside any app or framework */\n GLOBAL = 1,\n /** CWD is inside the Wildo framework workspace (`wildo-framework.info.json` found) */\n FRAMEWORK = 2,\n /** CWD is inside a SaaS application directory (`wildo.saas.config.ts` found) */\n SAAS_APP = 3,\n}\n\n/**\n * Result of workspace scope detection.\n *\n * All resolved paths are populated regardless of the final scope.\n */\nexport interface WorkspaceScopeResult {\n /** Most specific scope detected from CWD */\n scope: WorkspaceScope;\n\n /** Absolute path to `wildo.saas.config.ts`, if found */\n saasConfigPath: string | null;\n /** Directory containing `wildo.saas.config.ts` */\n saasRoot: string | null;\n\n /**\n * Framework workspace root: the directory containing the\n * `wildo-framework.info.json` marker file. The `.wildo-framework/` home\n * directory lives as a sibling inside the same workspace root and stores\n * framework-owned runtime artifacts (dist, secrets, publish), but it is\n * the marker file — not the directory — that authoritatively identifies a\n * framework workspace. Walking up only on the home directory would accept\n * any repo that happens to contain a folder called `.wildo-framework/`.\n */\n frameworkRoot: string | null;\n\n /** Absolute path to the machine preferences file, if it exists */\n machinePreferencesPath: string | null;\n}\n\n/**\n * Authored declaration files and machine/app preference files.\n */\nexport const AUTHORED_CONFIG_FILE_NAMES = {\n SAAS: 'wildo.saas.config.ts',\n FRAMEWORK: 'wildo.framework.config.ts',\n PREFERENCES: 'preferences.json',\n APP_LOCAL_PREFERENCES: 'wildo.preferences.local.json',\n} as const;\n\n/**\n * Marker file committed at the root of a Wildo framework workspace.\n *\n * Authoritative signal that answers \"is this directory a Wildo framework\n * workspace?\". The detector and the `platform-config-lib` jiti loader both\n * walk up the directory tree for this file — any other marker (such as the\n * `.wildo-framework/` home directory or a generic `pnpm-workspace.yaml`) is\n * intentionally NOT accepted because:\n *\n * - `.wildo-framework/` is an owned-output directory that could in principle\n * be created by any tool; directory presence alone is a weaker signal than\n * a committed marker file.\n * - `pnpm-workspace.yaml` matches any pnpm monorepo, so a framework package\n * installed into a foreign monorepo would silently mis-root its aliases.\n *\n * Shell scripts that need the same contract (e.g. platform back-office\n * `dev-supervised.sh` wrappers) hardcode this string because they cannot\n * import TypeScript; keep those literal occurrences in sync with this constant.\n */\nexport const FRAMEWORK_WORKSPACE_MARKER_FILE = 'wildo-framework.info.json';\n\n/**\n * Dot-home directory names. These homes store framework-owned runtime\n * artifacts (dist/, secrets, publish outputs), app-owned runtime state\n * (.wildo-saas/), and machine-local preferences.\n *\n * Note: `.wildo-framework/` is the framework workspace's owned home\n * directory. It is NOT the framework workspace marker — that role belongs\n * to `FRAMEWORK_WORKSPACE_MARKER_FILE` (`wildo-framework.info.json`).\n */\nexport const WORKSPACE_HOME_NAMES = {\n FRAMEWORK_HOME: '.wildo-framework',\n APP_RUNTIME_HOME: '.wildo-saas',\n} as const;\n\nexport const MACHINE_HOME_NAMES = {\n MACHINE_HOME: '.wildo',\n} as const;\n\n/**\n * Known runtime-owned directories inside the app runtime home.\n */\nexport const APP_RUNTIME_SUBDIR_NAMES = {\n CONTINUITY: 'continuity',\n DIST: 'dist',\n APPLICATION_SPECIFICATIONS: 'application-specifications',\n PROJECTIONS: 'projections',\n CONFIG_LOADER: 'config-loader',\n STATE: 'state',\n TEMPORARY: 'tmp',\n INTEGRATION_TESTS: 'integration-tests',\n LOGS: 'logs',\n LOCAL_DATA: 'local_data',\n INFRASTRUCTURE: 'infrastructure',\n ENVIRONMENTS: 'environments',\n /**\n * Env-scoped deployment-artifact staging area\n * (`.wildo-saas/deploy/<env>/{k8s,compose}/`).\n *\n * Distinct from {@link APP_RUNTIME_SUBDIR_NAMES.INFRASTRUCTURE}, which holds\n * the LOCAL runtime render a developer machine's stack actually loads. This\n * zone holds the render a DEPLOYMENT consumes — K8s `Secret`/`ConfigMap`\n * manifests and per-service compose `.env` files, produced by\n * `wildo config sync --domain config` and applied by the generated deploy\n * workflows.\n *\n * Every file under it is secret-bearing by construction, so the generator\n * writes an ignore-everything `.gitignore` into the zone root on each render\n * rather than relying on an application's hand-authored root `.gitignore`\n * (which the framework does not generate).\n */\n DEPLOY: 'deploy',\n FRAMEWORK_SCRIPTS: 'dev-framework-scripts',\n RUNTIME_SIGNALS: 'runtime-signals',\n COMPANION: 'wildo-dev-companion',\n} as const;\n\n/**\n * Portable application-continuity inputs maintained in the tracked\n * `.wildo-saas/continuity/` home.\n *\n * These are repository truth, unlike the generated `dist/`, mutable `state/`\n * and disposable `tmp/` zones that share the `.wildo-saas` ownership root.\n */\nexport const APP_CONTINUITY_FILE_NAMES = {\n APPLICATION_SUBJECT_MANIFEST: 'application-subject.json',\n BOOTSTRAP_PROFILE: 'bootstrap-profile.json',\n} as const;\n\n/**\n * Narrow aggregate retained for the handful of CLI commands that still\n * hand-build `<appRoot>/wildo.saas.config.ts` joins instead of reading\n * `resolvedHomes.app.declarationConfigPath`. The `FRAMEWORK_DIR`,\n * `SAAS_DIR`, `GLOBAL_DIR`, and `PREFERENCES_FILE` members that used to\n * live here were deleted in the Phase 6 closeout: framework home lookups\n * now go through `FRAMEWORK_WORKSPACE_MARKER_FILE` + `resolveFrameworkLayout`,\n * app runtime home lookups through `resolveAppLayout`, and machine\n * preferences through `resolveMachinePreferencesPath`.\n */\nexport const WORKSPACE_CONFIG_NAMES = {\n SAAS: AUTHORED_CONFIG_FILE_NAMES.SAAS,\n} as const;\n\n/**\n * Runtime-owned zones for generated config-evaluation artifacts.\n *\n * These are semantic owners, not source locations. For example, a compatibility\n * config evaluated outside the app tree can still belong to the scoped\n * workspace zone\n * and must emit artifacts under the scoped runtime home (`.wildo-saas/dist/...`),\n * not beside the authored config file itself.\n */\nexport enum ConfigArtifactsZone {\n FRAMEWORK = 'framework',\n SAAS = 'saas',\n TEMP = 'temp',\n}\n\nexport interface ConfigArtifactsLocationOptions {\n zone: ConfigArtifactsZone;\n ownerRoot: string;\n}\n\n/**\n * Absolute path to the machine Wildo home directory. Per-user, per-machine state lives here — NOT\n * shared across machines (\"global\" would be misleading).\n *\n * `$WILDO_HOME` wins when set, then `~/.wildo`. That is the rule both installers and both launchers\n * apply (`WILDO_HOME=\"${WILDO_HOME:-$HOME/.wildo}\"`), and the installer itself suggests\n * `WILDO_HOME=/path/you/own` when `~/.wildo` is not writable. Until 2026-09-24 this function ignored\n * the variable, so the CLI read and wrote a different `preferences.json` from the one its launcher\n * read — invisible while nothing the CLI wrote there changed which CLI runs, and fatal for\n * `wildo update`, whose whole effect is rewriting `cliPath` for the launcher.\n *\n * @param userHome - when given, the home is `<userHome>/.wildo` and `$WILDO_HOME` is not consulted:\n * an explicit home is a question about THAT home, not about this process's environment.\n */\nexport function resolveMachineWildoHomePath(userHome?: string): string {\n if (userHome === undefined) {\n const override = process.env.WILDO_HOME?.trim();\n if (override) return resolve(override);\n }\n return join(userHome ?? homedir(), MACHINE_HOME_NAMES.MACHINE_HOME);\n}\n\n/**\n * Absolute path to the machine preferences file (`$WILDO_HOME/preferences.json`, else\n * `~/.wildo/preferences.json`; see {@link resolveMachineWildoHomePath}). Stores per-user, per-machine\n * preferences such as `cliPath`, `frameworkPath` and `isFrameworkDeveloper`.\n */\nexport function resolveMachinePreferencesPath(userHome?: string): string {\n return join(resolveMachineWildoHomePath(userHome), AUTHORED_CONFIG_FILE_NAMES.PREFERENCES);\n}\n\nfunction isPathInside(root: string, target: string): boolean {\n const rel = relative(resolve(root), resolve(target));\n return rel === '' || (!rel.startsWith('..') && rel !== '..');\n}\n\n/**\n * Cache for the string-overload of `resolveConfigArtifactsBaseDir`.\n *\n * The overload needs to know which zone owns an arbitrary config file path.\n * That information only depends on the containing directory, so we memoize by\n * resolved directory to avoid running the full workspace-scope walk on every\n * `loadConfig` call without an explicit artifact location.\n *\n * Cache lifetime contract:\n *\n * This map is process-scoped and never evicted automatically — workspace\n * layout is treated as static for the duration of a single CLI / companion\n * process, and cache keys are absolute directory paths, so the working set\n * stays bounded by the number of distinct config-file parents touched per\n * invocation (typically a handful). Long-running hosts (dev watchers, test\n * runners, embedded editor integrations) that may observe workspace moves or\n * need to re-detect scope must call\n * {@link clearConfigArtifactsScopeCache} to force the next resolution to\n * re-walk from disk.\n */\nconst resolvedArtifactScopeCacheByDirectory = new Map<string, WorkspaceScopeResult>();\n\nfunction resolveArtifactScopeForDirectory(directoryPath: string): WorkspaceScopeResult {\n const cached = resolvedArtifactScopeCacheByDirectory.get(directoryPath);\n if (cached) {\n return cached;\n }\n\n const scope = resolveWorkspaceScope(directoryPath);\n resolvedArtifactScopeCacheByDirectory.set(directoryPath, scope);\n return scope;\n}\n\n/**\n * Clear the memoized scope lookups used by the string overload of\n * {@link resolveConfigArtifactsBaseDir}. Intended for long-running hosts and\n * tests that simulate workspace moves; standard short-lived CLI / companion\n * processes never need to call this.\n */\nexport function clearConfigArtifactsScopeCache(): void {\n resolvedArtifactScopeCacheByDirectory.clear();\n}\n\nexport function resolveConfigArtifactsBaseDir(options: ConfigArtifactsLocationOptions): string;\nexport function resolveConfigArtifactsBaseDir(filePath: string): string;\nexport function resolveConfigArtifactsBaseDir(\n input: string | ConfigArtifactsLocationOptions,\n): string {\n if (typeof input !== 'string') {\n return resolveConfigArtifactsBaseDirForZone(input);\n }\n\n const absolutePath = resolve(input);\n const scope = resolveArtifactScopeForDirectory(dirname(absolutePath));\n\n if (scope.saasRoot && isPathInside(scope.saasRoot, absolutePath)) {\n return resolveConfigArtifactsBaseDirForZone({\n zone: ConfigArtifactsZone.SAAS,\n ownerRoot: scope.saasRoot,\n });\n }\n\n if (scope.frameworkRoot && isPathInside(scope.frameworkRoot, absolutePath)) {\n return resolveConfigArtifactsBaseDirForZone({\n zone: ConfigArtifactsZone.FRAMEWORK,\n ownerRoot: scope.frameworkRoot,\n });\n }\n\n return resolveConfigArtifactsBaseDirForZone({\n zone: ConfigArtifactsZone.TEMP,\n ownerRoot: absolutePath,\n });\n}\n\n/**\n * Resolve the canonical runtime-owned base directory for config-loader\n * artifacts. This keeps Jiti/SWC output out of authored declaration trees and\n * anchors it under the matching runtime zone.\n */\nexport function resolveConfigArtifactsBaseDirForZone(options: ConfigArtifactsLocationOptions): string {\n switch (options.zone) {\n case ConfigArtifactsZone.FRAMEWORK:\n return join(\n options.ownerRoot,\n WORKSPACE_HOME_NAMES.FRAMEWORK_HOME,\n APP_RUNTIME_SUBDIR_NAMES.DIST,\n APP_RUNTIME_SUBDIR_NAMES.CONFIG_LOADER,\n 'framework',\n );\n case ConfigArtifactsZone.SAAS:\n return join(\n options.ownerRoot,\n WORKSPACE_HOME_NAMES.APP_RUNTIME_HOME,\n APP_RUNTIME_SUBDIR_NAMES.DIST,\n APP_RUNTIME_SUBDIR_NAMES.CONFIG_LOADER,\n 'saas',\n );\n case ConfigArtifactsZone.TEMP:\n return join(tmpdir(), 'wildo-jiti-cache');\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"workspace-scope.schemas.js","sourceRoot":"","sources":["../../../src/workspace-scope/workspace-scope.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;;;;;;;;;;GAaG;AAEH;;;;;GAKG;AACH,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB,gFAAgF;IAChF,qEAAiB,CAAA;IACjB,8EAA8E;IAC9E,uDAAU,CAAA;IACV,sFAAsF;IACtF,6DAAa,CAAA;IACb,gFAAgF;IAChF,2DAAY,CAAA;AACd,CAAC,EATW,cAAc,KAAd,cAAc,QASzB;AA+BD;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,IAAI,EAAE,sBAAsB;IAC5B,SAAS,EAAE,2BAA2B;IACtC,WAAW,EAAE,kBAAkB;IAC/B,qBAAqB,EAAE,8BAA8B;CAC7C,CAAC;AAEX;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,2BAA2B,CAAC;AAE3E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,cAAc,EAAE,kBAAkB;IAClC,gBAAgB,EAAE,aAAa;CACvB,CAAC;AAEX,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,YAAY,EAAE,QAAQ;CACd,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,UAAU,EAAE,YAAY;IACxB,IAAI,EAAE,MAAM;IACZ,0BAA0B,EAAE,4BAA4B;IACxD,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,eAAe;IAC9B,KAAK,EAAE,OAAO;IACd,SAAS,EA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CAAC,QAAQ;SAC1B,CAAC,CAAC;IACL,CAAC;IAED,IAAI,KAAK,CAAC,aAAa,IAAI,YAAY,CAAC,KAAK,CAAC,aAAa,EAAE,YAAY,CAAC,EAAE,CAAC;QAC3E,OAAO,oCAAoC,CAAC;YAC1C,IAAI,EAAE,mBAAmB,CAAC,SAAS;YACnC,SAAS,EAAE,KAAK,CAAC,aAAa;SAC/B,CAAC,CAAC;IACL,CAAC;IAED,OAAO,oCAAoC,CAAC;QAC1C,IAAI,EAAE,mBAAmB,CAAC,IAAI;QAC9B,SAAS,EAAE,YAAY;KACxB,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oCAAoC,CAAC,OAAuC;IAC1F,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,mBAAmB,CAAC,SAAS;YAChC,OAAO,IAAI,CACT,OAAO,CAAC,SAAS,EACjB,oBAAoB,CAAC,cAAc,EACnC,wBAAwB,CAAC,IAAI,EAC7B,wBAAwB,CAAC,aAAa,EACtC,WAAW,CACZ,CAAC;QACJ,KAAK,mBAAmB,CAAC,IAAI;YAC3B,OAAO,IAAI,CACT,OAAO,CAAC,SAAS,EACjB,oBAAoB,CAAC,gBAAgB,EACrC,wBAAwB,CAAC,IAAI,EAC7B,wBAAwB,CAAC,aAAa,EACtC,MAAM,CACP,CAAC;QACJ,KAAK,mBAAmB,CAAC,IAAI;YAC3B,OAAO,IAAI,CAAC,MAAM,EAAE,EAAE,kBAAkB,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC","sourcesContent":["import { homedir, tmpdir } from 'os';\nimport { dirname, join, relative, resolve } from 'path';\nimport { resolveWorkspaceScope } from './workspace-scope-detector';\n\n/**\n * Workspace scope detection types.\n *\n * Provides a hierarchical scope model for determining where a tool\n * (CLI, companion, IDE extension) is being invoked from within the\n * Wildo project structure.\n *\n * Scope hierarchy (most specific wins, each implies parent scopes):\n * UNINITIALIZED → GLOBAL → FRAMEWORK → SAAS_APP\n *\n * Detection is based on authored declaration anchors and the framework\n * workspace marker file, not on generated runtime state such as\n * `.wildo-saas/` or ownership directories such as `.wildo-framework/`.\n */\n\n/**\n * Hierarchical workspace scope.\n *\n * Numeric values are ordered so that higher = more specific.\n * This enables `>=` comparisons for \"at least this scope\" checks.\n */\nexport enum WorkspaceScope {\n /** No machine preferences file found and CWD is outside any app or framework */\n UNINITIALIZED = 0,\n /** Machine preferences file exists but CWD is outside any app or framework */\n GLOBAL = 1,\n /** CWD is inside the Wildo framework workspace (`wildo-framework.info.json` found) */\n FRAMEWORK = 2,\n /** CWD is inside a SaaS application directory (`wildo.saas.config.ts` found) */\n SAAS_APP = 3,\n}\n\n/**\n * Result of workspace scope detection.\n *\n * All resolved paths are populated regardless of the final scope.\n */\nexport interface WorkspaceScopeResult {\n /** Most specific scope detected from CWD */\n scope: WorkspaceScope;\n\n /** Absolute path to `wildo.saas.config.ts`, if found */\n saasConfigPath: string | null;\n /** Directory containing `wildo.saas.config.ts` */\n saasRoot: string | null;\n\n /**\n * Framework workspace root: the directory containing the\n * `wildo-framework.info.json` marker file. The `.wildo-framework/` home\n * directory lives as a sibling inside the same workspace root and stores\n * framework-owned runtime artifacts (dist, secrets, publish), but it is\n * the marker file — not the directory — that authoritatively identifies a\n * framework workspace. Walking up only on the home directory would accept\n * any repo that happens to contain a folder called `.wildo-framework/`.\n */\n frameworkRoot: string | null;\n\n /** Absolute path to the machine preferences file, if it exists */\n machinePreferencesPath: string | null;\n}\n\n/**\n * Authored declaration files and machine/app preference files.\n */\nexport const AUTHORED_CONFIG_FILE_NAMES = {\n SAAS: 'wildo.saas.config.ts',\n FRAMEWORK: 'wildo.framework.config.ts',\n PREFERENCES: 'preferences.json',\n APP_LOCAL_PREFERENCES: 'wildo.preferences.local.json',\n} as const;\n\n/**\n * Marker file committed at the root of a Wildo framework workspace.\n *\n * Authoritative signal that answers \"is this directory a Wildo framework\n * workspace?\". The detector and the `platform-config-lib` jiti loader both\n * walk up the directory tree for this file — any other marker (such as the\n * `.wildo-framework/` home directory or a generic `pnpm-workspace.yaml`) is\n * intentionally NOT accepted because:\n *\n * - `.wildo-framework/` is an owned-output directory that could in principle\n * be created by any tool; directory presence alone is a weaker signal than\n * a committed marker file.\n * - `pnpm-workspace.yaml` matches any pnpm monorepo, so a framework package\n * installed into a foreign monorepo would silently mis-root its aliases.\n *\n * Shell scripts that need the same contract (e.g. platform back-office\n * `dev-supervised.sh` wrappers) hardcode this string because they cannot\n * import TypeScript; keep those literal occurrences in sync with this constant.\n */\nexport const FRAMEWORK_WORKSPACE_MARKER_FILE = 'wildo-framework.info.json';\n\n/**\n * Dot-home directory names. These homes store framework-owned runtime\n * artifacts (dist/, secrets, publish outputs), app-owned runtime state\n * (.wildo-saas/), and machine-local preferences.\n *\n * Note: `.wildo-framework/` is the framework workspace's owned home\n * directory. It is NOT the framework workspace marker — that role belongs\n * to `FRAMEWORK_WORKSPACE_MARKER_FILE` (`wildo-framework.info.json`).\n */\nexport const WORKSPACE_HOME_NAMES = {\n FRAMEWORK_HOME: '.wildo-framework',\n APP_RUNTIME_HOME: '.wildo-saas',\n} as const;\n\nexport const MACHINE_HOME_NAMES = {\n MACHINE_HOME: '.wildo',\n} as const;\n\n/**\n * Known runtime-owned directories inside the app runtime home.\n */\nexport const APP_RUNTIME_SUBDIR_NAMES = {\n CONTINUITY: 'continuity',\n DIST: 'dist',\n APPLICATION_SPECIFICATIONS: 'application-specifications',\n PROJECTIONS: 'projections',\n CONFIG_LOADER: 'config-loader',\n STATE: 'state',\n TEMPORARY: 'tmp',\n INTEGRATION_TESTS: 'integration-tests',\n LOGS: 'logs',\n LOCAL_DATA: 'local_data',\n INFRASTRUCTURE: 'infrastructure',\n ENVIRONMENTS: 'environments',\n /**\n * Env-scoped deployment-artifact staging area\n * (`.wildo-saas/deploy/<env>/{k8s,compose}/`).\n *\n * Distinct from {@link APP_RUNTIME_SUBDIR_NAMES.INFRASTRUCTURE}, which holds\n * the LOCAL runtime render a developer machine's stack actually loads. This\n * zone holds the render a DEPLOYMENT consumes — K8s `Secret`/`ConfigMap`\n * manifests and per-service compose `.env` files, produced by\n * `wildo config sync --domain config` and applied by the generated deploy\n * workflows.\n *\n * Every file under it is secret-bearing by construction, so the generator\n * writes an ignore-everything `.gitignore` into the zone root on each render\n * rather than relying on an application's hand-authored root `.gitignore`\n * (which the framework does not generate).\n */\n DEPLOY: 'deploy',\n FRAMEWORK_SCRIPTS: 'dev-framework-scripts',\n RUNTIME_SIGNALS: 'runtime-signals',\n COMPANION: 'wildo-dev-companion',\n} as const;\n\n/**\n * Portable application-continuity inputs maintained in the tracked\n * `.wildo-saas/continuity/` home.\n *\n * These are repository truth, unlike the generated `dist/`, mutable `state/`\n * and disposable `tmp/` zones that share the `.wildo-saas` ownership root.\n */\nexport const APP_CONTINUITY_FILE_NAMES = {\n APPLICATION_SUBJECT_MANIFEST: 'application-subject.json',\n BOOTSTRAP_PROFILE: 'bootstrap-profile.json',\n} as const;\n\n/**\n * Narrow aggregate retained for the handful of CLI commands that still\n * hand-build `<appRoot>/wildo.saas.config.ts` joins instead of reading\n * `resolvedHomes.app.declarationConfigPath`. The `FRAMEWORK_DIR`,\n * `SAAS_DIR`, `GLOBAL_DIR`, and `PREFERENCES_FILE` members that used to\n * live here were deleted in the Phase 6 closeout: framework home lookups\n * now go through `FRAMEWORK_WORKSPACE_MARKER_FILE` + `resolveFrameworkLayout`,\n * app runtime home lookups through `resolveAppLayout`, and machine\n * preferences through `resolveMachinePreferencesPath`.\n */\nexport const WORKSPACE_CONFIG_NAMES = {\n SAAS: AUTHORED_CONFIG_FILE_NAMES.SAAS,\n} as const;\n\n/**\n * Runtime-owned zones for generated config-evaluation artifacts.\n *\n * These are semantic owners, not source locations. For example, a compatibility\n * config evaluated outside the app tree can still belong to the scoped\n * workspace zone\n * and must emit artifacts under the scoped runtime home (`.wildo-saas/dist/...`),\n * not beside the authored config file itself.\n */\nexport enum ConfigArtifactsZone {\n FRAMEWORK = 'framework',\n SAAS = 'saas',\n TEMP = 'temp',\n}\n\nexport interface ConfigArtifactsLocationOptions {\n zone: ConfigArtifactsZone;\n ownerRoot: string;\n}\n\n/**\n * Absolute path to the machine Wildo home directory. Per-user, per-machine state lives here — NOT\n * shared across machines (\"global\" would be misleading).\n *\n * `$WILDO_HOME` wins when set, then `~/.wildo`. That is the rule both installers and both launchers\n * apply (`WILDO_HOME=\"${WILDO_HOME:-$HOME/.wildo}\"`), and the installer itself suggests\n * `WILDO_HOME=/path/you/own` when `~/.wildo` is not writable. Until 2026-09-24 this function ignored\n * the variable, so the CLI read and wrote a different `preferences.json` from the one its launcher\n * read — invisible while nothing the CLI wrote there changed which CLI runs, and fatal for\n * `wildo update`, whose whole effect is rewriting `cliPath` for the launcher.\n *\n * @param userHome - when given, the home is `<userHome>/.wildo` and `$WILDO_HOME` is not consulted:\n * an explicit home is a question about THAT home, not about this process's environment.\n */\nexport function resolveMachineWildoHomePath(userHome?: string): string {\n if (userHome === undefined) {\n const override = process.env.WILDO_HOME?.trim();\n if (override) return resolve(override);\n }\n return join(userHome ?? homedir(), MACHINE_HOME_NAMES.MACHINE_HOME);\n}\n\n/**\n * Absolute path to the machine preferences file (`$WILDO_HOME/preferences.json`, else\n * `~/.wildo/preferences.json`; see {@link resolveMachineWildoHomePath}). Stores per-user, per-machine\n * preferences such as `cliPath`, `frameworkPath` and `isFrameworkDeveloper`.\n */\nexport function resolveMachinePreferencesPath(userHome?: string): string {\n return join(resolveMachineWildoHomePath(userHome), AUTHORED_CONFIG_FILE_NAMES.PREFERENCES);\n}\n\nfunction isPathInside(root: string, target: string): boolean {\n const rel = relative(resolve(root), resolve(target));\n return rel === '' || (!rel.startsWith('..') && rel !== '..');\n}\n\n/**\n * Cache for the string-overload of `resolveConfigArtifactsBaseDir`.\n *\n * The overload needs to know which zone owns an arbitrary config file path.\n * That information only depends on the containing directory, so we memoize by\n * resolved directory to avoid running the full workspace-scope walk on every\n * `loadConfig` call without an explicit artifact location.\n *\n * Cache lifetime contract:\n *\n * This map is process-scoped and never evicted automatically — workspace\n * layout is treated as static for the duration of a single CLI / companion\n * process, and cache keys are absolute directory paths, so the working set\n * stays bounded by the number of distinct config-file parents touched per\n * invocation (typically a handful). Long-running hosts (dev watchers, test\n * runners, embedded editor integrations) that may observe workspace moves or\n * need to re-detect scope must call\n * {@link clearConfigArtifactsScopeCache} to force the next resolution to\n * re-walk from disk.\n */\nconst resolvedArtifactScopeCacheByDirectory = new Map<string, WorkspaceScopeResult>();\n\nfunction resolveArtifactScopeForDirectory(directoryPath: string): WorkspaceScopeResult {\n const cached = resolvedArtifactScopeCacheByDirectory.get(directoryPath);\n if (cached) {\n return cached;\n }\n\n const scope = resolveWorkspaceScope(directoryPath);\n resolvedArtifactScopeCacheByDirectory.set(directoryPath, scope);\n return scope;\n}\n\n/**\n * Clear the memoized scope lookups used by the string overload of\n * {@link resolveConfigArtifactsBaseDir}. Intended for long-running hosts and\n * tests that simulate workspace moves; standard short-lived CLI / companion\n * processes never need to call this.\n */\nexport function clearConfigArtifactsScopeCache(): void {\n resolvedArtifactScopeCacheByDirectory.clear();\n}\n\nexport function resolveConfigArtifactsBaseDir(options: ConfigArtifactsLocationOptions): string;\nexport function resolveConfigArtifactsBaseDir(filePath: string): string;\nexport function resolveConfigArtifactsBaseDir(\n input: string | ConfigArtifactsLocationOptions,\n): string {\n if (typeof input !== 'string') {\n return resolveConfigArtifactsBaseDirForZone(input);\n }\n\n const absolutePath = resolve(input);\n const scope = resolveArtifactScopeForDirectory(dirname(absolutePath));\n\n if (scope.saasRoot && isPathInside(scope.saasRoot, absolutePath)) {\n return resolveConfigArtifactsBaseDirForZone({\n zone: ConfigArtifactsZone.SAAS,\n ownerRoot: scope.saasRoot,\n });\n }\n\n if (scope.frameworkRoot && isPathInside(scope.frameworkRoot, absolutePath)) {\n return resolveConfigArtifactsBaseDirForZone({\n zone: ConfigArtifactsZone.FRAMEWORK,\n ownerRoot: scope.frameworkRoot,\n });\n }\n\n return resolveConfigArtifactsBaseDirForZone({\n zone: ConfigArtifactsZone.TEMP,\n ownerRoot: absolutePath,\n });\n}\n\n/**\n * Resolve the canonical runtime-owned base directory for config-loader\n * artifacts. This keeps Jiti/SWC output out of authored declaration trees and\n * anchors it under the matching runtime zone.\n */\nexport function resolveConfigArtifactsBaseDirForZone(options: ConfigArtifactsLocationOptions): string {\n switch (options.zone) {\n case ConfigArtifactsZone.FRAMEWORK:\n return join(\n options.ownerRoot,\n WORKSPACE_HOME_NAMES.FRAMEWORK_HOME,\n APP_RUNTIME_SUBDIR_NAMES.DIST,\n APP_RUNTIME_SUBDIR_NAMES.CONFIG_LOADER,\n 'framework',\n );\n case ConfigArtifactsZone.SAAS:\n return join(\n options.ownerRoot,\n WORKSPACE_HOME_NAMES.APP_RUNTIME_HOME,\n APP_RUNTIME_SUBDIR_NAMES.DIST,\n APP_RUNTIME_SUBDIR_NAMES.CONFIG_LOADER,\n 'saas',\n );\n case ConfigArtifactsZone.TEMP:\n return join(tmpdir(), 'wildo-jiti-cache');\n }\n}\n"]}
|