@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":"module-artifact.schemas.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"module-artifact.schemas.js","sourceRoot":"","sources":["../../../src/registry/module-artifact.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,YAAY,CAAC;IACtD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,QAAQ,EAAE,oBAAoB;IAC9B,iEAAiE;IACjE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,4DAA4D;IAC5D,SAAS,EAAE,kBAAkB;IAC7B,gEAAgE;IAChE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACzC,WAAW,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC7C;;;;;;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MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACxC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC","sourcesContent":["/**\n * Module-artifact schemas — metadata that travels alongside the zip\n * artifact bytes (server-stored ledger rows + CLI `info` payloads\n * + lockfile audit refs).\n *\n * Phase 1 landed the published-version row + integrity descriptor.\n * Phase 3.1-bis aligned the registry server's resource model with the\n * framework's user/org/api-key identity layer: the publish-time\n * identity is now `ApiKeyOrganization._id` only — `ApiKeyOrganization`\n * has no `email` field, and api-keys are typically used by automation\n * (CI/CD), not interactively by a user. The wire schema reflects that\n * decision: `publishedByOrgApiKeyId` replaces the old\n * `publishedBy: { keyId, email }` envelope.\n *\n * Phase 5 install/update verifies `integrity` before unzipping.\n */\n\nimport { z } from 'zod';\nimport { Sha256DigestSchema } from './digest.schemas';\nimport { ModuleManifestSchema } from './module-manifest.schemas';\n\n/**\n * One immutable published version row. Mirrors `RegistryModuleVersion`\n * fields documented in the analysis plan's \"Registry Server Data\n * Model\" section.\n */\nexport const ModuleVersionRecordSchema = z.strictObject({\n moduleId: z.string().min(1),\n version: z.string().min(1),\n manifest: ModuleManifestSchema,\n /** Engine-`FILES`-resource id of the artifact zip in storage. */\n artifactFileId: z.string().min(1),\n /** Required `sha256:<hex>` digest of the artifact bytes. */\n integrity: Sha256DigestSchema,\n /** Total artifact size in bytes (informational + DoS clamp). */\n sizeBytes: z.number().int().nonnegative(),\n publishedAt: z.iso.datetime({ offset: true }),\n /**\n * `ApiKeyOrganization._id` of the api-key used at publish time.\n * The framework's `ApiKeyOrganization` is org-scoped and has no\n * `email` / `userId` field, so the wire identity tracks the\n * api-key only — readers who want richer publisher attribution\n * resolve the api-key against the framework's `ORG_API_KEYS`\n * resource separately.\n */\n publishedByOrgApiKeyId: z.string().min(1),\n /** ISO datetime when the version was yanked. Soft-yank by default (KD-9). */\n yankedAt: z.iso.datetime({ offset: true }).optional(),\n yankReason: z.string().optional(),\n /**\n * Reserved for future signing implementations. Format intentionally\n * left open until the signing decision is taken (deferred per the\n * \"Deferred / Out Of Scope\" section of the plan).\n */\n signatures: z.array(z.unknown()).optional(),\n});\nexport type ModuleVersionRecord = z.infer<typeof ModuleVersionRecordSchema>;\n\n/**\n * A yanked release is still served by EXACT version (#1758): an application whose lockfile pins it\n * must be able to reinstall. The artifact download then carries the yank in these two headers, and the\n * resolve response carries it as {@link RegistryYankNoticeSchema}, so a client can warn.\n * The reason is free text, so it travels percent-encoded (`encodeURIComponent`) — never raw in a header.\n */\nexport const REGISTRY_YANKED_AT_HEADER = 'x-wildo-yanked-at';\nexport const REGISTRY_YANK_REASON_HEADER = 'x-wildo-yank-reason';\n\nexport const RegistryYankNoticeSchema = z.object({\n yankedAt: z.iso.datetime({ offset: true }),\n reason: z.string().optional(),\n});\nexport type RegistryYankNotice = z.infer<typeof RegistryYankNoticeSchema>;\n\n/**\n * 7th-pass S-M3: wire schema for the `PUT /v1/registry/:domain/modules/:moduleId/tags/:tag`\n * response. Documented so future CLI consumers can Zod-parse it\n * without guessing the shape.\n *\n * `noChange: true` signals that the requested `(tag, version)` mapping\n * was already in place — the registry short-circuited the repo write\n * + audit emission to keep SIEM counts honest. Optional so successful\n * mutations omit it. Consumers should treat absence as `false`.\n */\nexport const SetTagResponseSchema = z.object({\n ok: z.boolean(),\n noChange: z.boolean().optional(),\n});\nexport type SetTagResponse = z.infer<typeof SetTagResponseSchema>;\n\n/**\n * `GET /v1/auth/whoami` on the REGISTRY SERVER — the identity a bearer key resolves to, read by\n * `wildo registry login` and `whoami --verify`. The CLI Zod-parses every required field so a misconfigured registry\n * that omits `organizationId` cannot persist a credential with `org=?`.\n *\n * `roles` is optional because not every registry deployment models\n * roles today; when supplied it lands on the per-machine credential\n * blob for staleness UX.\n *\n * 4th-pass review M5: the schema is `.object({...})` (NOT `.strictObject`)\n * so the registry server can add new optional response fields\n * (`tokenIssuedAt`, `lastUsedAt`, etc.) WITHOUT every existing CLI\n * version refusing to authenticate. The CLI still fails-closed on\n * missing required fields; only unknown additional fields are\n * silently dropped on the client side. Forward-compat is the priority\n * here since CLI versions cannot be flushed in lockstep with server\n * deployments.\n */\nexport const RegistryWhoamiResponseSchema = z.object({\n organizationId: z.string().min(1),\n apiKeyId: z.string().min(1),\n apiKeyName: z.string().min(1).optional(),\n roles: z.array(z.string().min(1)).optional(),\n});\nexport type RegistryWhoamiResponse = z.infer<typeof RegistryWhoamiResponseSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-manifest.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"module-manifest.schemas.d.ts","sourceRoot":"","sources":["../../../src/registry/module-manifest.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAqC,YAAY,EAAkC,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAUhK;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,QACwJ,CAAC;AACxL,eAAO,MAAM,iBAAiB,aAGK,CAAC;AAGpC;;;;;GAKG;AACH,eAAO,MAAM,sCAAsC,uCAA2C,CAAC;AAC/F,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC;AAEtG;;;;;GAKG;AACH,eAAO,MAAM,mCAAmC;;;kBAG9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG;;;;;GAKG;AACH,eAAO,MAAM,0CAA0C,yBAA6B,CAAC;AACrF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0CAA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K,SAAS,EAAE,CAAC;QACxC,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,+FAA+F,EAAE,CAAC,CAAC;IACzK,CAAC;IACD,yGAAyG;IACzG,2FAA2F;IAC3F,MAAM,QAAQ,GAAG,GAAG,2BAA2B,CAAC,SAAS,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;IACrF,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC1E,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,YAAY,EAAE,WAAW,CAAC;YACjC,OAAO,EAAE,iDAAiD,QAAQ,cAAc,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,GAAG;SACtH,CAAC,CAAC;IACL,CAAC;IACD,MAAM,WAAW,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,WAAW,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACvI,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,YAAY,CAAC;YACpB,OAAO,EAAE,4EAA4E,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;SAC9G,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Module manifest schema — `wildo.module.json` shipped inside every\n * registry artifact.\n *\n * Phase 1 fleshes out the dependency / boundary contract that Phase\n * 5+ install/update/remove flows need. The manifest is the single\n * cross-package contract every registry client signs against; new\n * fields require a plan amendment.\n *\n * Authoritative references (keep these in sync with edits below):\n * - KD-12 — modules cannot claim arbitrary top-level app ownership;\n * `boundaries` declares which app surfaces the artifact may write.\n * - KD-13 — npm + module + capability dependencies are explicit.\n * - KD-19 — runtime packages produced from installed module content\n * must NOT import `platform-config-lib`; this is enforced\n * downstream by Phase 5+ verification, not the manifest itself.\n */\n\nimport { z } from 'zod';\nimport { AppFrontendType, ProviderCatalogueProvenanceSchema, ProviderTier, engineSlotsBoundByCapabilities, type EngineCapability } from '@wildo-ai/saas-models';\n\n/**\n * Authoring shape for a nonempty version constraint. Registry release selectors\n * can resolve tags; manifest module/framework requirements instead use npm\n * semver ranges and are validated against the receiving application's recorded\n * module versions and installed framework packages before source adoption.\n */\nconst SemverRange = z.string().min(1).describe('npm-style semver range');\n\n/**\n * Exact `MAJOR.MINOR.PATCH[-prerelease][+build]` semver. The regex\n * mirrors the official semver.org grammar, so manifest authors\n * cannot publish version `^1.2.3` or `latest` and have install\n * silently treat it as concrete.\n */\nexport const SEMVER_EXACT_REGEX =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\nexport const SemverExactSchema = z\n .string()\n .regex(SEMVER_EXACT_REGEX, 'Expected exact semver `MAJOR.MINOR.PATCH` (no ranges, no tags)')\n .describe('Exact semver version');\nconst SemverExact = SemverExactSchema;\n\n/**\n * `dependsOn.modules.<moduleId>` — other Wildo modules that this\n * module requires. Install hard-fails by default if any required\n * module is missing (KD-13). Range resolution mirrors npm semver\n * semantics.\n */\nexport const ModuleManifestModuleDependenciesSchema = z.record(z.string().min(1), SemverRange);\nexport type ModuleManifestModuleDependencies = z.infer<typeof ModuleManifestModuleDependenciesSchema>;\n\n/**\n * `dependsOn.npm.dependencies` / `peerDependencies` — npm packages\n * the installed module imports at runtime. Install surfaces these\n * to the operator but does not edit `package.json` automatically\n * or install dependencies. The operator chooses the consuming package (KD-13).\n */\nexport const ModuleManifestNpmDependenciesSchema = z.strictObject({\n dependencies: z.record(z.string().min(1), SemverRange).default({}),\n peerDependencies: z.record(z.string().min(1), SemverRange).default({}),\n});\nexport type ModuleManifestNpmDependencies = z.infer<typeof ModuleManifestNpmDependenciesSchema>;\n\n/**\n * `dependsOn.capabilities` — required EngineCapability names. Adoption validates\n * each name against the canonical enum and requires enabled:true in the host's\n * authored engineCapabilities. This proves declared activation, not provider\n * health. Strings remain the artifact format; the CLI performs host comparison.\n */\nexport const ModuleManifestCapabilityDependenciesSchema = z.array(z.string().min(1));\nexport type ModuleManifestCapabilityDependencies = z.infer<typeof ModuleManifestCapabilityDependenciesSchema>;\n\nexport const ModuleManifestDependenciesSchema = z.strictObject({\n modules: ModuleManifestModuleDependenciesSchema.default({}),\n npm: ModuleManifestNpmDependenciesSchema.default({\n dependencies: {},\n peerDependencies: {},\n }),\n capabilities: ModuleManifestCapabilityDependenciesSchema.default([]),\n});\nexport type ModuleManifestDependencies = z.infer<typeof ModuleManifestDependenciesSchema>;\n\n/**\n * Engine compatibility — the framework version range this module\n * targets. Install hard-fails by default if the host app's framework\n * version is outside the range. Every installed saas-models copy reached from\n * application workspace framework dependencies must satisfy it; desired pins\n * and the running CLI version are not installed application evidence.\n */\nexport const ModuleManifestEngineSchema = z.strictObject({\n framework: SemverRange,\n});\nexport type ModuleManifestEngine = z.infer<typeof ModuleManifestEngineSchema>;\n\n/**\n * One registry NAME segment — a domain slug, or either half of a module id. Lowercase ASCII letters,\n * digits, `.`, `_`, `-`, not starting with `.`, `_` or `-` (npm's package-name alphabet).\n *\n * These names are not only identifiers: the CLI builds filesystem paths from them\n * (`.wildo-saas/generated/modules-artifacts/<domain>/<scope>/<name>/…`) and runs a RECURSIVE delete\n * on those paths to wipe a stale staging or extraction tree. Until 2026-09-25 the only rule on a\n * module id was \"contains a `/`\", so a manifest `id` of `a/../../../..` made `wildo registry publish`\n * resolve its staging root to the application root and delete it. The rule is total over both\n * places a name is authored: a module's manifest, and a domain created on the registry server.\n */\nconst REGISTRY_NAME_SEGMENT_REGEX = /^[a-z0-9][a-z0-9._-]*$/;\nconst REGISTRY_NAME_SEGMENT_MAX_LENGTH = 64;\n\nfunction isRegistryNameSegment(segment: string): boolean {\n return segment.length <= REGISTRY_NAME_SEGMENT_MAX_LENGTH && REGISTRY_NAME_SEGMENT_REGEX.test(segment);\n}\n\n/** A registry domain slug (`acme`, `internal`) — one {@link isRegistryNameSegment} segment. */\nexport const RegistryDomainSlugSchema = z.string().refine(isRegistryNameSegment, {\n error: 'a registry domain must be lowercase letters, digits, `.`, `_` or `-`, starting with a letter or digit (max 64)',\n});\n\n/** Whether `moduleId` is a well-formed `<scope>/<name>` module id. */\nexport function isModuleId(moduleId: string): boolean {\n const segments = moduleId.split('/');\n return segments.length === 2 && segments.every(isRegistryNameSegment);\n}\n\n/**\n * A module id: exactly `<scope>/<name>` (e.g. `acme/billing`), each half a registry name segment.\n * The id is also the lockfile key, the registry URL segment, and — through the CLI — a directory\n * path, so its shape is the path-safety rule, not a style preference.\n */\nexport const ModuleIdSchema = z.string().refine(isModuleId, {\n error: 'a module id must be `<scope>/<name>` (e.g. `acme/billing`), each half lowercase letters, digits, `.`, `_` or `-`',\n});\n\n/**\n * Where each layer's MODULE directories live in a Wildo SaaS application, relative to its root.\n *\n * Derived from the scaffold, not invented: the `add-module` scenario creates a module's directories\n * under `shared-lib/src/modules/<id>`, `specifications/src/modules/<id>`, `frontend/src/modules/<id>`\n * and `backend-api/src/modules/<id>`; `add-minion` and `add-worker-node` create a package directory\n * under `minions/<dir>` and `workers/<dir>`.\n *\n * A registry module may write only BELOW one of these roots, in a directory it names. That is the\n * whole of KD-12, stated positively. Until 2026-09-25 the boundary rule refused only absolute paths\n * and `..` segments, so `.`, `.git/hooks`, `.wildo-saas` and `wildo.saas.config.ts` were all valid\n * boundaries: a published module could overwrite the host's configuration or plant a git hook, and\n * `wildo registry publish` would ship the author's `.env` and `secrets.json`.\n */\nexport const MODULE_BOUNDARY_LAYER_ROOTS = {\n specifications: 'specifications/src/modules',\n shared: 'shared-lib/src/modules',\n frontend: 'frontend/src/modules',\n backend: 'backend-api/src/modules',\n minions: 'minions',\n workers: 'workers',\n /**\n * A PROVIDER module's directory, `providers/<ref>` (#2014), holding one workspace package per facet\n * (`providers/<ref>/backend`, `providers/<ref>/frontend`). Like a minion or a worker, each facet is its\n * own package, so the root is a top-level directory rather than a layer's `src/modules`: the facet's own\n * `package.json` is where its vendor SDK dependency lives, and a runtime depends only on the facet it runs.\n */\n providers: 'providers',\n} as const;\nexport type ModuleBoundaryLayer = keyof typeof MODULE_BOUNDARY_LAYER_ROOTS;\n\n/** Every boundary layer, in the canonical order of {@link MODULE_BOUNDARY_LAYER_ROOTS}. */\nexport const MODULE_BOUNDARY_LAYERS = Object.keys(MODULE_BOUNDARY_LAYER_ROOTS) as ModuleBoundaryLayer[];\n\n/**\n * Directory names a module artifact may never contain, at any depth: dependency installs are the\n * consumer's to produce, never the publisher's to ship.\n */\nconst MODULE_ARTIFACT_FORBIDDEN_SEGMENTS: ReadonlySet<string> = new Set(['node_modules']);\n\n/**\n * Whether one `/`-separated path segment may appear in a module boundary or a module artifact.\n *\n * A DOT-prefixed segment is refused outright. That single rule removes `.git` (hooks run code on the\n * next commit), `.env` (a minion or worker package carries its generated secrets there),\n * `.wildo-saas` (the companion and machine-local state) and `..` / `.` (traversal and \"the whole\n * root\"). npm applies the same default for the same reason: `.git` and the like never enter a\n * published package.\n */\nfunction isAllowedModulePathSegment(segment: string): boolean {\n return segment.length > 0 && !segment.startsWith('.') && !MODULE_ARTIFACT_FORBIDDEN_SEGMENTS.has(segment);\n}\n\n/**\n * Whether `appRelativePath` (POSIX separators, relative to the application root) may be carried by a\n * module artifact. Used on BOTH sides of the registry so they cannot disagree:\n *\n * - `wildo registry publish` skips a file that fails it, so a secret beside the module's source is\n * never packed;\n * - `wildo registry add` / `update` / `repair` refuse an artifact containing one, before writing\n * anything — a correctly published artifact cannot contain it, so its presence means the bytes\n * did not come from `publish`.\n */\nexport function isModuleArtifactPathAllowed(appRelativePath: string): boolean {\n if (appRelativePath.includes('\\\\') || appRelativePath.startsWith('/')) return false;\n return appRelativePath.split('/').every(isAllowedModulePathSegment);\n}\n\n/**\n * Whether `appRelativePath` is a file a registry module can OWN in an application: a path a module\n * artifact may carry ({@link isModuleArtifactPathAllowed}) that also sits strictly below one of the\n * layer roots ({@link MODULE_BOUNDARY_LAYER_ROOTS}) — because an install only ever writes inside a\n * boundary, and every boundary lives there.\n *\n * This is the rule for a path RECORDED as installed (`sections.modules.installed[*].files`), which\n * `remove` and `update` delete. `isModuleArtifactPathAllowed` alone would let a hand-edited or badly\n * merged entry name `wildo.saas.config.ts` or `backend-api/src/index.ts`, and removing the module would\n * then delete the application's own file.\n */\nexport function isModuleOwnedFilePath(appRelativePath: string): boolean {\n return isModuleArtifactPathAllowed(appRelativePath)\n && Object.values(MODULE_BOUNDARY_LAYER_ROOTS).some((root) => appRelativePath.startsWith(`${root}/`));\n}\n\n/**\n * One layer's `boundaries` entries: each a directory strictly BELOW that layer's root\n * ({@link MODULE_BOUNDARY_LAYER_ROOTS}), written with POSIX separators, every segment allowed by\n * {@link isModuleArtifactPathAllowed}. Validated at parse time, so the registry server refuses a\n * manifest declaring a wider boundary at publish and the CLI refuses one at install.\n */\nfunction moduleLayerBoundariesSchema(layer: ModuleBoundaryLayer) {\n const root = MODULE_BOUNDARY_LAYER_ROOTS[layer];\n return z.array(\n z.string().min(1).refine(\n (entry) => isModuleArtifactPathAllowed(entry) && entry.startsWith(`${root}/`) && entry.length > root.length + 1,\n {\n error:\n `boundaries.${layer} entries must name a directory below \\`${root}/\\` (e.g. \\`${root}/acme-billing\\`), ` +\n 'with `/` separators and no segment that starts with `.` or is `node_modules`',\n },\n ),\n ).default([]);\n}\n\n/**\n * `boundaries` — the per-layer surface the module is allowed to write into the host app source\n * (KD-12). Each layer is optional; modules typically declare only the layers they actually contain\n * (a backend-only module declares `backend` + `shared` and omits `frontend` / `specifications`).\n */\nexport const ModuleManifestBoundariesSchema = z.strictObject({\n specifications: moduleLayerBoundariesSchema('specifications'),\n shared: moduleLayerBoundariesSchema('shared'),\n frontend: moduleLayerBoundariesSchema('frontend'),\n backend: moduleLayerBoundariesSchema('backend'),\n minions: moduleLayerBoundariesSchema('minions'),\n workers: moduleLayerBoundariesSchema('workers'),\n providers: moduleLayerBoundariesSchema('providers'),\n});\nexport type ModuleManifestBoundaries = z.infer<typeof ModuleManifestBoundariesSchema>;\n\n/**\n * The boundaries schema declares every layer of {@link MODULE_BOUNDARY_LAYER_ROOTS} and nothing else: a\n * root added without its boundaries key (or the reverse) fails to compile here.\n */\nexport const BOUNDARIES_SCHEMA_COVERS_EVERY_LAYER: [keyof ModuleManifestBoundaries] extends [ModuleBoundaryLayer]\n ? [ModuleBoundaryLayer] extends [keyof ModuleManifestBoundaries] ? true : never\n : never = true;\n\n/**\n * Every boundary directory a manifest declares, across ALL layers, in canonical layer order.\n *\n * The one place a consumer turns `boundaries` into a list. Three consumers (the packager, `publish`, the\n * install fan-out) each used to spell the six layers out by hand, so a seventh layer — `providers`,\n * #2014 — would have been silently skipped by all three: an artifact that packs nothing, an install that\n * copies nothing, and a publish that reports success. Iterating the roots makes the next layer impossible\n * to forget.\n */\nexport function flattenModuleBoundaries(boundaries: ModuleManifestBoundaries | undefined): string[] {\n if (!boundaries) return [];\n return MODULE_BOUNDARY_LAYERS.flatMap((layer) => boundaries[layer] ?? []);\n}\n\n/**\n * How an installed module is REGISTERED in the host application — the composition scenario whose\n * registry edits make it a module the application knows about (#1755, #1773).\n *\n * Installing copies a module's files; registering it adds it to what the application declares. Without\n * registration the backend discovers `backend-api/src/modules/<dir>` by directory scan while every other\n * layer ignores the module, and a minion or worker is never declared at all, so it never runs.\n *\n * Each member is the framework scenario that IS the declaration of how that shape is registered, so\n * installation replays its edit steps rather than keeping a second copy of them:\n */\nexport enum ModuleRegistrationScenario {\n /** A domain module — its shared, specifications and frontend registries and `applicationModules`. */\n ADD_MODULE = 'add-module',\n /** A minion — `applicationMinions`, its provider scope, and the pnpm workspace member. */\n ADD_MINION = 'add-minion',\n /** A worker node — `applicationWorkers`, its provider scope, and the pnpm workspace member. */\n ADD_WORKER_NODE = 'add-worker-node',\n /**\n * A provider module (#2014): the pnpm workspace member, each facet package as a `workspace:*` dependency of the\n * runtimes that own that facet, and the provider's scope in each. Unlike the three above it is never carried by a\n * MANIFEST: the owners are the INSTALLING application's, so the installer derives the wiring and only its lockfile\n * records it ({@link ProviderWiringSchema}).\n */\n ADD_PROVIDER_PACKAGE = 'add-provider-package',\n}\n\n/**\n * An application-relative service directory as `wildo.saas.config.ts` declares it (`./backend-api`, `frontend`).\n * Restricted to plain path segments, with no `..`, because a wiring names files the installer and `remove` edit.\n */\nconst WIRED_SERVICE_PATH_PATTERN = /^(\\.\\/)?(?!\\.\\.?(\\/|$))[A-Za-z0-9_-][A-Za-z0-9._-]*(\\/(?!\\.\\.?(\\/|$))[A-Za-z0-9_-][A-Za-z0-9._-]*)*$/;\n\n/** A scoped provider facet package name: `@<scope>/provider-<ref>` or `@<scope>/provider-<ref>-frontend`. */\nconst PROVIDER_FACET_PACKAGE_NAME_PATTERN = /^@[a-z0-9][a-z0-9._-]*\\/provider-[a-z][a-z0-9-]*$/;\n\n/** One runtime a provider facet was wired into: its key in `services`, and its directory. */\nexport const ProviderWiringOwnerSchema = z.strictObject({\n serviceKey: z.string().regex(/^[A-Za-z][A-Za-z0-9_-]*$/),\n path: z.string().regex(WIRED_SERVICE_PATH_PATTERN),\n});\nexport type ProviderWiringOwner = z.infer<typeof ProviderWiringOwnerSchema>;\n\n/**\n * What an `add-provider-package` install wired, as the INSTALLER derived it from its own application (#2014):\n * - `backendOwners`: the backend services that depend on the backend facet and scope the provider;\n * - `frontendOwners`: the frontend services, of a type in the facet's `surfaces`, that depend on the browser facet\n * and scope the provider.\n *\n * Recorded so `remove` reverses exactly what install wrote, even after the application's services change.\n */\nexport const ProviderWiringSchema = z.strictObject({\n /** The backend facet's package name as installed (`@<scope>/provider-<ref>`); absent without a backend facet. */\n backendPackage: z.string().regex(PROVIDER_FACET_PACKAGE_NAME_PATTERN).optional(),\n backendOwners: z.array(ProviderWiringOwnerSchema),\n /** The browser facet's package name as installed; absent without a frontend facet. */\n frontendPackage: z.string().regex(PROVIDER_FACET_PACKAGE_NAME_PATTERN).optional(),\n frontendOwners: z.array(ProviderWiringOwnerSchema),\n});\nexport type ProviderWiring = z.infer<typeof ProviderWiringSchema>;\n\n/**\n * The four layers of a domain module, named as its manifest boundaries name them. A domain-module\n * registration may cover a SUBSET (#1773): a backend+shared module registers its shared entries and an\n * `applicationModules` entry bound to the backend only.\n */\nexport enum DomainModuleLayer {\n SHARED = 'shared',\n SPECIFICATIONS = 'specifications',\n FRONTEND = 'frontend',\n BACKEND = 'backend',\n}\n\n/**\n * Every domain layer is a boundary layer, spelled the same (#1773 review): the enum restates four keys of\n * `MODULE_BOUNDARY_LAYER_ROOTS`, so a member added or renamed on one side alone fails to compile here.\n */\nexport const DOMAIN_LAYERS_ARE_BOUNDARY_LAYERS: `${DomainModuleLayer}` extends ModuleBoundaryLayer ? true : never = true;\n\n/** Canonical order, so one set of layers has one spelling. */\nexport const DOMAIN_MODULE_LAYERS: readonly DomainModuleLayer[] = [\n DomainModuleLayer.SHARED,\n DomainModuleLayer.SPECIFICATIONS,\n DomainModuleLayer.FRONTEND,\n DomainModuleLayer.BACKEND,\n];\n\n/**\n * The scenarios' variable patterns for the directory and camelCase stem their REGISTRY edits use\n * (`moduleId`/`moduleCamel`, `minionDir`/`minionCamel`, `workerDir`/`workerCamel` share them). Mirrored\n * here because the manifest is validated where no scenario is loaded (the registry server); a test pins\n * them equal to the scenarios' own declarations.\n */\nexport const MODULE_REGISTRATION_MODULE_ID_PATTERN = /^[a-z][a-z0-9-]*$/;\nexport const MODULE_REGISTRATION_MODULE_CAMEL_PATTERN = /^[a-z][A-Za-z0-9]*$/;\n\n/**\n * A module's registration: the scenario plus the ONLY values its registry edits read. It carries no\n * code — the installer renders the scenario's own edit steps with these values, both restricted to\n * identifier alphabets (and anything else a scenario needs is DERIVED by the installer, never read from\n * the manifest) — so a manifest cannot smuggle text into the host's files. Derived by\n * `wildo registry publish` from the publishing application (every edit already present), never authored.\n */\nexport const ModuleManifestRegistrationSchema = z\n .strictObject({\n scenario: z.enum(ModuleRegistrationScenario),\n /** The module's directory under its scenario's root: each layer's modules root, `minions/` or `workers/` (kebab-case). */\n moduleId: z.string().regex(MODULE_REGISTRATION_MODULE_ID_PATTERN),\n /** The camelCase stem the scenario's entries are named from (`<stem>Module`, the minion/worker bucket key). */\n moduleCamel: z.string().regex(MODULE_REGISTRATION_MODULE_CAMEL_PATTERN),\n /**\n * `add-module` only: the layers the module covers, when it is NOT all four (absent = the whole module,\n * so one module has one spelling). Must include `backend` or `frontend`: an `applicationModules` entry\n * binds the module to at least one service.\n */\n layers: z.array(z.enum(DomainModuleLayer)).min(1).optional(),\n /** `add-provider-package` only, and required there: what the installer wired. */\n providerWiring: ProviderWiringSchema.optional(),\n })\n .superRefine((registration, context) => {\n const isProviderWiring = registration.scenario === ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE;\n if (isProviderWiring !== (registration.providerWiring !== undefined)) {\n context.addIssue({ code: 'custom', path: ['providerWiring'], message: 'an add-provider-package registration carries its wiring, and no other registration does' });\n }\n const layers = registration.layers;\n if (layers === undefined) return;\n if (registration.scenario !== ModuleRegistrationScenario.ADD_MODULE) {\n context.addIssue({ code: 'custom', path: ['layers'], message: 'only an add-module registration covers layers' });\n return;\n }\n const canonical = DOMAIN_MODULE_LAYERS.filter((layer) => layers.includes(layer));\n if (canonical.length !== layers.length || canonical.some((layer, index) => layer !== layers[index])) {\n context.addIssue({ code: 'custom', path: ['layers'], message: `layers must be distinct and in canonical order (${DOMAIN_MODULE_LAYERS.join(', ')})` });\n }\n if (canonical.length === DOMAIN_MODULE_LAYERS.length) {\n context.addIssue({ code: 'custom', path: ['layers'], message: 'a whole module omits `layers`' });\n }\n if (!layers.includes(DomainModuleLayer.BACKEND) && !layers.includes(DomainModuleLayer.FRONTEND)) {\n context.addIssue({ code: 'custom', path: ['layers'], message: 'a registered module must include the backend or the frontend layer' });\n }\n });\nexport type ModuleManifestRegistration = z.infer<typeof ModuleManifestRegistrationSchema>;\n\n/**\n * What a registry module IS: the one discriminator every consumer branches on (#2014).\n *\n * The registry was built to carry application FEATURES. On 2026-09-29 Paul decided it also carries\n * PROVIDERS, distributed shadcn-style: a provider's source is copied into the application, which owns it\n * from then on. The Activepieces/Sim-generated catalogue that used to hold providers is archived (#2012).\n * The two kinds differ in what they may contain and in how they are registered, so the difference is\n * named rather than inferred from which boundaries happen to be present.\n */\nexport enum ModuleKind {\n /**\n * An application feature: domain module layers, a minion or a worker. Every module published before\n * #2014 is one, which is why a manifest that omits `kind` reads as FEATURE.\n */\n FEATURE = 'feature',\n /**\n * One vendor's integration, installed at `providers/<ref>/` with ONE workspace package per facet\n * ({@link ProviderModuleFacet}): each carries its own SDK dependencies in its own `package.json`, and\n * each runtime depends only on the facet it runs. It may fill an engine capability when its tier is\n * EXTENSION.\n *\n * What a provider module never is:\n * - system-of-record facets: a separate lane, delivered by `@wildo-ai/systems-of-record` (#2013);\n * - an INFRASTRUCTURE provider (object storage, databases, brokers, scanners): those are executed by the\n * PLATFORM (apps-manager) with platform administrator credentials, so application-owned code must never\n * be one. They stay in the platform's own package, selected by the application's declaration (#1692).\n */\n PROVIDER = 'provider',\n}\n\n/**\n * The runtime facets a provider module can ship, each as its own workspace package under\n * `providers/<ref>/<facet>/` (Paul, 2026-09-29).\n *\n * One package per facet, as the engine itself separates `external-connectors-private` (backend) from\n * `external-connectors-public` (browser):\n * - a Node SDK never reaches a frontend install, and a browser SDK never reaches a backend's;\n * - each runtime owner depends on exactly the facet it runs, so imports stay unambiguous;\n * - the browser facet cannot reach backend code unless its own manifest declares that dependency, which\n * publish refuses. Isolation is a property of the dependency graph, not of scanning import statements.\n *\n * There is deliberately no INFRASTRUCTURE member: see {@link ModuleKind.PROVIDER}.\n */\nexport enum ProviderModuleFacet {\n /** Loaded by the application backend, the companion and minions. Workers load no providers. */\n BACKEND = 'backend',\n /** Loaded by the frontend services whose type is listed in its `surfaces`. */\n FRONTEND = 'frontend',\n}\n\n/**\n * How far a published provider has been taken since it was adopted (#2012).\n *\n * There is deliberately no SEEDED member: a seed (a catalogue transposition in the archive) is never\n * published, so the registry only ever holds providers someone adopted.\n */\nexport enum ProviderModuleMaturity {\n /** Copied from a seed or written by hand, reviewed, and owned by Wildo. Not yet met the real vendor. */\n ADOPTED = 'adopted',\n /** Has executed against the real vendor it names, with the proof recorded on the tracker. */\n PROVEN = 'proven',\n}\n\n/**\n * The tiers a PROVIDER module may declare. MAIN is the engine's own set: its origin is always ENGINE,\n * and the tier rule (`provider-tier-rule.shared.utils.ts`) refuses MAIN from anywhere else.\n */\nconst PROVIDER_MODULE_TIERS = [ProviderTier.CATALOGUE, ProviderTier.EXTENSION] as const;\n\n/**\n * The `provider` block of a PROVIDER module: what the registry must know about the provider WITHOUT\n * executing its code, which is what server-side search and listing need.\n *\n * Deliberately NOT carried here, so there is one source for each fact:\n * - the ENGINE capabilities it fills: derived from `providerCapabilities` through the same closed map the\n * engine uses (`engineSlotsBoundByCapabilities`);\n * - the compliance profile, secrets contract, operations and auth: they live in the module's code\n * (`BackendProviderModule`), which discovery already reads. Publish checks that this block agrees\n * with that code (#2014).\n *\n * Fields for per-provider skills, OpenAPI binding and change monitoring are added by the issues that\n * read them (#2026, #2028, #2027), not before.\n */\nexport const ModuleManifestProviderSchema = z\n .strictObject({\n /**\n * The provider ref: the application's scope key, the directory under `providers/`, and the suffix of\n * the package name. One kebab-case segment, the same alphabet as a registration directory.\n */\n ref: z.string().regex(MODULE_REGISTRATION_MODULE_ID_PATTERN),\n /** The vendor's identity, shared by every ref of one vendor. Defaults to the ref, as provider metadata does. */\n vendor: z.string().regex(MODULE_REGISTRATION_MODULE_ID_PATTERN).optional(),\n /** CATALOGUE (operations only) or EXTENSION (fills an engine capability). */\n tier: z.enum(PROVIDER_MODULE_TIERS),\n /** The provider capability tokens the module declares, as its `BackendProviderModule` does. */\n providerCapabilities: z.array(z.string().min(1)).default([]),\n /**\n * The facets the module ships, each a package at `providers/<ref>/<facet>/`. At least one.\n * Keys are {@link ProviderModuleFacet} members.\n */\n facets: z.strictObject({\n [ProviderModuleFacet.BACKEND]: z.strictObject({}).optional(),\n [ProviderModuleFacet.FRONTEND]: z\n .strictObject({\n /**\n * Which frontend surfaces the browser facet serves: the application, the public website, the\n * documentation site. Installation adds the facet's package only to frontend services of these\n * types. The engine composes a separate provider registry per surface, which is why it is named.\n */\n surfaces: z.array(z.enum(AppFrontendType)).min(1),\n })\n .optional(),\n }),\n maturity: z.enum(ProviderModuleMaturity),\n /** Where the adopted source came from, when it came from a catalogue seed. */\n seed: ProviderCatalogueProvenanceSchema.optional(),\n })\n .superRefine((provider, context) => {\n if (providerModuleFacets(provider).length === 0) {\n context.addIssue({ code: 'custom', path: ['facets'], message: 'a provider module ships a backend facet, a frontend facet, or both' });\n }\n const surfaces = provider.facets[ProviderModuleFacet.FRONTEND]?.surfaces ?? [];\n if (new Set(surfaces).size !== surfaces.length) {\n context.addIssue({ code: 'custom', path: ['facets', ProviderModuleFacet.FRONTEND, 'surfaces'], message: 'each frontend surface is listed once' });\n }\n const boundSlots = engineSlotsBoundByCapabilities(provider.providerCapabilities);\n if (provider.tier === ProviderTier.CATALOGUE && boundSlots.length > 0) {\n context.addIssue({\n code: 'custom',\n path: ['providerCapabilities'],\n message:\n `tier CATALOGUE may claim only open capability tokens, but ${boundSlots.map((entry) => `\"${entry.capability}\" binds the ${entry.slot} engine slot`).join(', ')}. `\n + 'Declare EXTENSION to fill an engine capability.',\n });\n }\n if (provider.tier === ProviderTier.EXTENSION && boundSlots.length === 0) {\n context.addIssue({\n code: 'custom',\n path: ['providerCapabilities'],\n message: 'tier EXTENSION fills an engine capability, so at least one provider capability must bind an engine slot',\n });\n }\n });\nexport type ModuleManifestProvider = z.infer<typeof ModuleManifestProviderSchema>;\n\n/**\n * The facets a provider module ships, in canonical enum order, and the package directory of each.\n * Install, publish and registration all read these rather than re-deriving the layout.\n */\nexport function providerModuleFacets(provider: Pick<ModuleManifestProvider, 'facets'>): ProviderModuleFacet[] {\n return Object.values(ProviderModuleFacet).filter((facet) => provider.facets[facet] !== undefined);\n}\n\n/** `providers/<ref>/<facet>`: where one facet's workspace package lives. */\nexport function providerModuleFacetDirectory(ref: string, facet: ProviderModuleFacet): string {\n return `${MODULE_BOUNDARY_LAYER_ROOTS.providers}/${ref}/${facet}`;\n}\n\n/** The engine capabilities a provider module fills, derived rather than declared. */\nexport function engineCapabilitiesFilledByProviderModule(provider: ModuleManifestProvider): EngineCapability[] {\n return [...new Set(engineSlotsBoundByCapabilities(provider.providerCapabilities).map((entry) => entry.slot))];\n}\n\n/** The file a module's manifest lives in: at the root of every artifact, of a checkout module, and of a publishing application. */\nexport const MODULE_MANIFEST_FILE_NAME = 'wildo.module.json';\n\n/**\n * Top-level manifest. Stored at `wildo.module.json` inside every\n * artifact zip and at the registry server alongside its version row.\n *\n * `id` semantics: `<scope>/<name>` (e.g. `acme/billing`), separate\n * from the registry domain (e.g. `internal`). The id is reused as the lockfile entry key\n * (`sections.modules.installed[<id>]`).\n */\nexport const ModuleManifestSchema = z.object({\n id: ModuleIdSchema,\n version: SemverExact,\n /** What the module is. Absent reads as FEATURE: every module published before #2014 is one. */\n kind: z.enum(ModuleKind).default(ModuleKind.FEATURE),\n /** Present exactly when `kind` is PROVIDER. */\n provider: ModuleManifestProviderSchema.optional(),\n description: z.string().optional(),\n /** Free-form description of what the module ships, for `wildo registry info`. */\n longDescription: z.string().optional(),\n engine: ModuleManifestEngineSchema.optional(),\n boundaries: ModuleManifestBoundariesSchema.optional(),\n dependsOn: ModuleManifestDependenciesSchema.optional(),\n /** How the module is registered in a host application — see {@link ModuleManifestRegistrationSchema}. */\n registration: ModuleManifestRegistrationSchema.optional(),\n /**\n * Free-form key/value bag for non-load-bearing metadata\n * (homepage, license, repository). Phase 1 keeps it open;\n * Phase 6 may tighten it for `wildo registry publish` UX.\n */\n meta: z.record(z.string().min(1), z.unknown()).optional(),\n}).catchall(z.unknown()).superRefine((manifest, context) => {\n const providerBoundaries = manifest.boundaries?.providers ?? [];\n if (manifest.kind !== ModuleKind.PROVIDER) {\n if (manifest.provider !== undefined) {\n context.addIssue({ code: 'custom', path: ['provider'], message: 'only a module of kind `provider` carries a provider block' });\n }\n if (providerBoundaries.length > 0) {\n context.addIssue({ code: 'custom', path: ['boundaries', 'providers'], message: 'only a module of kind `provider` writes below `providers/`' });\n }\n return;\n }\n if (manifest.provider === undefined) {\n context.addIssue({ code: 'custom', path: ['provider'], message: 'a module of kind `provider` carries a provider block' });\n return;\n }\n // A provider's owners are the INSTALLING application's, so the installer derives its wiring (#2014). A manifest\n // that carried one would be telling an installer which of its files to edit.\n if (manifest.registration !== undefined) {\n context.addIssue({ code: 'custom', path: ['registration'], message: 'a provider module carries no registration: each installing application derives its own wiring' });\n }\n // A provider module IS one package directory: exactly `providers/<ref>`, and nothing in any other layer,\n // so installing it can never write into the application's own modules, minions or workers.\n const expected = `${MODULE_BOUNDARY_LAYER_ROOTS.providers}/${manifest.provider.ref}`;\n if (providerBoundaries.length !== 1 || providerBoundaries[0] !== expected) {\n context.addIssue({\n code: 'custom',\n path: ['boundaries', 'providers'],\n message: `a provider module's boundaries are exactly [\\`${expected}\\`] (found ${JSON.stringify(providerBoundaries)})`,\n });\n }\n const otherLayers = MODULE_BOUNDARY_LAYERS.filter((layer) => layer !== 'providers' && (manifest.boundaries?.[layer] ?? []).length > 0);\n if (otherLayers.length > 0) {\n context.addIssue({\n code: 'custom',\n path: ['boundaries'],\n message: `a provider module writes only below \\`providers/\\`, but it also declares ${otherLayers.join(', ')}`,\n });\n }\n});\nexport type ModuleManifest = z.infer<typeof ModuleManifestSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"module-manifest.schemas.js","sourceRoot":"","sources":["../../../src/registry/module-manifest.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,iCAAiC,EAAE,YAAY,EAAE,8BAA8B,EAAyB,MAAM,uBAAuB,CAAC;AAEhK;;;;;GAKG;AACH,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAC7B,qLAAqL,CAAC;AACxL,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,MAAM,EAAE;KACR,KAAK,CAAC,kBAAkB,EAAE,gEAAgE,CAAC;KAC3F,QAAQ,CAAC,sBAAsB,CAAC,CAAC;AACpC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;AAG/F;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC,YAAY,CAAC;IAChE,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAClE,gBAAgB,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC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C;IACzK,CAAC;IACD,yGAAyG;IACzG,2FAA2F;IAC3F,MAAM,QAAQ,GAAG,GAAG,2BAA2B,CAAC,SAAS,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;IACrF,IAAI,kBAAkB,CAAC,MAAM,KAAK,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC1E,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,YAAY,EAAE,WAAW,CAAC;YACjC,OAAO,EAAE,iDAAiD,QAAQ,cAAc,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,GAAG;SACtH,CAAC,CAAC;IACL,CAAC;IACD,MAAM,WAAW,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,WAAW,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACvI,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,YAAY,CAAC;YACpB,OAAO,EAAE,4EAA4E,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;SAC9G,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC","sourcesContent":["/**\n * Module manifest schema — `wildo.module.json` shipped inside every\n * registry artifact.\n *\n * Phase 1 fleshes out the dependency / boundary contract that Phase\n * 5+ install/update/remove flows need. The manifest is the single\n * cross-package contract every registry client signs against; new\n * fields require a plan amendment.\n *\n * Authoritative references (keep these in sync with edits below):\n * - KD-12 — modules cannot claim arbitrary top-level app ownership;\n * `boundaries` declares which app surfaces the artifact may write.\n * - KD-13 — npm + module + capability dependencies are explicit.\n * - KD-19 — runtime packages produced from installed module content\n * must NOT import `platform-config-lib`; this is enforced\n * downstream by Phase 5+ verification, not the manifest itself.\n */\n\nimport { z } from 'zod';\nimport { AppFrontendType, ProviderCatalogueProvenanceSchema, ProviderTier, engineSlotsBoundByCapabilities, type EngineCapability } from '@wildo-ai/saas-models';\n\n/**\n * Authoring shape for a nonempty version constraint. Registry release selectors\n * can resolve tags; manifest module/framework requirements instead use npm\n * semver ranges and are validated against the receiving application's recorded\n * module versions and installed framework packages before source adoption.\n */\nconst SemverRange = z.string().min(1).describe('npm-style semver range');\n\n/**\n * Exact `MAJOR.MINOR.PATCH[-prerelease][+build]` semver. The regex\n * mirrors the official semver.org grammar, so manifest authors\n * cannot publish version `^1.2.3` or `latest` and have install\n * silently treat it as concrete.\n */\nexport const SEMVER_EXACT_REGEX =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\nexport const SemverExactSchema = z\n .string()\n .regex(SEMVER_EXACT_REGEX, 'Expected exact semver `MAJOR.MINOR.PATCH` (no ranges, no tags)')\n .describe('Exact semver version');\nconst SemverExact = SemverExactSchema;\n\n/**\n * `dependsOn.modules.<moduleId>` — other Wildo modules that this\n * module requires. Install hard-fails by default if any required\n * module is missing (KD-13). Range resolution mirrors npm semver\n * semantics.\n */\nexport const ModuleManifestModuleDependenciesSchema = z.record(z.string().min(1), SemverRange);\nexport type ModuleManifestModuleDependencies = z.infer<typeof ModuleManifestModuleDependenciesSchema>;\n\n/**\n * `dependsOn.npm.dependencies` / `peerDependencies` — npm packages\n * the installed module imports at runtime. Install surfaces these\n * to the operator but does not edit `package.json` automatically\n * or install dependencies. The operator chooses the consuming package (KD-13).\n */\nexport const ModuleManifestNpmDependenciesSchema = z.strictObject({\n dependencies: z.record(z.string().min(1), SemverRange).default({}),\n peerDependencies: z.record(z.string().min(1), SemverRange).default({}),\n});\nexport type ModuleManifestNpmDependencies = z.infer<typeof ModuleManifestNpmDependenciesSchema>;\n\n/**\n * `dependsOn.capabilities` — required EngineCapability names. Adoption validates\n * each name against the canonical enum and requires enabled:true in the host's\n * authored engineCapabilities. This proves declared activation, not provider\n * health. Strings remain the artifact format; the CLI performs host comparison.\n */\nexport const ModuleManifestCapabilityDependenciesSchema = z.array(z.string().min(1));\nexport type ModuleManifestCapabilityDependencies = z.infer<typeof ModuleManifestCapabilityDependenciesSchema>;\n\nexport const ModuleManifestDependenciesSchema = z.strictObject({\n modules: ModuleManifestModuleDependenciesSchema.default({}),\n npm: ModuleManifestNpmDependenciesSchema.default({\n dependencies: {},\n peerDependencies: {},\n }),\n capabilities: ModuleManifestCapabilityDependenciesSchema.default([]),\n});\nexport type ModuleManifestDependencies = z.infer<typeof ModuleManifestDependenciesSchema>;\n\n/**\n * Engine compatibility — the framework version range this module\n * targets. Install hard-fails by default if the host app's framework\n * version is outside the range. Every installed saas-models copy reached from\n * application workspace framework dependencies must satisfy it; desired pins\n * and the running CLI version are not installed application evidence.\n */\nexport const ModuleManifestEngineSchema = z.strictObject({\n framework: SemverRange,\n});\nexport type ModuleManifestEngine = z.infer<typeof ModuleManifestEngineSchema>;\n\n/**\n * One registry NAME segment — a domain slug, or either half of a module id. Lowercase ASCII letters,\n * digits, `.`, `_`, `-`, not starting with `.`, `_` or `-` (npm's package-name alphabet).\n *\n * These names are not only identifiers: the CLI builds filesystem paths from them\n * (`.wildo-saas/generated/modules-artifacts/<domain>/<scope>/<name>/…`) and runs a RECURSIVE delete\n * on those paths to wipe a stale staging or extraction tree. Until 2026-09-25 the only rule on a\n * module id was \"contains a `/`\", so a manifest `id` of `a/../../../..` made `wildo registry publish`\n * resolve its staging root to the application root and delete it. The rule is total over both\n * places a name is authored: a module's manifest, and a domain created on the registry server.\n */\nconst REGISTRY_NAME_SEGMENT_REGEX = /^[a-z0-9][a-z0-9._-]*$/;\nconst REGISTRY_NAME_SEGMENT_MAX_LENGTH = 64;\n\nfunction isRegistryNameSegment(segment: string): boolean {\n return segment.length <= REGISTRY_NAME_SEGMENT_MAX_LENGTH && REGISTRY_NAME_SEGMENT_REGEX.test(segment);\n}\n\n/** A registry domain slug (`acme`, `internal`) — one {@link isRegistryNameSegment} segment. */\nexport const RegistryDomainSlugSchema = z.string().refine(isRegistryNameSegment, {\n error: 'a registry domain must be lowercase letters, digits, `.`, `_` or `-`, starting with a letter or digit (max 64)',\n});\n\n/** Whether `moduleId` is a well-formed `<scope>/<name>` module id. */\nexport function isModuleId(moduleId: string): boolean {\n const segments = moduleId.split('/');\n return segments.length === 2 && segments.every(isRegistryNameSegment);\n}\n\n/**\n * A module id: exactly `<scope>/<name>` (e.g. `acme/billing`), each half a registry name segment.\n * The id is also the lockfile key, the registry URL segment, and — through the CLI — a directory\n * path, so its shape is the path-safety rule, not a style preference.\n */\nexport const ModuleIdSchema = z.string().refine(isModuleId, {\n error: 'a module id must be `<scope>/<name>` (e.g. `acme/billing`), each half lowercase letters, digits, `.`, `_` or `-`',\n});\n\n/**\n * Where each layer's MODULE directories live in a Wildo SaaS application, relative to its root.\n *\n * Derived from the scaffold, not invented: the `add-module` scenario creates a module's directories\n * under `shared-lib/src/modules/<id>`, `specifications/src/modules/<id>`, `frontend/src/modules/<id>`\n * and `backend-api/src/modules/<id>`; `add-minion` and `add-worker-node` create a package directory\n * under `minions/<dir>` and `workers/<dir>`.\n *\n * A registry module may write only BELOW one of these roots, in a directory it names. That is the\n * whole of KD-12, stated positively. Until 2026-09-25 the boundary rule refused only absolute paths\n * and `..` segments, so `.`, `.git/hooks`, `.wildo-saas` and `wildo.saas.config.ts` were all valid\n * boundaries: a published module could overwrite the host's configuration or plant a git hook, and\n * `wildo registry publish` would ship the author's `.env` and `secrets.json`.\n */\nexport const MODULE_BOUNDARY_LAYER_ROOTS = {\n specifications: 'specifications/src/modules',\n shared: 'shared-lib/src/modules',\n frontend: 'frontend/src/modules',\n backend: 'backend-api/src/modules',\n minions: 'minions',\n workers: 'workers',\n /**\n * A PROVIDER module's directory, `providers/<ref>` (#2014), holding one workspace package per facet\n * (`providers/<ref>/backend`, `providers/<ref>/frontend`). Like a minion or a worker, each facet is its\n * own package, so the root is a top-level directory rather than a layer's `src/modules`: the facet's own\n * `package.json` is where its vendor SDK dependency lives, and a runtime depends only on the facet it runs.\n */\n providers: 'providers',\n} as const;\nexport type ModuleBoundaryLayer = keyof typeof MODULE_BOUNDARY_LAYER_ROOTS;\n\n/** Every boundary layer, in the canonical order of {@link MODULE_BOUNDARY_LAYER_ROOTS}. */\nexport const MODULE_BOUNDARY_LAYERS = Object.keys(MODULE_BOUNDARY_LAYER_ROOTS) as ModuleBoundaryLayer[];\n\n/**\n * Directory names a module artifact may never contain, at any depth: dependency installs are the\n * consumer's to produce, never the publisher's to ship.\n */\nconst MODULE_ARTIFACT_FORBIDDEN_SEGMENTS: ReadonlySet<string> = new Set(['node_modules']);\n\n/**\n * Whether one `/`-separated path segment may appear in a module boundary or a module artifact.\n *\n * A DOT-prefixed segment is refused outright. That single rule removes `.git` (hooks run code on the\n * next commit), `.env` (a minion or worker package carries its generated secrets there),\n * `.wildo-saas` (the companion and machine-local state) and `..` / `.` (traversal and \"the whole\n * root\"). npm applies the same default for the same reason: `.git` and the like never enter a\n * published package.\n */\nfunction isAllowedModulePathSegment(segment: string): boolean {\n return segment.length > 0 && !segment.startsWith('.') && !MODULE_ARTIFACT_FORBIDDEN_SEGMENTS.has(segment);\n}\n\n/**\n * Whether `appRelativePath` (POSIX separators, relative to the application root) may be carried by a\n * module artifact. Used on BOTH sides of the registry so they cannot disagree:\n *\n * - `wildo registry publish` skips a file that fails it, so a secret beside the module's source is\n * never packed;\n * - `wildo registry add` / `update` / `repair` refuse an artifact containing one, before writing\n * anything — a correctly published artifact cannot contain it, so its presence means the bytes\n * did not come from `publish`.\n */\nexport function isModuleArtifactPathAllowed(appRelativePath: string): boolean {\n if (appRelativePath.includes('\\\\') || appRelativePath.startsWith('/')) return false;\n return appRelativePath.split('/').every(isAllowedModulePathSegment);\n}\n\n/**\n * Whether `appRelativePath` is a file a registry module can OWN in an application: a path a module\n * artifact may carry ({@link isModuleArtifactPathAllowed}) that also sits strictly below one of the\n * layer roots ({@link MODULE_BOUNDARY_LAYER_ROOTS}) — because an install only ever writes inside a\n * boundary, and every boundary lives there.\n *\n * This is the rule for a path RECORDED as installed (`sections.modules.installed[*].files`), which\n * `remove` and `update` delete. `isModuleArtifactPathAllowed` alone would let a hand-edited or badly\n * merged entry name `wildo.saas.config.ts` or `backend-api/src/index.ts`, and removing the module would\n * then delete the application's own file.\n */\nexport function isModuleOwnedFilePath(appRelativePath: string): boolean {\n return isModuleArtifactPathAllowed(appRelativePath)\n && Object.values(MODULE_BOUNDARY_LAYER_ROOTS).some((root) => appRelativePath.startsWith(`${root}/`));\n}\n\n/**\n * One layer's `boundaries` entries: each a directory strictly BELOW that layer's root\n * ({@link MODULE_BOUNDARY_LAYER_ROOTS}), written with POSIX separators, every segment allowed by\n * {@link isModuleArtifactPathAllowed}. Validated at parse time, so the registry server refuses a\n * manifest declaring a wider boundary at publish and the CLI refuses one at install.\n */\nfunction moduleLayerBoundariesSchema(layer: ModuleBoundaryLayer) {\n const root = MODULE_BOUNDARY_LAYER_ROOTS[layer];\n return z.array(\n z.string().min(1).refine(\n (entry) => isModuleArtifactPathAllowed(entry) && entry.startsWith(`${root}/`) && entry.length > root.length + 1,\n {\n error:\n `boundaries.${layer} entries must name a directory below \\`${root}/\\` (e.g. \\`${root}/acme-billing\\`), ` +\n 'with `/` separators and no segment that starts with `.` or is `node_modules`',\n },\n ),\n ).default([]);\n}\n\n/**\n * `boundaries` — the per-layer surface the module is allowed to write into the host app source\n * (KD-12). Each layer is optional; modules typically declare only the layers they actually contain\n * (a backend-only module declares `backend` + `shared` and omits `frontend` / `specifications`).\n */\nexport const ModuleManifestBoundariesSchema = z.strictObject({\n specifications: moduleLayerBoundariesSchema('specifications'),\n shared: moduleLayerBoundariesSchema('shared'),\n frontend: moduleLayerBoundariesSchema('frontend'),\n backend: moduleLayerBoundariesSchema('backend'),\n minions: moduleLayerBoundariesSchema('minions'),\n workers: moduleLayerBoundariesSchema('workers'),\n providers: moduleLayerBoundariesSchema('providers'),\n});\nexport type ModuleManifestBoundaries = z.infer<typeof ModuleManifestBoundariesSchema>;\n\n/**\n * The boundaries schema declares every layer of {@link MODULE_BOUNDARY_LAYER_ROOTS} and nothing else: a\n * root added without its boundaries key (or the reverse) fails to compile here.\n */\nexport const BOUNDARIES_SCHEMA_COVERS_EVERY_LAYER: [keyof ModuleManifestBoundaries] extends [ModuleBoundaryLayer]\n ? [ModuleBoundaryLayer] extends [keyof ModuleManifestBoundaries] ? true : never\n : never = true;\n\n/**\n * Every boundary directory a manifest declares, across ALL layers, in canonical layer order.\n *\n * The one place a consumer turns `boundaries` into a list. Three consumers (the packager, `publish`, the\n * install fan-out) each used to spell the six layers out by hand, so a seventh layer — `providers`,\n * #2014 — would have been silently skipped by all three: an artifact that packs nothing, an install that\n * copies nothing, and a publish that reports success. Iterating the roots makes the next layer impossible\n * to forget.\n */\nexport function flattenModuleBoundaries(boundaries: ModuleManifestBoundaries | undefined): string[] {\n if (!boundaries) return [];\n return MODULE_BOUNDARY_LAYERS.flatMap((layer) => boundaries[layer] ?? []);\n}\n\n/**\n * How an installed module is REGISTERED in the host application — the composition scenario whose\n * registry edits make it a module the application knows about (#1755, #1773).\n *\n * Installing copies a module's files; registering it adds it to what the application declares. Without\n * registration the backend discovers `backend-api/src/modules/<dir>` by directory scan while every other\n * layer ignores the module, and a minion or worker is never declared at all, so it never runs.\n *\n * Each member is the framework scenario that IS the declaration of how that shape is registered, so\n * installation replays its edit steps rather than keeping a second copy of them:\n */\nexport enum ModuleRegistrationScenario {\n /** A domain module — its shared, specifications and frontend registries and `applicationModules`. */\n ADD_MODULE = 'add-module',\n /** A minion — `applicationMinions`, its provider scope, and the pnpm workspace member. */\n ADD_MINION = 'add-minion',\n /** A worker node — `applicationWorkers`, its provider scope, and the pnpm workspace member. */\n ADD_WORKER_NODE = 'add-worker-node',\n /**\n * A provider module (#2014): the pnpm workspace member, each facet package as a `workspace:*` dependency of the\n * runtimes that own that facet, and the provider's scope in each. Unlike the three above it is never carried by a\n * MANIFEST: the owners are the INSTALLING application's, so the installer derives the wiring and only its lockfile\n * records it ({@link ProviderWiringSchema}).\n */\n ADD_PROVIDER_PACKAGE = 'add-provider-package',\n}\n\n/**\n * An application-relative service directory as `wildo.saas.config.ts` declares it (`./backend-api`, `frontend`).\n * Restricted to plain path segments, with no `..`, because a wiring names files the installer and `remove` edit.\n */\nconst WIRED_SERVICE_PATH_PATTERN = /^(\\.\\/)?(?!\\.\\.?(\\/|$))[A-Za-z0-9_-][A-Za-z0-9._-]*(\\/(?!\\.\\.?(\\/|$))[A-Za-z0-9_-][A-Za-z0-9._-]*)*$/;\n\n/** A scoped provider facet package name: `@<scope>/provider-<ref>` or `@<scope>/provider-<ref>-frontend`. */\nconst PROVIDER_FACET_PACKAGE_NAME_PATTERN = /^@[a-z0-9][a-z0-9._-]*\\/provider-[a-z][a-z0-9-]*$/;\n\n/** One runtime a provider facet was wired into: its key in `services`, and its directory. */\nexport const ProviderWiringOwnerSchema = z.strictObject({\n serviceKey: z.string().regex(/^[A-Za-z][A-Za-z0-9_-]*$/),\n path: z.string().regex(WIRED_SERVICE_PATH_PATTERN),\n});\nexport type ProviderWiringOwner = z.infer<typeof ProviderWiringOwnerSchema>;\n\n/**\n * What an `add-provider-package` install wired, as the INSTALLER derived it from its own application (#2014):\n * - `backendOwners`: the backend services that depend on the backend facet and scope the provider;\n * - `frontendOwners`: the frontend services, of a type in the facet's `surfaces`, that depend on the browser facet\n * and scope the provider.\n *\n * Recorded so `remove` reverses exactly what install wrote, even after the application's services change.\n */\nexport const ProviderWiringSchema = z.strictObject({\n /** The backend facet's package name as installed (`@<scope>/provider-<ref>`); absent without a backend facet. */\n backendPackage: z.string().regex(PROVIDER_FACET_PACKAGE_NAME_PATTERN).optional(),\n backendOwners: z.array(ProviderWiringOwnerSchema),\n /** The browser facet's package name as installed; absent without a frontend facet. */\n frontendPackage: z.string().regex(PROVIDER_FACET_PACKAGE_NAME_PATTERN).optional(),\n frontendOwners: z.array(ProviderWiringOwnerSchema),\n});\nexport type ProviderWiring = z.infer<typeof ProviderWiringSchema>;\n\n/**\n * The four layers of a domain module, named as its manifest boundaries name them. A domain-module\n * registration may cover a SUBSET (#1773): a backend+shared module registers its shared entries and an\n * `applicationModules` entry bound to the backend only.\n */\nexport enum DomainModuleLayer {\n SHARED = 'shared',\n SPECIFICATIONS = 'specifications',\n FRONTEND = 'frontend',\n BACKEND = 'backend',\n}\n\n/**\n * Every domain layer is a boundary layer, spelled the same (#1773 review): the enum restates four keys of\n * `MODULE_BOUNDARY_LAYER_ROOTS`, so a member added or renamed on one side alone fails to compile here.\n */\nexport const DOMAIN_LAYERS_ARE_BOUNDARY_LAYERS: `${DomainModuleLayer}` extends ModuleBoundaryLayer ? true : never = true;\n\n/** Canonical order, so one set of layers has one spelling. */\nexport const DOMAIN_MODULE_LAYERS: readonly DomainModuleLayer[] = [\n DomainModuleLayer.SHARED,\n DomainModuleLayer.SPECIFICATIONS,\n DomainModuleLayer.FRONTEND,\n DomainModuleLayer.BACKEND,\n];\n\n/**\n * The scenarios' variable patterns for the directory and camelCase stem their REGISTRY edits use\n * (`moduleId`/`moduleCamel`, `minionDir`/`minionCamel`, `workerDir`/`workerCamel` share them). Mirrored\n * here because the manifest is validated where no scenario is loaded (the registry server); a test pins\n * them equal to the scenarios' own declarations.\n */\nexport const MODULE_REGISTRATION_MODULE_ID_PATTERN = /^[a-z][a-z0-9-]*$/;\nexport const MODULE_REGISTRATION_MODULE_CAMEL_PATTERN = /^[a-z][A-Za-z0-9]*$/;\n\n/**\n * A module's registration: the scenario plus the ONLY values its registry edits read. It carries no\n * code — the installer renders the scenario's own edit steps with these values, both restricted to\n * identifier alphabets (and anything else a scenario needs is DERIVED by the installer, never read from\n * the manifest) — so a manifest cannot smuggle text into the host's files. Derived by\n * `wildo registry publish` from the publishing application (every edit already present), never authored.\n */\nexport const ModuleManifestRegistrationSchema = z\n .strictObject({\n scenario: z.enum(ModuleRegistrationScenario),\n /** The module's directory under its scenario's root: each layer's modules root, `minions/` or `workers/` (kebab-case). */\n moduleId: z.string().regex(MODULE_REGISTRATION_MODULE_ID_PATTERN),\n /** The camelCase stem the scenario's entries are named from (`<stem>Module`, the minion/worker bucket key). */\n moduleCamel: z.string().regex(MODULE_REGISTRATION_MODULE_CAMEL_PATTERN),\n /**\n * `add-module` only: the layers the module covers, when it is NOT all four (absent = the whole module,\n * so one module has one spelling). Must include `backend` or `frontend`: an `applicationModules` entry\n * binds the module to at least one service.\n */\n layers: z.array(z.enum(DomainModuleLayer)).min(1).optional(),\n /** `add-provider-package` only, and required there: what the installer wired. */\n providerWiring: ProviderWiringSchema.optional(),\n })\n .superRefine((registration, context) => {\n const isProviderWiring = registration.scenario === ModuleRegistrationScenario.ADD_PROVIDER_PACKAGE;\n if (isProviderWiring !== (registration.providerWiring !== undefined)) {\n context.addIssue({ code: 'custom', path: ['providerWiring'], message: 'an add-provider-package registration carries its wiring, and no other registration does' });\n }\n const layers = registration.layers;\n if (layers === undefined) return;\n if (registration.scenario !== ModuleRegistrationScenario.ADD_MODULE) {\n context.addIssue({ code: 'custom', path: ['layers'], message: 'only an add-module registration covers layers' });\n return;\n }\n const canonical = DOMAIN_MODULE_LAYERS.filter((layer) => layers.includes(layer));\n if (canonical.length !== layers.length || canonical.some((layer, index) => layer !== layers[index])) {\n context.addIssue({ code: 'custom', path: ['layers'], message: `layers must be distinct and in canonical order (${DOMAIN_MODULE_LAYERS.join(', ')})` });\n }\n if (canonical.length === DOMAIN_MODULE_LAYERS.length) {\n context.addIssue({ code: 'custom', path: ['layers'], message: 'a whole module omits `layers`' });\n }\n if (!layers.includes(DomainModuleLayer.BACKEND) && !layers.includes(DomainModuleLayer.FRONTEND)) {\n context.addIssue({ code: 'custom', path: ['layers'], message: 'a registered module must include the backend or the frontend layer' });\n }\n });\nexport type ModuleManifestRegistration = z.infer<typeof ModuleManifestRegistrationSchema>;\n\n/**\n * What a registry module IS: the one discriminator every consumer branches on (#2014).\n *\n * The registry was built to carry application FEATURES. On 2026-09-29 Paul decided it also carries\n * PROVIDERS, distributed shadcn-style: a provider's source is copied into the application, which owns it\n * from then on. The Activepieces/Sim-generated catalogue that used to hold providers is archived (#2012).\n * The two kinds differ in what they may contain and in how they are registered, so the difference is\n * named rather than inferred from which boundaries happen to be present.\n */\nexport enum ModuleKind {\n /**\n * An application feature: domain module layers, a minion or a worker. Every module published before\n * #2014 is one, which is why a manifest that omits `kind` reads as FEATURE.\n */\n FEATURE = 'feature',\n /**\n * One vendor's integration, installed at `providers/<ref>/` with ONE workspace package per facet\n * ({@link ProviderModuleFacet}): each carries its own SDK dependencies in its own `package.json`, and\n * each runtime depends only on the facet it runs. It may fill an engine capability when its tier is\n * EXTENSION.\n *\n * What a provider module never is:\n * - system-of-record facets: a separate lane, delivered by `@wildo-ai/systems-of-record` (#2013);\n * - an INFRASTRUCTURE provider (object storage, databases, brokers, scanners): those are executed by the\n * PLATFORM (apps-manager) with platform administrator credentials, so application-owned code must never\n * be one. They stay in the platform's own package, selected by the application's declaration (#1692).\n */\n PROVIDER = 'provider',\n}\n\n/**\n * The runtime facets a provider module can ship, each as its own workspace package under\n * `providers/<ref>/<facet>/` (Paul, 2026-09-29).\n *\n * One package per facet, as the engine itself separates `external-connectors-private` (backend) from\n * `external-connectors-public` (browser):\n * - a Node SDK never reaches a frontend install, and a browser SDK never reaches a backend's;\n * - each runtime owner depends on exactly the facet it runs, so imports stay unambiguous;\n * - the browser facet cannot reach backend code unless its own manifest declares that dependency, which\n * publish refuses. Isolation is a property of the dependency graph, not of scanning import statements.\n *\n * There is deliberately no INFRASTRUCTURE member: see {@link ModuleKind.PROVIDER}.\n */\nexport enum ProviderModuleFacet {\n /** Loaded by the application backend, the companion and minions. Workers load no providers. */\n BACKEND = 'backend',\n /** Loaded by the frontend services whose type is listed in its `surfaces`. */\n FRONTEND = 'frontend',\n}\n\n/**\n * How far a published provider has been taken since it was adopted (#2012).\n *\n * There is deliberately no SEEDED member: a seed (a catalogue transposition in the archive) is never\n * published, so the registry only ever holds providers someone adopted.\n */\nexport enum ProviderModuleMaturity {\n /** Copied from a seed or written by hand, reviewed, and owned by Wildo. Not yet met the real vendor. */\n ADOPTED = 'adopted',\n /** Has executed against the real vendor it names, with the proof recorded on the tracker. */\n PROVEN = 'proven',\n}\n\n/**\n * The tiers a PROVIDER module may declare. MAIN is the engine's own set: its origin is always ENGINE,\n * and the tier rule (`provider-tier-rule.shared.utils.ts`) refuses MAIN from anywhere else.\n */\nconst PROVIDER_MODULE_TIERS = [ProviderTier.CATALOGUE, ProviderTier.EXTENSION] as const;\n\n/**\n * The `provider` block of a PROVIDER module: what the registry must know about the provider WITHOUT\n * executing its code, which is what server-side search and listing need.\n *\n * Deliberately NOT carried here, so there is one source for each fact:\n * - the ENGINE capabilities it fills: derived from `providerCapabilities` through the same closed map the\n * engine uses (`engineSlotsBoundByCapabilities`);\n * - the compliance profile, secrets contract, operations and auth: they live in the module's code\n * (`BackendProviderModule`), which discovery already reads. Publish checks that this block agrees\n * with that code (#2014).\n *\n * Fields for per-provider skills, OpenAPI binding and change monitoring are added by the issues that\n * read them (#2026, #2028, #2027), not before.\n */\nexport const ModuleManifestProviderSchema = z\n .strictObject({\n /**\n * The provider ref: the application's scope key, the directory under `providers/`, and the suffix of\n * the package name. One kebab-case segment, the same alphabet as a registration directory.\n */\n ref: z.string().regex(MODULE_REGISTRATION_MODULE_ID_PATTERN),\n /** The vendor's identity, shared by every ref of one vendor. Defaults to the ref, as provider metadata does. */\n vendor: z.string().regex(MODULE_REGISTRATION_MODULE_ID_PATTERN).optional(),\n /** CATALOGUE (operations only) or EXTENSION (fills an engine capability). */\n tier: z.enum(PROVIDER_MODULE_TIERS),\n /** The provider capability tokens the module declares, as its `BackendProviderModule` does. */\n providerCapabilities: z.array(z.string().min(1)).default([]),\n /**\n * The facets the module ships, each a package at `providers/<ref>/<facet>/`. At least one.\n * Keys are {@link ProviderModuleFacet} members.\n */\n facets: z.strictObject({\n [ProviderModuleFacet.BACKEND]: z.strictObject({}).optional(),\n [ProviderModuleFacet.FRONTEND]: z\n .strictObject({\n /**\n * Which frontend surfaces the browser facet serves: the application, the public website, the\n * documentation site. Installation adds the facet's package only to frontend services of these\n * types. The engine composes a separate provider registry per surface, which is why it is named.\n */\n surfaces: z.array(z.enum(AppFrontendType)).min(1),\n })\n .optional(),\n }),\n maturity: z.enum(ProviderModuleMaturity),\n /** Where the adopted source came from, when it came from a catalogue seed. */\n seed: ProviderCatalogueProvenanceSchema.optional(),\n })\n .superRefine((provider, context) => {\n if (providerModuleFacets(provider).length === 0) {\n context.addIssue({ code: 'custom', path: ['facets'], message: 'a provider module ships a backend facet, a frontend facet, or both' });\n }\n const surfaces = provider.facets[ProviderModuleFacet.FRONTEND]?.surfaces ?? [];\n if (new Set(surfaces).size !== surfaces.length) {\n context.addIssue({ code: 'custom', path: ['facets', ProviderModuleFacet.FRONTEND, 'surfaces'], message: 'each frontend surface is listed once' });\n }\n const boundSlots = engineSlotsBoundByCapabilities(provider.providerCapabilities);\n if (provider.tier === ProviderTier.CATALOGUE && boundSlots.length > 0) {\n context.addIssue({\n code: 'custom',\n path: ['providerCapabilities'],\n message:\n `tier CATALOGUE may claim only open capability tokens, but ${boundSlots.map((entry) => `\"${entry.capability}\" binds the ${entry.slot} engine slot`).join(', ')}. `\n + 'Declare EXTENSION to fill an engine capability.',\n });\n }\n if (provider.tier === ProviderTier.EXTENSION && boundSlots.length === 0) {\n context.addIssue({\n code: 'custom',\n path: ['providerCapabilities'],\n message: 'tier EXTENSION fills an engine capability, so at least one provider capability must bind an engine slot',\n });\n }\n });\nexport type ModuleManifestProvider = z.infer<typeof ModuleManifestProviderSchema>;\n\n/**\n * The facets a provider module ships, in canonical enum order, and the package directory of each.\n * Install, publish and registration all read these rather than re-deriving the layout.\n */\nexport function providerModuleFacets(provider: Pick<ModuleManifestProvider, 'facets'>): ProviderModuleFacet[] {\n return Object.values(ProviderModuleFacet).filter((facet) => provider.facets[facet] !== undefined);\n}\n\n/** `providers/<ref>/<facet>`: where one facet's workspace package lives. */\nexport function providerModuleFacetDirectory(ref: string, facet: ProviderModuleFacet): string {\n return `${MODULE_BOUNDARY_LAYER_ROOTS.providers}/${ref}/${facet}`;\n}\n\n/** The engine capabilities a provider module fills, derived rather than declared. */\nexport function engineCapabilitiesFilledByProviderModule(provider: ModuleManifestProvider): EngineCapability[] {\n return [...new Set(engineSlotsBoundByCapabilities(provider.providerCapabilities).map((entry) => entry.slot))];\n}\n\n/** The file a module's manifest lives in: at the root of every artifact, of a checkout module, and of a publishing application. */\nexport const MODULE_MANIFEST_FILE_NAME = 'wildo.module.json';\n\n/**\n * Top-level manifest. Stored at `wildo.module.json` inside every\n * artifact zip and at the registry server alongside its version row.\n *\n * `id` semantics: `<scope>/<name>` (e.g. `acme/billing`), separate\n * from the registry domain (e.g. `internal`). The id is reused as the lockfile entry key\n * (`sections.modules.installed[<id>]`).\n */\nexport const ModuleManifestSchema = z.object({\n id: ModuleIdSchema,\n version: SemverExact,\n /** What the module is. Absent reads as FEATURE: every module published before #2014 is one. */\n kind: z.enum(ModuleKind).default(ModuleKind.FEATURE),\n /** Present exactly when `kind` is PROVIDER. */\n provider: ModuleManifestProviderSchema.optional(),\n description: z.string().optional(),\n /** Free-form description of what the module ships, for `wildo registry info`. */\n longDescription: z.string().optional(),\n engine: ModuleManifestEngineSchema.optional(),\n boundaries: ModuleManifestBoundariesSchema.optional(),\n dependsOn: ModuleManifestDependenciesSchema.optional(),\n /** How the module is registered in a host application — see {@link ModuleManifestRegistrationSchema}. */\n registration: ModuleManifestRegistrationSchema.optional(),\n /**\n * Free-form key/value bag for non-load-bearing metadata\n * (homepage, license, repository). Phase 1 keeps it open;\n * Phase 6 may tighten it for `wildo registry publish` UX.\n */\n meta: z.record(z.string().min(1), z.unknown()).optional(),\n}).catchall(z.unknown()).superRefine((manifest, context) => {\n const providerBoundaries = manifest.boundaries?.providers ?? [];\n if (manifest.kind !== ModuleKind.PROVIDER) {\n if (manifest.provider !== undefined) {\n context.addIssue({ code: 'custom', path: ['provider'], message: 'only a module of kind `provider` carries a provider block' });\n }\n if (providerBoundaries.length > 0) {\n context.addIssue({ code: 'custom', path: ['boundaries', 'providers'], message: 'only a module of kind `provider` writes below `providers/`' });\n }\n return;\n }\n if (manifest.provider === undefined) {\n context.addIssue({ code: 'custom', path: ['provider'], message: 'a module of kind `provider` carries a provider block' });\n return;\n }\n // A provider's owners are the INSTALLING application's, so the installer derives its wiring (#2014). A manifest\n // that carried one would be telling an installer which of its files to edit.\n if (manifest.registration !== undefined) {\n context.addIssue({ code: 'custom', path: ['registration'], message: 'a provider module carries no registration: each installing application derives its own wiring' });\n }\n // A provider module IS one package directory: exactly `providers/<ref>`, and nothing in any other layer,\n // so installing it can never write into the application's own modules, minions or workers.\n const expected = `${MODULE_BOUNDARY_LAYER_ROOTS.providers}/${manifest.provider.ref}`;\n if (providerBoundaries.length !== 1 || providerBoundaries[0] !== expected) {\n context.addIssue({\n code: 'custom',\n path: ['boundaries', 'providers'],\n message: `a provider module's boundaries are exactly [\\`${expected}\\`] (found ${JSON.stringify(providerBoundaries)})`,\n });\n }\n const otherLayers = MODULE_BOUNDARY_LAYERS.filter((layer) => layer !== 'providers' && (manifest.boundaries?.[layer] ?? []).length > 0);\n if (otherLayers.length > 0) {\n context.addIssue({\n code: 'custom',\n path: ['boundaries'],\n message: `a provider module writes only below \\`providers/\\`, but it also declares ${otherLayers.join(', ')}`,\n });\n }\n});\nexport type ModuleManifest = z.infer<typeof ModuleManifestSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-search.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"module-search.schemas.d.ts","sourceRoot":"","sources":["../../../src/registry/module-search.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACL,UAAU,EACV,sBAAsB,EAEtB,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;;kBAInC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,wHAAwH;AACxH,eAAO,MAAM,yBAAyB,mDAAoG,CAAC;AAE3I,oDAAoD;AACpD,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAS/G;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,kBAAkB,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAEhG;AAID;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,6BAA6B;;;;iBAIxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;iBAMhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,UAAU,CAAC,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAQjI;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB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AA6E;AAC7E,MAAM,UAAU,oBAAoB,CAAC,QAAwB;IAC3D,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,UAAU,CAAC,OAAO,CAAC;IACjD,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;IACnC,OAAO;QACL,IAAI;QACJ,GAAG,CAAC,IAAI,KAAK,UAAU,CAAC,QAAQ,IAAI,QAAQ,KAAK,SAAS;YACxD,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,EAAE,wCAAwC,CAAC,QAAQ,CAAC,EAAE,EAAE;YAC1I,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC","sourcesContent":["/**\n * What a registry search may filter on, and what a hit says about the module (#2014, epic #2012).\n *\n * Once providers are distributed through the registry, \"find me a module\" becomes \"find me a provider that fills\n * this engine capability\". The three filters are the manifest's own axes: its KIND, the ENGINE CAPABILITY a provider\n * fills (derived from its provider capabilities, never declared twice), and a provider's MATURITY.\n *\n * One predicate, {@link moduleManifestMatchesSearchFilter}, answers the question for every source a search reads —\n * the registry server's stored manifests and a framework checkout's `providers-registry/` (#2015) — so the two\n * cannot disagree about what a filter means.\n */\nimport { z } from 'zod';\nimport { EngineCapability } from '@wildo-ai/saas-models';\nimport {\n ModuleKind,\n ProviderModuleMaturity,\n engineCapabilitiesFilledByProviderModule,\n type ModuleManifest,\n} from './module-manifest.schemas';\n\n/**\n * The filters a search accepts. Each absent filter matches everything.\n *\n * `engineCapability` and `maturity` are provider axes, so either one excludes every FEATURE module: a feature module\n * fills no engine capability and has no maturity.\n */\nexport const ModuleSearchFilterSchema = z.strictObject({\n kind: z.enum(ModuleKind).optional(),\n engineCapability: z.enum(EngineCapability).optional(),\n maturity: z.enum(ProviderModuleMaturity).optional(),\n});\nexport type ModuleSearchFilter = z.infer<typeof ModuleSearchFilterSchema>;\n\n/** The query-string keys, in the order a client writes them. One list, so the server and the client name them alike. */\nexport const MODULE_SEARCH_FILTER_KEYS = ['kind', 'engineCapability', 'maturity'] as const satisfies readonly (keyof ModuleSearchFilter)[];\n\n/** Whether a manifest passes every filter given. */\nexport function moduleManifestMatchesSearchFilter(manifest: ModuleManifest, filter: ModuleSearchFilter): boolean {\n const kind = manifest.kind ?? ModuleKind.FEATURE;\n if (filter.kind !== undefined && kind !== filter.kind) return false;\n if (filter.engineCapability === undefined && filter.maturity === undefined) return true;\n const provider = manifest.provider;\n if (kind !== ModuleKind.PROVIDER || provider === undefined) return false;\n if (filter.maturity !== undefined && provider.maturity !== filter.maturity) return false;\n if (filter.engineCapability !== undefined && !engineCapabilitiesFilledByProviderModule(provider).includes(filter.engineCapability)) return false;\n return true;\n}\n\n/**\n * A search's filters as query-string pairs, only for the filters given. The client writes them; the server reads them\n * back through {@link ModuleSearchFilterSchema}, which refuses an unknown value rather than ignoring it: a filter that\n * silently matched everything would answer \"every module\" to a question about one kind.\n */\nexport function moduleSearchFilterQueryPairs(filter: ModuleSearchFilter): Array<[string, string]> {\n return MODULE_SEARCH_FILTER_KEYS.flatMap((key) => (filter[key] === undefined ? [] : [[key, String(filter[key])] as [string, string]]));\n}\n\nconst KNOWN_ENGINE_CAPABILITIES: ReadonlySet<string> = new Set(Object.values(EngineCapability));\n\n/**\n * What a search hit says about a provider module, so a list can be read without an `info` per hit.\n *\n * `engineCapabilities` is read as strings and narrowed to the members THIS client knows (#2014 re-review I1): a\n * registry newer than the client may name a capability added since, and refusing the whole search over it would turn\n * a vocabulary step into an outage. A member the client does not know is dropped from the hit, which is also the only\n * thing the client could do with it: no filter it can express names that member.\n *\n * Known limit, kept deliberately: `kind` and `maturity` stay strict. An unknown member there is not a detail to drop\n * but a module the client cannot classify at all (a kind it would install how? a maturity it would rank where?), so a\n * newer registry adding one still fails the search, and the remedy is updating the CLI.\n */\nexport const ModuleSearchHitProviderSchema = z.object({\n ref: z.string().min(1),\n maturity: z.enum(ProviderModuleMaturity),\n engineCapabilities: z.array(z.string()).transform((values) => values.filter((value): value is EngineCapability => KNOWN_ENGINE_CAPABILITIES.has(value))),\n});\nexport type ModuleSearchHitProvider = z.infer<typeof ModuleSearchHitProviderSchema>;\n\n/**\n * One search hit on the wire. `kind` and `provider` are optional because a registry deployed before #2014 sends\n * neither; a client reads an absent `kind` as FEATURE, as the manifest does.\n */\nexport const ModuleSearchHitSchema = z.object({\n moduleId: z.string().min(1),\n description: z.string().optional(),\n latestVersion: z.string(),\n kind: z.enum(ModuleKind).optional(),\n provider: ModuleSearchHitProviderSchema.optional(),\n});\nexport type ModuleSearchHit = z.infer<typeof ModuleSearchHitSchema>;\n\n/**\n * Whether a HIT passes the filters, read from the facts the hit carries. The client re-applies it to what a server\n * answers (#2014 review F9): a registry deployed before #2014 ignores the filter parameters and answers every module,\n * and a filtered search must not then fail open. A hit with no `kind` is a FEATURE module, and one with no `provider`\n * facts matches no provider filter, so an old server's answer to a provider search is empty rather than everything.\n */\nexport function moduleSearchHitMatchesFilter(hit: Pick<ModuleSearchHit, 'kind' | 'provider'>, filter: ModuleSearchFilter): boolean {\n const kind = hit.kind ?? ModuleKind.FEATURE;\n if (filter.kind !== undefined && kind !== filter.kind) return false;\n if (filter.engineCapability === undefined && filter.maturity === undefined) return true;\n if (kind !== ModuleKind.PROVIDER || hit.provider === undefined) return false;\n if (filter.maturity !== undefined && hit.provider.maturity !== filter.maturity) return false;\n if (filter.engineCapability !== undefined && !hit.provider.engineCapabilities.includes(filter.engineCapability)) return false;\n return true;\n}\n\n/** The `kind` and `provider` fields of a hit, from the module's manifest. */\nexport function moduleSearchHitFacts(manifest: ModuleManifest): Pick<ModuleSearchHit, 'kind' | 'provider'> {\n const kind = manifest.kind ?? ModuleKind.FEATURE;\n const provider = manifest.provider;\n return {\n kind,\n ...(kind === ModuleKind.PROVIDER && provider !== undefined\n ? { provider: { ref: provider.ref, maturity: provider.maturity, engineCapabilities: engineCapabilitiesFilledByProviderModule(provider) } }\n : {}),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"module-search.schemas.js","sourceRoot":"","sources":["../../../src/registry/module-search.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,wCAAwC,GAEzC,MAAM,2BAA2B,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,YAAY,CAAC;IACrD,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;IACnC,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE;IACrD,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAC;AAGH,wHAAwH;AACxH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,UAAU,CAA0D,CAAC;AAE3I,oDAAoD;AACpD,MAAM,UAAU,iCAAiC,CAAC,QAAwB,EAAE,MAA0B;IACpG,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,UAAU,CAAC,OAAO,CAAC;IACjD,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,MAAM,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IACpE,IAAI,MAAM,CAAC,gBAAgB,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACxF,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;IACnC,IAAI,IAAI,KAAK,UAAU,CAAC,QAAQ,IAAI,QAAQ,KAAK,SAAS;QAAE,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,CAAC,IAAI,IAAI,UAAU,CAAC,OAAO,CAAC;IACjD,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;IACnC,OAAO;QACL,IAAI;QACJ,GAAG,CAAC,IAAI,KAAK,UAAU,CAAC,QAAQ,IAAI,QAAQ,KAAK,SAAS;YACxD,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,EAAE,wCAAwC,CAAC,QAAQ,CAAC,EAAE,EAAE;YAC1I,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC","sourcesContent":["/**\n * What a registry search may filter on, and what a hit says about the module (#2014, epic #2012).\n *\n * Once providers are distributed through the registry, \"find me a module\" becomes \"find me a provider that fills\n * this engine capability\". The three filters are the manifest's own axes: its KIND, the ENGINE CAPABILITY a provider\n * fills (derived from its provider capabilities, never declared twice), and a provider's MATURITY.\n *\n * One predicate, {@link moduleManifestMatchesSearchFilter}, answers the question for every source a search reads —\n * the registry server's stored manifests and a framework checkout's `providers-registry/` (#2015) — so the two\n * cannot disagree about what a filter means.\n */\nimport { z } from 'zod';\nimport { EngineCapability } from '@wildo-ai/saas-models';\nimport {\n ModuleKind,\n ProviderModuleMaturity,\n engineCapabilitiesFilledByProviderModule,\n type ModuleManifest,\n} from './module-manifest.schemas';\n\n/**\n * The filters a search accepts. Each absent filter matches everything.\n *\n * `engineCapability` and `maturity` are provider axes, so either one excludes every FEATURE module: a feature module\n * fills no engine capability and has no maturity.\n */\nexport const ModuleSearchFilterSchema = z.strictObject({\n kind: z.enum(ModuleKind).optional(),\n engineCapability: z.enum(EngineCapability).optional(),\n maturity: z.enum(ProviderModuleMaturity).optional(),\n});\nexport type ModuleSearchFilter = z.infer<typeof ModuleSearchFilterSchema>;\n\n/** The query-string keys, in the order a client writes them. One list, so the server and the client name them alike. */\nexport const MODULE_SEARCH_FILTER_KEYS = ['kind', 'engineCapability', 'maturity'] as const satisfies readonly (keyof ModuleSearchFilter)[];\n\n/** Whether a manifest passes every filter given. */\nexport function moduleManifestMatchesSearchFilter(manifest: ModuleManifest, filter: ModuleSearchFilter): boolean {\n const kind = manifest.kind ?? ModuleKind.FEATURE;\n if (filter.kind !== undefined && kind !== filter.kind) return false;\n if (filter.engineCapability === undefined && filter.maturity === undefined) return true;\n const provider = manifest.provider;\n if (kind !== ModuleKind.PROVIDER || provider === undefined) return false;\n if (filter.maturity !== undefined && provider.maturity !== filter.maturity) return false;\n if (filter.engineCapability !== undefined && !engineCapabilitiesFilledByProviderModule(provider).includes(filter.engineCapability)) return false;\n return true;\n}\n\n/**\n * A search's filters as query-string pairs, only for the filters given. The client writes them; the server reads them\n * back through {@link ModuleSearchFilterSchema}, which refuses an unknown value rather than ignoring it: a filter that\n * silently matched everything would answer \"every module\" to a question about one kind.\n */\nexport function moduleSearchFilterQueryPairs(filter: ModuleSearchFilter): Array<[string, string]> {\n return MODULE_SEARCH_FILTER_KEYS.flatMap((key) => (filter[key] === undefined ? [] : [[key, String(filter[key])] as [string, string]]));\n}\n\nconst KNOWN_ENGINE_CAPABILITIES: ReadonlySet<string> = new Set(Object.values(EngineCapability));\n\n/**\n * What a search hit says about a provider module, so a list can be read without an `info` per hit.\n *\n * `engineCapabilities` is read as strings and narrowed to the members THIS client knows (#2014 re-review I1): a\n * registry newer than the client may name a capability added since, and refusing the whole search over it would turn\n * a vocabulary step into an outage. A member the client does not know is dropped from the hit, which is also the only\n * thing the client could do with it: no filter it can express names that member.\n *\n * Known limit, kept deliberately: `kind` and `maturity` stay strict. An unknown member there is not a detail to drop\n * but a module the client cannot classify at all (a kind it would install how? a maturity it would rank where?), so a\n * newer registry adding one still fails the search, and the remedy is updating the CLI.\n */\nexport const ModuleSearchHitProviderSchema = z.object({\n ref: z.string().min(1),\n maturity: z.enum(ProviderModuleMaturity),\n engineCapabilities: z.array(z.string()).transform((values) => values.filter((value): value is EngineCapability => KNOWN_ENGINE_CAPABILITIES.has(value))),\n});\nexport type ModuleSearchHitProvider = z.infer<typeof ModuleSearchHitProviderSchema>;\n\n/**\n * One search hit on the wire. `kind` and `provider` are optional because a registry deployed before #2014 sends\n * neither; a client reads an absent `kind` as FEATURE, as the manifest does.\n */\nexport const ModuleSearchHitSchema = z.object({\n moduleId: z.string().min(1),\n description: z.string().optional(),\n latestVersion: z.string(),\n kind: z.enum(ModuleKind).optional(),\n provider: ModuleSearchHitProviderSchema.optional(),\n});\nexport type ModuleSearchHit = z.infer<typeof ModuleSearchHitSchema>;\n\n/**\n * Whether a HIT passes the filters, read from the facts the hit carries. The client re-applies it to what a server\n * answers (#2014 review F9): a registry deployed before #2014 ignores the filter parameters and answers every module,\n * and a filtered search must not then fail open. A hit with no `kind` is a FEATURE module, and one with no `provider`\n * facts matches no provider filter, so an old server's answer to a provider search is empty rather than everything.\n */\nexport function moduleSearchHitMatchesFilter(hit: Pick<ModuleSearchHit, 'kind' | 'provider'>, filter: ModuleSearchFilter): boolean {\n const kind = hit.kind ?? ModuleKind.FEATURE;\n if (filter.kind !== undefined && kind !== filter.kind) return false;\n if (filter.engineCapability === undefined && filter.maturity === undefined) return true;\n if (kind !== ModuleKind.PROVIDER || hit.provider === undefined) return false;\n if (filter.maturity !== undefined && hit.provider.maturity !== filter.maturity) return false;\n if (filter.engineCapability !== undefined && !hit.provider.engineCapabilities.includes(filter.engineCapability)) return false;\n return true;\n}\n\n/** The `kind` and `provider` fields of a hit, from the module's manifest. */\nexport function moduleSearchHitFacts(manifest: ModuleManifest): Pick<ModuleSearchHit, 'kind' | 'provider'> {\n const kind = manifest.kind ?? ModuleKind.FEATURE;\n const provider = manifest.provider;\n return {\n kind,\n ...(kind === ModuleKind.PROVIDER && provider !== undefined\n ? { provider: { ref: provider.ref, maturity: provider.maturity, engineCapabilities: engineCapabilitiesFilledByProviderModule(provider) } }\n : {}),\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-config.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"registry-config.schemas.d.ts","sourceRoot":"","sources":["../../../src/registry/registry-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,yBAAyB;IACpC,qEAAqE;;IAErE,+DAA+D;;IAE/D;;;;;;OAMG;;kBAEH,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,oBAAoB;IAf/B,qEAAqE;;IAErE,+DAA+D;;IAE/D;;;;;;OAMG;;oBAK6E,CAAC;AACnF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-config.schemas.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"registry-config.schemas.js","sourceRoot":"","sources":["../../../src/registry/registry-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,YAAY,CAAC;IACtD,qEAAqE;IACrE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,+DAA+D;IAC/D,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE;IACZ;;;;;;OAMG;IACH,iBAAiB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC","sourcesContent":["/**\n * App-level registry configuration — the\n * `wildo.saas.config.ts > moduleRegistries` array.\n *\n * Phase 0.5 lands the schema only. The actual `defineSaasConfig`\n * extension (KD-16) lands in Phase 4 alongside `wildo registry\n * login`/`whoami` so that authoring + auth-config land in the same\n * pass. Phase 1 may also add per-entry policy fields (e.g. default\n * resolution behavior, scope, secret refs) — keep this surface\n * minimal until those flows are designed.\n *\n * Credentials are intentionally NOT recorded here — they live in\n * per-machine CLI storage (KD-11). The app-level config only points\n * at registry endpoints.\n */\n\nimport { z } from 'zod';\n\nexport const RegistryConfigEntrySchema = z.strictObject({\n /** Stable id used by lockfile entries + CLI flags (e.g. `wildo`). */\n id: z.string().min(1),\n /** Registry HTTP origin (e.g. `https://registry.wildo.ai`). */\n url: z.url(),\n /**\n * Allow plain `http://` to this registry although it is not on a loopback host (#1764). The CLI\n * otherwise refuses: over plain HTTP the bearer key and the module source travel in cleartext, and\n * the artifact digest cannot help, because the server that serves the bytes also reports the digest.\n * Named per registry on purpose, so the exception is visible in review and reaches no other registry.\n * Loopback (`localhost`, `127.0.0.0/8`, `::1`) never needs it.\n */\n allowInsecureHttp: z.boolean().optional(),\n});\nexport type RegistryConfigEntry = z.infer<typeof RegistryConfigEntrySchema>;\n\nexport const RegistryConfigSchema = z.array(RegistryConfigEntrySchema).default([]);\nexport type RegistryConfig = z.infer<typeof RegistryConfigSchema>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-defaults.constants.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"registry-defaults.constants.d.ts","sourceRoot":"","sources":["../../../src/registry/registry-defaults.constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,8BAA8B,CAAC;AAEvE;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,0BAA0B,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-defaults.constants.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"registry-defaults.constants.js","sourceRoot":"","sources":["../../../src/registry/registry-defaults.constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,2BAA2B,CAAC;AAEvE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,uBAAuB,CAAC;AAElE;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAEhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC","sourcesContent":["/**\n * Single-source-of-truth constants for module-registry defaults.\n *\n * Phase 0.5 lands the constants used by every registry consumer\n * (`wildo-cli`, `wildo-module-client`, the future\n * `platform-module-registry` server, and the dev companion). Adding\n * new defaults here keeps the CLI, server, and lockfile readers in\n * agreement without forcing a third package.\n */\n\n/**\n * Default registry URL when the user is NOT inside a Wildo framework\n * checkout. Public Wildo registry — equivalent of npm's\n * `https://registry.npmjs.org` for module-registry artifacts.\n */\nexport const DEFAULT_PUBLIC_REGISTRY_URL = 'https://registry.wildo.ai';\n\n/**\n * Default registry URL when running inside a Wildo framework\n * checkout (framework-developer mode). Points at the local\n * `platform-module-registry` service. The pinned port mirrors\n * KD-7 / Review-pass-4 MEDIUM-GG: `5154` is the next free slot\n * after the `5151`/`5152` platform services in\n * `templates/infra/docker-compose/docker-compose.wildo-platform.yml.hbs`.\n */\nexport const DEFAULT_LOCAL_REGISTRY_URL = 'http://localhost:5154';\n\n/**\n * Pinned port for the local registry service. Surfaced separately so\n * docker-compose templates and CLI default-flags can stay aligned\n * with the URL constant above.\n */\nexport const DEFAULT_LOCAL_REGISTRY_PORT = 5154;\n\n/**\n * Default registry id used by `wildo registry init` and the CLI's\n * default flags when the user does not explicitly pick a registry.\n * Matches `wildo.saas.config.ts > moduleRegistries[].id` convention.\n */\nexport const DEFAULT_REGISTRY_ID = 'wildo';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-errors.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"registry-errors.d.ts","sourceRoot":"","sources":["../../../src/registry/registry-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,oBAAY,iBAAiB;IAC3B,wEAAwE;IACxE,2BAA2B,+CAA+C;IAC1E,4CAA4C;IAC5C,gBAAgB,oCAAoC;IACpD,uDAAuD;IACvD,iBAAiB,qCAAqC;IACtD,uCAAuC;IACvC,cAAc,kCAAkC;IAChD,uEAAuE;IACvE,sBAAsB,0CAA0C;IAChE,4DAA4D;IAC5D,kBAAkB,sCAAsC;IACxD,uEAAuE;IACvE,mBAAmB,uCAAuC;IAC1D,yDAAyD;IACzD,aAAa,iCAAiC;IAC9C;;;;OAIG;IACH,mBAAmB,uCAAuC;IAC1D;;;OAGG;IACH,YAAY,gCAAgC;IAC5C,4GAA4G;IAC5G,mBAAmB,uCAAuC;IAC1D,kEAAkE;IAClE,cAAc,kCAAkC;IAChD,8FAA8F;IAC9F,mBAAmB,uCAAuC;IAC1D,8GAA8G;IAC9G,oBAAoB,wCAAwC;IAC5D,+EAA+E;IAC/E,iBAAiB,qCAAqC;IACtD,kEAAkE;IAClE,iBAAiB,qCAAqC;IACtD,+EAA+E;IAC/E,eAAe,mCAAmC;CACnD;AAED,qBAAa,aAAc,SAAQ,KAAK;IACtC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;gBAErB,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM;CAWrD;AAED,qBAAa,sCAAuC,SAAQ,aAAa;aAErD,QAAQ,EAAE,MAAM;aAChB,OAAO,EAAE,MAAM;aACf,QAAQ,EAAE,MAAM;aAChB,MAAM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,EAAE,MAAM;aAClB,MAAM,EAAE,MAAM;gBAHd,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM;CAQjC;AAED;;;;;;;GAOG;AACH,qBAAa,6BAA8B,SAAQ,aAAa;aAE5C,WAAW,EAAE,MAAM;aACnB,MAAM,EAAE,MAAM;aACd,MAAM,EAAE,MAAM;gBAFd,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM;CAQjC;AAED;;;;GAIG;AACH,oBAAY,oBAAoB;IAC9B,wEAAwE;IACxE,iBAAiB,sBAAsB;IACvC,uEAAuE;IACvE,gBAAgB,qBAAqB;IACrC;;;OAGG;IACH,YAAY,iBAAiB;CAC9B;AAaD;;;;GAIG;AACH,qBAAa,2BAA4B,SAAQ,aAAa;aAE1C,WAAW,EAAE,MAAM;aACnB,MAAM,EAAE,MAAM;aACd,KAAK,EAAE,oBAAoB;aAC3B,SAAS,EAAE,MAAM;gBAHjB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,oBAAoB,EAC3B,SAAS,EAAE,MAAM;CAQpC;AAED,sFAAsF;AACtF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEtD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-errors.js","sourceRoot":"","sources":["../../../../src/registry/registry-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAN,IAAY,iBA0CX;AA1CD,WAAY,iBAAiB;IAC3B,wEAAwE;IACxE,+FAA0E,CAAA;IAC1E,4CAA4C;IAC5C,yEAAoD,CAAA;IACpD,uDAAuD;IACvD,2EAAsD,CAAA;IACtD,uCAAuC;IACvC,qEAAgD,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AE1C;IACA;IACA;IACA;IAJlB,YACkB,WAAmB,EACnB,MAAc,EACd,KAA2B,EAC3B,SAAiB;QAEjC,KAAK,CACH,iBAAiB,CAAC,eAAe,EACjC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,CACvD,CAAC;QARc,gBAAW,GAAX,WAAW,CAAQ;QACnB,WAAM,GAAN,MAAM,CAAQ;QACd,UAAK,GAAL,KAAK,CAAsB;QAC3B,cAAS,GAAT,SAAS,CAAQ;QAMjC,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;IAC5C,CAAC;CACF;AAED,sFAAsF;AACtF,MAAM,UAAU,gBAAgB,CAAC,GAAY;IAC3C,OAAO,GAAG,YAAY,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,YAAY,IAAI,GAAG,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,KAAK,YAAY,aAAa,CAAC;AACxC,CAAC","sourcesContent":["/**\n * Registry-typed error classes.\n *\n * Phase 1 ships the typed-error vocabulary that Phase 2+ services\n * raise. Each error carries a stable `code` so CLI callers can\n * map errors to UX-specific copy without parsing messages.\n *\n * Errors are intentionally minimal — they encode discriminators,\n * not full diagnostic envelopes. UX layers attach their own\n * context (operator instructions, links, retry hints) when they\n * surface these errors.\n */\n\nexport enum RegistryErrorCode {\n /** Downloaded bytes do not hash to the digest the registry resolved. */\n ARTIFACT_INTEGRITY_MISMATCH = 'WILDO_REGISTRY_ARTIFACT_INTEGRITY_MISMATCH',\n /** No module with that id in the domain. */\n MODULE_NOT_FOUND = 'WILDO_REGISTRY_MODULE_NOT_FOUND',\n /** No release satisfies the requested range or tag. */\n VERSION_NOT_FOUND = 'WILDO_REGISTRY_VERSION_NOT_FOUND',\n /** The requested release is yanked. */\n VERSION_YANKED = 'WILDO_REGISTRY_VERSION_YANKED',\n /** A module requires dependencies the application does not provide. */\n DEPENDENCY_UNSATISFIED = 'WILDO_REGISTRY_DEPENDENCY_UNSATISFIED',\n /** A module would write outside its declared boundaries. */\n BOUNDARY_VIOLATION = 'WILDO_REGISTRY_BOUNDARY_VIOLATION',\n /** An installed file carries local edits an update would overwrite. */\n CONFLICT_LOCAL_EDIT = 'WILDO_REGISTRY_CONFLICT_LOCAL_EDIT',\n /** The request needs a registry key and carried none. */\n AUTH_REQUIRED = 'WILDO_REGISTRY_AUTH_REQUIRED',\n /**\n * The request carried a key and the registry refused it: revoked, expired, mistyped, or belonging to a\n * suspended organization. Distinct from `AUTH_REQUIRED` because the remedy differs: that one is \"log\n * in\", this one is \"the key you logged in with no longer works\".\n */\n CREDENTIAL_REJECTED = 'WILDO_REGISTRY_CREDENTIAL_REJECTED',\n /**\n * The registry refused the request for volume: most often the per-source failed-credential guard every\n * Wildo backend applies (#1759), after repeated rejected keys. Retrying immediately extends it.\n */\n RATE_LIMITED = 'WILDO_REGISTRY_RATE_LIMITED',\n /** A yank of a yanked release, or an unyank of a live one (#1758): the release is already in that state. */\n YANK_STATE_CONFLICT = 'WILDO_REGISTRY_YANK_STATE_CONFLICT',\n /** The key is valid but not allowed to perform this operation. */\n AUTH_FORBIDDEN = 'WILDO_REGISTRY_AUTH_FORBIDDEN',\n /** The modules lockfile is inconsistent in a way `wildo registry repair-lockfile` can fix. */\n LOCKFILE_REPAIRABLE = 'WILDO_REGISTRY_LOCKFILE_REPAIRABLE',\n /** The source change succeeded but provider materialization afterwards failed (install, update or remove). */\n PROVIDER_SYNC_FAILED = 'WILDO_REGISTRY_PROVIDER_SYNC_FAILED',\n /** The registry answered with an HTTP status the client has no meaning for. */\n UNEXPECTED_STATUS = 'WILDO_REGISTRY_UNEXPECTED_STATUS',\n /** A 2xx response carried a payload the contract cannot parse. */\n MALFORMED_PAYLOAD = 'WILDO_REGISTRY_MALFORMED_PAYLOAD',\n /** The exchange ran out of time; `RegistryTimeoutPhase` says where (#1763). */\n REQUEST_TIMEOUT = 'WILDO_REGISTRY_REQUEST_TIMEOUT',\n}\n\nexport class RegistryError extends Error {\n readonly code: RegistryErrorCode;\n\n constructor(code: RegistryErrorCode, message: string) {\n super(message);\n // L13 (third-pass review): set `name = 'RegistryError'` defensively.\n // Subclasses still overwrite it in their constructors, but a future\n // subclass that forgets to set `name` would leave the default\n // `'Error'` in stack traces — misleading. With this base default,\n // even an undeclared subclass surfaces as a `RegistryError` in\n // logs.\n this.name = 'RegistryError';\n this.code = code;\n }\n}\n\nexport class RegistryArtifactIntegrityMismatchError extends RegistryError {\n constructor(\n public readonly moduleId: string,\n public readonly version: string,\n public readonly expected: string,\n public readonly actual: string,\n ) {\n super(\n RegistryErrorCode.ARTIFACT_INTEGRITY_MISMATCH,\n `Artifact integrity mismatch for ${moduleId}@${version}: expected ${expected}, got ${actual}.`,\n );\n this.name = 'RegistryArtifactIntegrityMismatchError';\n }\n}\n\nexport class RegistryModuleNotFoundError extends RegistryError {\n constructor(public readonly moduleId: string) {\n super(\n RegistryErrorCode.MODULE_NOT_FOUND,\n `Module not found: ${moduleId}.`,\n );\n this.name = 'RegistryModuleNotFoundError';\n }\n}\n\nexport class RegistryVersionNotFoundError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly versionRange: string) {\n super(\n RegistryErrorCode.VERSION_NOT_FOUND,\n `No version of ${moduleId} satisfies \"${versionRange}\".`,\n );\n this.name = 'RegistryVersionNotFoundError';\n }\n}\n\nexport class RegistryVersionYankedError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly version: string, reason?: string) {\n super(\n RegistryErrorCode.VERSION_YANKED,\n `Version ${moduleId}@${version} is yanked${reason ? `: ${reason}` : ''}.`,\n );\n this.name = 'RegistryVersionYankedError';\n }\n}\n\nexport class RegistryDependencyUnsatisfiedError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly missing: readonly string[]) {\n super(\n RegistryErrorCode.DEPENDENCY_UNSATISFIED,\n `Module ${moduleId} requires unmet dependencies: ${missing.join(', ')}.`,\n );\n this.name = 'RegistryDependencyUnsatisfiedError';\n }\n}\n\nexport class RegistryBoundaryViolationError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly offendingPath: string) {\n super(\n RegistryErrorCode.BOUNDARY_VIOLATION,\n `Module ${moduleId} attempts to write outside its declared boundaries: ${offendingPath}.`,\n );\n this.name = 'RegistryBoundaryViolationError';\n }\n}\n\nexport class RegistryConflictLocalEditError extends RegistryError {\n constructor(public readonly filePath: string) {\n super(\n RegistryErrorCode.CONFLICT_LOCAL_EDIT,\n `Local edit detected at ${filePath}; refusing to overwrite without --force.`,\n );\n this.name = 'RegistryConflictLocalEditError';\n }\n}\n\nexport class RegistryAuthRequiredError extends RegistryError {\n constructor(public readonly registryUrl: string) {\n super(\n RegistryErrorCode.AUTH_REQUIRED,\n `Authentication required for ${registryUrl}. Run \\`wildo registry login --registry ${registryUrl}\\`.`,\n );\n this.name = 'RegistryAuthRequiredError';\n }\n}\n\nexport class RegistryCredentialRejectedError extends RegistryError {\n constructor(public readonly registryUrl: string) {\n super(\n RegistryErrorCode.CREDENTIAL_REJECTED,\n `The registry at ${registryUrl} rejected the stored key (revoked, expired or not recognised). ` +\n `Run \\`wildo registry login --registry ${registryUrl}\\` with a current key.`,\n );\n this.name = 'RegistryCredentialRejectedError';\n }\n}\n\nexport class RegistryRateLimitedError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n /** From `Retry-After`, when the registry sent one in seconds. */\n public readonly retryAfterSeconds: number | undefined,\n ) {\n super(\n RegistryErrorCode.RATE_LIMITED,\n `Registry \"${action}\" was rate-limited at ${registryUrl}` +\n (retryAfterSeconds !== undefined ? `; retry in ${retryAfterSeconds}s.` : '; wait before retrying.') +\n ' Repeated rejected keys from one source trigger this; check the key before retrying.',\n );\n this.name = 'RegistryRateLimitedError';\n }\n}\n\n/** The two release-state verbs (#1758); the value is also the route segment. */\nexport enum RegistryYankVerb {\n YANK = 'yank',\n UNYANK = 'unyank',\n}\n\n/**\n * The registry refused a yank or unyank because the release is already in the requested state (409).\n * Typed so a caller can report it as the no-op it is rather than a failure of the registry.\n */\nexport class RegistryYankStateConflictError extends RegistryError {\n constructor(\n public readonly moduleId: string,\n public readonly version: string,\n public readonly verb: RegistryYankVerb,\n ) {\n super(\n RegistryErrorCode.YANK_STATE_CONFLICT,\n verb === RegistryYankVerb.YANK ? `${moduleId}@${version} is already yanked.` : `${moduleId}@${version} is not yanked.`,\n );\n this.name = 'RegistryYankStateConflictError';\n }\n}\n\n/**\n * Stable, client-branchable codes the registry server puts on a refusal, carried on the wire as\n * `error.details.code` (the engine's documented channel for a switch-on-code refusal: `code` is the one\n * context key its client sanitizer admits for that purpose). Server and client both import this enum, so\n * the value has one source.\n */\nexport enum RegistryRefusalCode {\n /**\n * A yank of a yanked release, or an unyank of a live one: the release is ALREADY in the requested\n * state, so the request is a no-op a caller may report as done.\n */\n RELEASE_STATE = 'registry_release_state',\n}\n\n/**\n * Whether a 409 body from a yank/unyank route is the release-state refusal rather than any other conflict\n * (#1758 re-review R3).\n *\n * Both routes answer 409 for two different things: the release is already in the requested state, or the\n * registry gave up re-deciding after repeated lost optimistic checks (`version_conflict`). Only the first\n * is a no-op; reading every 409 as one told an operator yanking a compromised release that it was already\n * yanked. It keys on the registry's OWN code rather than the engine's generic `conflict` reference, which\n * about twenty other refusals share, so a future conflict on these routes cannot be mistaken for it.\n */\nexport function isRegistryReleaseStateConflictBody(body: unknown): boolean {\n const error = (body as { error?: { details?: { code?: unknown } } } | null | undefined)?.error;\n return error?.details?.code === RegistryRefusalCode.RELEASE_STATE;\n}\n\nexport class RegistryAuthForbiddenError extends RegistryError {\n constructor(public readonly action: string) {\n super(\n RegistryErrorCode.AUTH_FORBIDDEN,\n `Action \"${action}\" is not permitted by the current credentials.`,\n );\n this.name = 'RegistryAuthForbiddenError';\n }\n}\n\nexport class RegistryLockfileRepairableError extends RegistryError {\n constructor(message: string, public readonly hints: readonly string[] = []) {\n super(RegistryErrorCode.LOCKFILE_REPAIRABLE, message);\n this.name = 'RegistryLockfileRepairableError';\n }\n}\n\n/**\n * Raised when post-install / post-update / post-remove provider\n * materialization fails after the source mutation succeeded. The\n * companion-export discovery and `runtimeImport` reachability\n * failure modes are both surfaced via this error so module-registry\n * callers report them as first-class repairable integration errors\n * (`module-registry-analysis.md` / Provider Migration WIP Seams §1).\n */\nexport class RegistryProviderSyncFailedError extends RegistryError {\n constructor(\n message: string,\n public readonly failureKind: 'companion-discovery' | 'runtime-import-reachability' | 'invalid-scope' | 'timeout' | 'unknown',\n public readonly stderrTail?: string,\n ) {\n super(RegistryErrorCode.PROVIDER_SYNC_FAILED, message);\n this.name = 'RegistryProviderSyncFailedError';\n }\n}\n\n/**\n * Raised by `RegistryServerClient` when the server returns a non-2xx\n * status that doesn't map to a more specific typed error (404 →\n * `RegistryModuleNotFoundError`/`RegistryVersionNotFoundError`, 401 →\n * `RegistryAuthRequiredError`, 403 → `RegistryAuthForbiddenError`).\n * Carries the status code + URL so callers can discriminate \"registry\n * down / 5xx\" from authoritative client errors without re-parsing\n * `Error.message` strings.\n */\nexport class RegistryUnexpectedStatusError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly status: number,\n public readonly statusText: string,\n public readonly action: string,\n ) {\n super(\n RegistryErrorCode.UNEXPECTED_STATUS,\n `Registry \"${action}\" failed with HTTP ${status} ${statusText} at ${registryUrl}.`,\n );\n this.name = 'RegistryUnexpectedStatusError';\n }\n}\n\n/**\n * Raised by `RegistryServerClient` when\n * a 2xx response carries a payload the canonical Zod schema can't parse.\n * Without this, malformed payloads previously surfaced as bare `Error`\n * (`'Registry resolve returned a malformed payload at ...'`), which\n * broke the `isRegistryError(err)` typed-handler contract every other\n * client surface honored.\n */\nexport class RegistryMalformedPayloadError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n public readonly detail: string,\n ) {\n super(\n RegistryErrorCode.MALFORMED_PAYLOAD,\n `Registry \"${action}\" returned a malformed payload at ${registryUrl}: ${detail}`,\n );\n this.name = 'RegistryMalformedPayloadError';\n }\n}\n\n/**\n * Where a registry exchange ran out of time (#1763). The two call for different remedies: no response\n * at all points at the registry or the network path; a transfer that STALLED part-way is a slow link,\n * and is measured as silence between chunks rather than as the size of the artifact.\n */\nexport enum RegistryTimeoutPhase {\n /** No response (status + headers) arrived within the request budget. */\n AWAITING_RESPONSE = 'awaiting_response',\n /** The response started, then no bytes arrived for the idle budget. */\n TRANSFER_STALLED = 'transfer_stalled',\n /**\n * The response (status + headers) arrived, but a small metadata body did not finish within the same\n * request budget. Not `TRANSFER_STALLED`: a metadata body has no idle budget, only the request's.\n */\n READING_BODY = 'reading_body',\n}\n\nfunction describeTimeout(phase: RegistryTimeoutPhase, action: string, registryUrl: string, timeoutMs: number): string {\n switch (phase) {\n case RegistryTimeoutPhase.AWAITING_RESPONSE:\n return `Registry \"${action}\" got no response within ${timeoutMs}ms at ${registryUrl}.`;\n case RegistryTimeoutPhase.TRANSFER_STALLED:\n return `Registry \"${action}\" stalled: no data for ${timeoutMs}ms at ${registryUrl}.`;\n case RegistryTimeoutPhase.READING_BODY:\n return `Registry \"${action}\" answered but its response did not finish within ${timeoutMs}ms at ${registryUrl}.`;\n }\n}\n\n/**\n * A registry request that timed out, in the typed vocabulary, so `isRegistryError(err)` handlers see it.\n * Before #1763 a timeout escaped as a bare `Error` (before the response) or a raw `AbortError` (during\n * the body), and a JSON body cut short was reported as a MALFORMED payload.\n */\nexport class RegistryRequestTimeoutError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n public readonly phase: RegistryTimeoutPhase,\n public readonly timeoutMs: number,\n ) {\n super(\n RegistryErrorCode.REQUEST_TIMEOUT,\n describeTimeout(phase, action, registryUrl, timeoutMs),\n );\n this.name = 'RegistryRequestTimeoutError';\n }\n}\n\n/** True for the error a fetch (or a body read) raises when its abort signal fires. */\nexport function isAbortLikeError(err: unknown): boolean {\n return err instanceof Error && (err.name === 'AbortError' || err.name === 'TimeoutError');\n}\n\nexport function isRegistryError(value: unknown): value is RegistryError {\n return value instanceof RegistryError;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"registry-errors.js","sourceRoot":"","sources":["../../../src/registry/registry-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,CAAN,IAAY,iBA0CX;AA1CD,WAAY,iBAAiB;IAC3B,wEAAwE;IACxE,+FAA0E,CAAA;IAC1E,4CAA4C;IAC5C,yEAAoD,CAAA;IACpD,uDAAuD;IACvD,2EAAsD,CAAA;IACtD,uCAAuC;IACvC,qEAAgD,CAAA;IAChD,uEAAuE;IACvE,qFAAgE,CAAA;IAChE,4DAA4D;IAC5D,6EAAwD,CAAA;IACxD,uEAAuE;IACvE,+EAA0D,CAAA;IAC1D,yDAAyD;IACzD,mEAA8C,CAAA;IAC9C;;;;OAIG;IACH,+EAA0D,CAAA;IAC1D;;;OAGG;IACH,iEAA4C,CAAA;IAC5C,4GAA4G;IAC5G,+EAA0D,CAAA;IAC1D,kEAAkE;IAClE,qEAAgD,CAAA;IAChD,8FAA8F;IAC9F,+EAA0D,CAAA;IAC1D,8GAA8G;IAC9G,iFAA4D,CAAA;IAC5D,+EAA+E;IAC/E,2EAAsD,CAAA;IACtD,kEAAkE;IAClE,2EAAsD,CAAA;IACtD,+EAA+E;IAC/E,uEAAkD,CAAA;AACpD,CAAC,EA1CW,iBAAiB,KAAjB,iBAAiB,QA0C5B;AAED,MAAM,OAAO,aAAc,SAAQ,KAAK;IAC7B,IAAI,CAAoB;IAEjC,YAAY,IAAuB,EAAE,OAAe;QAClD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,qEAAqE;QACrE,oEAAoE;QACpE,8DAA8D;QAC9D,kEAAkE;QAClE,+DAA+D;QAC/D,QAAQ;QACR,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,MAAM,OAAO,sCAAuC,SAAQ,aAA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K,oBAAoB,CAAC,iBAAiB;YACzC,OAAO,aAAa,MAAM,4BAA4B,SAAS,SAAS,WAAW,GAAG,CAAC;QACzF,KAAK,oBAAoB,CAAC,gBAAgB;YACxC,OAAO,aAAa,MAAM,0BAA0B,SAAS,SAAS,WAAW,GAAG,CAAC;QACvF,KAAK,oBAAoB,CAAC,YAAY;YACpC,OAAO,aAAa,MAAM,qDAAqD,SAAS,SAAS,WAAW,GAAG,CAAC;IACpH,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,2BAA4B,SAAQ,aAAa;IAE1C;IACA;IACA;IACA;IAJlB,YACkB,WAAmB,EACnB,MAAc,EACd,KAA2B,EAC3B,SAAiB;QAEjC,KAAK,CACH,iBAAiB,CAAC,eAAe,EACjC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC,CACvD,CAAC;QARc,gBAAW,GAAX,WAAW,CAAQ;QACnB,WAAM,GAAN,MAAM,CAAQ;QACd,UAAK,GAAL,KAAK,CAAsB;QAC3B,cAAS,GAAT,SAAS,CAAQ;QAMjC,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;IAC5C,CAAC;CACF;AAED,sFAAsF;AACtF,MAAM,UAAU,gBAAgB,CAAC,GAAY;IAC3C,OAAO,GAAG,YAAY,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,YAAY,IAAI,GAAG,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,KAAK,YAAY,aAAa,CAAC;AACxC,CAAC","sourcesContent":["/**\n * Registry-typed error classes.\n *\n * Phase 1 ships the typed-error vocabulary that Phase 2+ services\n * raise. Each error carries a stable `code` so CLI callers can\n * map errors to UX-specific copy without parsing messages.\n *\n * Errors are intentionally minimal — they encode discriminators,\n * not full diagnostic envelopes. UX layers attach their own\n * context (operator instructions, links, retry hints) when they\n * surface these errors.\n */\n\nexport enum RegistryErrorCode {\n /** Downloaded bytes do not hash to the digest the registry resolved. */\n ARTIFACT_INTEGRITY_MISMATCH = 'WILDO_REGISTRY_ARTIFACT_INTEGRITY_MISMATCH',\n /** No module with that id in the domain. */\n MODULE_NOT_FOUND = 'WILDO_REGISTRY_MODULE_NOT_FOUND',\n /** No release satisfies the requested range or tag. */\n VERSION_NOT_FOUND = 'WILDO_REGISTRY_VERSION_NOT_FOUND',\n /** The requested release is yanked. */\n VERSION_YANKED = 'WILDO_REGISTRY_VERSION_YANKED',\n /** A module requires dependencies the application does not provide. */\n DEPENDENCY_UNSATISFIED = 'WILDO_REGISTRY_DEPENDENCY_UNSATISFIED',\n /** A module would write outside its declared boundaries. */\n BOUNDARY_VIOLATION = 'WILDO_REGISTRY_BOUNDARY_VIOLATION',\n /** An installed file carries local edits an update would overwrite. */\n CONFLICT_LOCAL_EDIT = 'WILDO_REGISTRY_CONFLICT_LOCAL_EDIT',\n /** The request needs a registry key and carried none. */\n AUTH_REQUIRED = 'WILDO_REGISTRY_AUTH_REQUIRED',\n /**\n * The request carried a key and the registry refused it: revoked, expired, mistyped, or belonging to a\n * suspended organization. Distinct from `AUTH_REQUIRED` because the remedy differs: that one is \"log\n * in\", this one is \"the key you logged in with no longer works\".\n */\n CREDENTIAL_REJECTED = 'WILDO_REGISTRY_CREDENTIAL_REJECTED',\n /**\n * The registry refused the request for volume: most often the per-source failed-credential guard every\n * Wildo backend applies (#1759), after repeated rejected keys. Retrying immediately extends it.\n */\n RATE_LIMITED = 'WILDO_REGISTRY_RATE_LIMITED',\n /** A yank of a yanked release, or an unyank of a live one (#1758): the release is already in that state. */\n YANK_STATE_CONFLICT = 'WILDO_REGISTRY_YANK_STATE_CONFLICT',\n /** The key is valid but not allowed to perform this operation. */\n AUTH_FORBIDDEN = 'WILDO_REGISTRY_AUTH_FORBIDDEN',\n /** The modules lockfile is inconsistent in a way `wildo registry repair-lockfile` can fix. */\n LOCKFILE_REPAIRABLE = 'WILDO_REGISTRY_LOCKFILE_REPAIRABLE',\n /** The source change succeeded but provider materialization afterwards failed (install, update or remove). */\n PROVIDER_SYNC_FAILED = 'WILDO_REGISTRY_PROVIDER_SYNC_FAILED',\n /** The registry answered with an HTTP status the client has no meaning for. */\n UNEXPECTED_STATUS = 'WILDO_REGISTRY_UNEXPECTED_STATUS',\n /** A 2xx response carried a payload the contract cannot parse. */\n MALFORMED_PAYLOAD = 'WILDO_REGISTRY_MALFORMED_PAYLOAD',\n /** The exchange ran out of time; `RegistryTimeoutPhase` says where (#1763). */\n REQUEST_TIMEOUT = 'WILDO_REGISTRY_REQUEST_TIMEOUT',\n}\n\nexport class RegistryError extends Error {\n readonly code: RegistryErrorCode;\n\n constructor(code: RegistryErrorCode, message: string) {\n super(message);\n // L13 (third-pass review): set `name = 'RegistryError'` defensively.\n // Subclasses still overwrite it in their constructors, but a future\n // subclass that forgets to set `name` would leave the default\n // `'Error'` in stack traces — misleading. With this base default,\n // even an undeclared subclass surfaces as a `RegistryError` in\n // logs.\n this.name = 'RegistryError';\n this.code = code;\n }\n}\n\nexport class RegistryArtifactIntegrityMismatchError extends RegistryError {\n constructor(\n public readonly moduleId: string,\n public readonly version: string,\n public readonly expected: string,\n public readonly actual: string,\n ) {\n super(\n RegistryErrorCode.ARTIFACT_INTEGRITY_MISMATCH,\n `Artifact integrity mismatch for ${moduleId}@${version}: expected ${expected}, got ${actual}.`,\n );\n this.name = 'RegistryArtifactIntegrityMismatchError';\n }\n}\n\nexport class RegistryModuleNotFoundError extends RegistryError {\n constructor(public readonly moduleId: string) {\n super(\n RegistryErrorCode.MODULE_NOT_FOUND,\n `Module not found: ${moduleId}.`,\n );\n this.name = 'RegistryModuleNotFoundError';\n }\n}\n\nexport class RegistryVersionNotFoundError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly versionRange: string) {\n super(\n RegistryErrorCode.VERSION_NOT_FOUND,\n `No version of ${moduleId} satisfies \"${versionRange}\".`,\n );\n this.name = 'RegistryVersionNotFoundError';\n }\n}\n\nexport class RegistryVersionYankedError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly version: string, reason?: string) {\n super(\n RegistryErrorCode.VERSION_YANKED,\n `Version ${moduleId}@${version} is yanked${reason ? `: ${reason}` : ''}.`,\n );\n this.name = 'RegistryVersionYankedError';\n }\n}\n\nexport class RegistryDependencyUnsatisfiedError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly missing: readonly string[]) {\n super(\n RegistryErrorCode.DEPENDENCY_UNSATISFIED,\n `Module ${moduleId} requires unmet dependencies: ${missing.join(', ')}.`,\n );\n this.name = 'RegistryDependencyUnsatisfiedError';\n }\n}\n\nexport class RegistryBoundaryViolationError extends RegistryError {\n constructor(public readonly moduleId: string, public readonly offendingPath: string) {\n super(\n RegistryErrorCode.BOUNDARY_VIOLATION,\n `Module ${moduleId} attempts to write outside its declared boundaries: ${offendingPath}.`,\n );\n this.name = 'RegistryBoundaryViolationError';\n }\n}\n\nexport class RegistryConflictLocalEditError extends RegistryError {\n constructor(public readonly filePath: string) {\n super(\n RegistryErrorCode.CONFLICT_LOCAL_EDIT,\n `Local edit detected at ${filePath}; refusing to overwrite without --force.`,\n );\n this.name = 'RegistryConflictLocalEditError';\n }\n}\n\nexport class RegistryAuthRequiredError extends RegistryError {\n constructor(public readonly registryUrl: string) {\n super(\n RegistryErrorCode.AUTH_REQUIRED,\n `Authentication required for ${registryUrl}. Run \\`wildo registry login --registry ${registryUrl}\\`.`,\n );\n this.name = 'RegistryAuthRequiredError';\n }\n}\n\nexport class RegistryCredentialRejectedError extends RegistryError {\n constructor(public readonly registryUrl: string) {\n super(\n RegistryErrorCode.CREDENTIAL_REJECTED,\n `The registry at ${registryUrl} rejected the stored key (revoked, expired or not recognised). ` +\n `Run \\`wildo registry login --registry ${registryUrl}\\` with a current key.`,\n );\n this.name = 'RegistryCredentialRejectedError';\n }\n}\n\nexport class RegistryRateLimitedError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n /** From `Retry-After`, when the registry sent one in seconds. */\n public readonly retryAfterSeconds: number | undefined,\n ) {\n super(\n RegistryErrorCode.RATE_LIMITED,\n `Registry \"${action}\" was rate-limited at ${registryUrl}` +\n (retryAfterSeconds !== undefined ? `; retry in ${retryAfterSeconds}s.` : '; wait before retrying.') +\n ' Repeated rejected keys from one source trigger this; check the key before retrying.',\n );\n this.name = 'RegistryRateLimitedError';\n }\n}\n\n/** The two release-state verbs (#1758); the value is also the route segment. */\nexport enum RegistryYankVerb {\n YANK = 'yank',\n UNYANK = 'unyank',\n}\n\n/**\n * The registry refused a yank or unyank because the release is already in the requested state (409).\n * Typed so a caller can report it as the no-op it is rather than a failure of the registry.\n */\nexport class RegistryYankStateConflictError extends RegistryError {\n constructor(\n public readonly moduleId: string,\n public readonly version: string,\n public readonly verb: RegistryYankVerb,\n ) {\n super(\n RegistryErrorCode.YANK_STATE_CONFLICT,\n verb === RegistryYankVerb.YANK ? `${moduleId}@${version} is already yanked.` : `${moduleId}@${version} is not yanked.`,\n );\n this.name = 'RegistryYankStateConflictError';\n }\n}\n\n/**\n * Stable, client-branchable codes the registry server puts on a refusal, carried on the wire as\n * `error.details.code` (the engine's documented channel for a switch-on-code refusal: `code` is the one\n * context key its client sanitizer admits for that purpose). Server and client both import this enum, so\n * the value has one source.\n */\nexport enum RegistryRefusalCode {\n /**\n * A yank of a yanked release, or an unyank of a live one: the release is ALREADY in the requested\n * state, so the request is a no-op a caller may report as done.\n */\n RELEASE_STATE = 'registry_release_state',\n}\n\n/**\n * Whether a 409 body from a yank/unyank route is the release-state refusal rather than any other conflict\n * (#1758 re-review R3).\n *\n * Both routes answer 409 for two different things: the release is already in the requested state, or the\n * registry gave up re-deciding after repeated lost optimistic checks (`version_conflict`). Only the first\n * is a no-op; reading every 409 as one told an operator yanking a compromised release that it was already\n * yanked. It keys on the registry's OWN code rather than the engine's generic `conflict` reference, which\n * about twenty other refusals share, so a future conflict on these routes cannot be mistaken for it.\n */\nexport function isRegistryReleaseStateConflictBody(body: unknown): boolean {\n const error = (body as { error?: { details?: { code?: unknown } } } | null | undefined)?.error;\n return error?.details?.code === RegistryRefusalCode.RELEASE_STATE;\n}\n\nexport class RegistryAuthForbiddenError extends RegistryError {\n constructor(public readonly action: string) {\n super(\n RegistryErrorCode.AUTH_FORBIDDEN,\n `Action \"${action}\" is not permitted by the current credentials.`,\n );\n this.name = 'RegistryAuthForbiddenError';\n }\n}\n\nexport class RegistryLockfileRepairableError extends RegistryError {\n constructor(message: string, public readonly hints: readonly string[] = []) {\n super(RegistryErrorCode.LOCKFILE_REPAIRABLE, message);\n this.name = 'RegistryLockfileRepairableError';\n }\n}\n\n/**\n * Raised when post-install / post-update / post-remove provider\n * materialization fails after the source mutation succeeded. The\n * companion-export discovery and `runtimeImport` reachability\n * failure modes are both surfaced via this error so module-registry\n * callers report them as first-class repairable integration errors\n * (`module-registry-analysis.md` / Provider Migration WIP Seams §1).\n */\nexport class RegistryProviderSyncFailedError extends RegistryError {\n constructor(\n message: string,\n public readonly failureKind: 'companion-discovery' | 'runtime-import-reachability' | 'invalid-scope' | 'timeout' | 'unknown',\n public readonly stderrTail?: string,\n ) {\n super(RegistryErrorCode.PROVIDER_SYNC_FAILED, message);\n this.name = 'RegistryProviderSyncFailedError';\n }\n}\n\n/**\n * Raised by `RegistryServerClient` when the server returns a non-2xx\n * status that doesn't map to a more specific typed error (404 →\n * `RegistryModuleNotFoundError`/`RegistryVersionNotFoundError`, 401 →\n * `RegistryAuthRequiredError`, 403 → `RegistryAuthForbiddenError`).\n * Carries the status code + URL so callers can discriminate \"registry\n * down / 5xx\" from authoritative client errors without re-parsing\n * `Error.message` strings.\n */\nexport class RegistryUnexpectedStatusError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly status: number,\n public readonly statusText: string,\n public readonly action: string,\n ) {\n super(\n RegistryErrorCode.UNEXPECTED_STATUS,\n `Registry \"${action}\" failed with HTTP ${status} ${statusText} at ${registryUrl}.`,\n );\n this.name = 'RegistryUnexpectedStatusError';\n }\n}\n\n/**\n * Raised by `RegistryServerClient` when\n * a 2xx response carries a payload the canonical Zod schema can't parse.\n * Without this, malformed payloads previously surfaced as bare `Error`\n * (`'Registry resolve returned a malformed payload at ...'`), which\n * broke the `isRegistryError(err)` typed-handler contract every other\n * client surface honored.\n */\nexport class RegistryMalformedPayloadError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n public readonly detail: string,\n ) {\n super(\n RegistryErrorCode.MALFORMED_PAYLOAD,\n `Registry \"${action}\" returned a malformed payload at ${registryUrl}: ${detail}`,\n );\n this.name = 'RegistryMalformedPayloadError';\n }\n}\n\n/**\n * Where a registry exchange ran out of time (#1763). The two call for different remedies: no response\n * at all points at the registry or the network path; a transfer that STALLED part-way is a slow link,\n * and is measured as silence between chunks rather than as the size of the artifact.\n */\nexport enum RegistryTimeoutPhase {\n /** No response (status + headers) arrived within the request budget. */\n AWAITING_RESPONSE = 'awaiting_response',\n /** The response started, then no bytes arrived for the idle budget. */\n TRANSFER_STALLED = 'transfer_stalled',\n /**\n * The response (status + headers) arrived, but a small metadata body did not finish within the same\n * request budget. Not `TRANSFER_STALLED`: a metadata body has no idle budget, only the request's.\n */\n READING_BODY = 'reading_body',\n}\n\nfunction describeTimeout(phase: RegistryTimeoutPhase, action: string, registryUrl: string, timeoutMs: number): string {\n switch (phase) {\n case RegistryTimeoutPhase.AWAITING_RESPONSE:\n return `Registry \"${action}\" got no response within ${timeoutMs}ms at ${registryUrl}.`;\n case RegistryTimeoutPhase.TRANSFER_STALLED:\n return `Registry \"${action}\" stalled: no data for ${timeoutMs}ms at ${registryUrl}.`;\n case RegistryTimeoutPhase.READING_BODY:\n return `Registry \"${action}\" answered but its response did not finish within ${timeoutMs}ms at ${registryUrl}.`;\n }\n}\n\n/**\n * A registry request that timed out, in the typed vocabulary, so `isRegistryError(err)` handlers see it.\n * Before #1763 a timeout escaped as a bare `Error` (before the response) or a raw `AbortError` (during\n * the body), and a JSON body cut short was reported as a MALFORMED payload.\n */\nexport class RegistryRequestTimeoutError extends RegistryError {\n constructor(\n public readonly registryUrl: string,\n public readonly action: string,\n public readonly phase: RegistryTimeoutPhase,\n public readonly timeoutMs: number,\n ) {\n super(\n RegistryErrorCode.REQUEST_TIMEOUT,\n describeTimeout(phase, action, registryUrl, timeoutMs),\n );\n this.name = 'RegistryRequestTimeoutError';\n }\n}\n\n/** True for the error a fetch (or a body read) raises when its abort signal fires. */\nexport function isAbortLikeError(err: unknown): boolean {\n return err instanceof Error && (err.name === 'AbortError' || err.name === 'TimeoutError');\n}\n\nexport function isRegistryError(value: unknown): value is RegistryError {\n return value instanceof RegistryError;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-keys.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"registry-keys.schemas.d.ts","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,oBAAY,eAAe;IACzB,qGAAqG;IACrG,IAAI,SAAS;IACb,uFAAuF;IACvF,OAAO,YAAY;CACpB;AAED,kFAAkF;AAClF,eAAO,MAAM,gCAAgC,KAAK,CAAC;AACnD,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD,uFAAuF;AACvF,eAAO,MAAM,qBAAqB,aAEhC,CAAC;AAEH,4FAA4F;AAC5F,eAAO,MAAM,iCAAiC,4BAA+B,CAAC;AAE9E,eAAO,MAAM,4BAA4B;;;;;kBAKvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,6BAA6B;;;;;;;;iBASxC,CAAC;AACH,MAAM,MAAM,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