@xemahq/biome-sdk 0.1.1
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/LICENSE +201 -0
- package/README.md +62 -0
- package/dist/adapter/index.d.ts +7 -0
- package/dist/adapter/index.d.ts.map +1 -0
- package/dist/adapter/index.js +23 -0
- package/dist/adapter/index.js.map +1 -0
- package/dist/adapter/lib/action.d.ts +25 -0
- package/dist/adapter/lib/action.d.ts.map +1 -0
- package/dist/adapter/lib/action.js +3 -0
- package/dist/adapter/lib/action.js.map +1 -0
- package/dist/adapter/lib/provider-module.d.ts +41 -0
- package/dist/adapter/lib/provider-module.d.ts.map +1 -0
- package/dist/adapter/lib/provider-module.js +7 -0
- package/dist/adapter/lib/provider-module.js.map +1 -0
- package/dist/adapter/lib/resource.d.ts +25 -0
- package/dist/adapter/lib/resource.d.ts.map +1 -0
- package/dist/adapter/lib/resource.js +3 -0
- package/dist/adapter/lib/resource.js.map +1 -0
- package/dist/adapter/lib/result.d.ts +18 -0
- package/dist/adapter/lib/result.d.ts.map +1 -0
- package/dist/adapter/lib/result.js +12 -0
- package/dist/adapter/lib/result.js.map +1 -0
- package/dist/adapter/lib/sidecar-contract.d.ts +91 -0
- package/dist/adapter/lib/sidecar-contract.d.ts.map +1 -0
- package/dist/adapter/lib/sidecar-contract.js +19 -0
- package/dist/adapter/lib/sidecar-contract.js.map +1 -0
- package/dist/adapter/lib/webhook.d.ts +49 -0
- package/dist/adapter/lib/webhook.d.ts.map +1 -0
- package/dist/adapter/lib/webhook.js +3 -0
- package/dist/adapter/lib/webhook.js.map +1 -0
- package/dist/agent-workspace/index.d.ts +8 -0
- package/dist/agent-workspace/index.d.ts.map +1 -0
- package/dist/agent-workspace/index.js +24 -0
- package/dist/agent-workspace/index.js.map +1 -0
- package/dist/agent-workspace/lib/errors/error-codes.d.ts +16 -0
- package/dist/agent-workspace/lib/errors/error-codes.d.ts.map +1 -0
- package/dist/agent-workspace/lib/errors/error-codes.js +37 -0
- package/dist/agent-workspace/lib/errors/error-codes.js.map +1 -0
- package/dist/agent-workspace/lib/errors/index.d.ts +4 -0
- package/dist/agent-workspace/lib/errors/index.d.ts.map +1 -0
- package/dist/agent-workspace/lib/errors/index.js +20 -0
- package/dist/agent-workspace/lib/errors/index.js.map +1 -0
- package/dist/agent-workspace/lib/errors/mount-plan-error.d.ts +16 -0
- package/dist/agent-workspace/lib/errors/mount-plan-error.d.ts.map +1 -0
- package/dist/agent-workspace/lib/errors/mount-plan-error.js +26 -0
- package/dist/agent-workspace/lib/errors/mount-plan-error.js.map +1 -0
- package/dist/agent-workspace/lib/errors/mount-resolver-error.d.ts +34 -0
- package/dist/agent-workspace/lib/errors/mount-resolver-error.d.ts.map +1 -0
- package/dist/agent-workspace/lib/errors/mount-resolver-error.js +50 -0
- package/dist/agent-workspace/lib/errors/mount-resolver-error.js.map +1 -0
- package/dist/agent-workspace/lib/mount-resolver.d.ts +10 -0
- package/dist/agent-workspace/lib/mount-resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/mount-resolver.js +3 -0
- package/dist/agent-workspace/lib/mount-resolver.js.map +1 -0
- package/dist/agent-workspace/lib/mount-source.d.ts +4 -0
- package/dist/agent-workspace/lib/mount-source.d.ts.map +1 -0
- package/dist/agent-workspace/lib/mount-source.js +3 -0
- package/dist/agent-workspace/lib/mount-source.js.map +1 -0
- package/dist/agent-workspace/lib/refid-resolver.d.ts +23 -0
- package/dist/agent-workspace/lib/refid-resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/refid-resolver.js +103 -0
- package/dist/agent-workspace/lib/refid-resolver.js.map +1 -0
- package/dist/agent-workspace/lib/registries.d.ts +30 -0
- package/dist/agent-workspace/lib/registries.d.ts.map +1 -0
- package/dist/agent-workspace/lib/registries.js +88 -0
- package/dist/agent-workspace/lib/registries.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/agent-definition.resolver.d.ts +13 -0
- package/dist/agent-workspace/lib/resolvers/agent-definition.resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/agent-definition.resolver.js +25 -0
- package/dist/agent-workspace/lib/resolvers/agent-definition.resolver.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/artifact-store-collection.resolver.d.ts +13 -0
- package/dist/agent-workspace/lib/resolvers/artifact-store-collection.resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/artifact-store-collection.resolver.js +28 -0
- package/dist/agent-workspace/lib/resolvers/artifact-store-collection.resolver.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/artifact-version.resolver.d.ts +13 -0
- package/dist/agent-workspace/lib/resolvers/artifact-version.resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/artifact-version.resolver.js +25 -0
- package/dist/agent-workspace/lib/resolvers/artifact-version.resolver.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/clients.d.ts +122 -0
- package/dist/agent-workspace/lib/resolvers/clients.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/clients.js +3 -0
- package/dist/agent-workspace/lib/resolvers/clients.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/deliverable-specs.resolver.d.ts +13 -0
- package/dist/agent-workspace/lib/resolvers/deliverable-specs.resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/deliverable-specs.resolver.js +24 -0
- package/dist/agent-workspace/lib/resolvers/deliverable-specs.resolver.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/deliverables.resolver.d.ts +13 -0
- package/dist/agent-workspace/lib/resolvers/deliverables.resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/deliverables.resolver.js +28 -0
- package/dist/agent-workspace/lib/resolvers/deliverables.resolver.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/index.d.ts +20 -0
- package/dist/agent-workspace/lib/resolvers/index.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/index.js +36 -0
- package/dist/agent-workspace/lib/resolvers/index.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/instruction-section.resolver.d.ts +13 -0
- package/dist/agent-workspace/lib/resolvers/instruction-section.resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/instruction-section.resolver.js +22 -0
- package/dist/agent-workspace/lib/resolvers/instruction-section.resolver.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/kb-pages.resolver.d.ts +13 -0
- package/dist/agent-workspace/lib/resolvers/kb-pages.resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/kb-pages.resolver.js +36 -0
- package/dist/agent-workspace/lib/resolvers/kb-pages.resolver.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/kb-space.resolver.d.ts +13 -0
- package/dist/agent-workspace/lib/resolvers/kb-space.resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/kb-space.resolver.js +26 -0
- package/dist/agent-workspace/lib/resolvers/kb-space.resolver.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/rendered-agents-md.resolver.d.ts +13 -0
- package/dist/agent-workspace/lib/resolvers/rendered-agents-md.resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/rendered-agents-md.resolver.js +23 -0
- package/dist/agent-workspace/lib/resolvers/rendered-agents-md.resolver.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/rendered-context-json.resolver.d.ts +13 -0
- package/dist/agent-workspace/lib/resolvers/rendered-context-json.resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/rendered-context-json.resolver.js +24 -0
- package/dist/agent-workspace/lib/resolvers/rendered-context-json.resolver.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/rendered-system-overlay.resolver.d.ts +13 -0
- package/dist/agent-workspace/lib/resolvers/rendered-system-overlay.resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/rendered-system-overlay.resolver.js +23 -0
- package/dist/agent-workspace/lib/resolvers/rendered-system-overlay.resolver.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/scm-repo.resolver.d.ts +13 -0
- package/dist/agent-workspace/lib/resolvers/scm-repo.resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/scm-repo.resolver.js +28 -0
- package/dist/agent-workspace/lib/resolvers/scm-repo.resolver.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/session-attachment.resolver.d.ts +13 -0
- package/dist/agent-workspace/lib/resolvers/session-attachment.resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/session-attachment.resolver.js +28 -0
- package/dist/agent-workspace/lib/resolvers/session-attachment.resolver.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/skill-bundle.resolver.d.ts +13 -0
- package/dist/agent-workspace/lib/resolvers/skill-bundle.resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/skill-bundle.resolver.js +29 -0
- package/dist/agent-workspace/lib/resolvers/skill-bundle.resolver.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/static-literal.resolver.d.ts +11 -0
- package/dist/agent-workspace/lib/resolvers/static-literal.resolver.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/static-literal.resolver.js +33 -0
- package/dist/agent-workspace/lib/resolvers/static-literal.resolver.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/types.d.ts +35 -0
- package/dist/agent-workspace/lib/resolvers/types.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/types.js +3 -0
- package/dist/agent-workspace/lib/resolvers/types.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/utils/agent-run-context-cache.d.ts +70 -0
- package/dist/agent-workspace/lib/resolvers/utils/agent-run-context-cache.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/utils/agent-run-context-cache.js +90 -0
- package/dist/agent-workspace/lib/resolvers/utils/agent-run-context-cache.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/utils/auth.d.ts +5 -0
- package/dist/agent-workspace/lib/resolvers/utils/auth.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/utils/auth.js +19 -0
- package/dist/agent-workspace/lib/resolvers/utils/auth.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/utils/size-cap.d.ts +3 -0
- package/dist/agent-workspace/lib/resolvers/utils/size-cap.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/utils/size-cap.js +23 -0
- package/dist/agent-workspace/lib/resolvers/utils/size-cap.js.map +1 -0
- package/dist/agent-workspace/lib/resolvers/utils/streaming.d.ts +3 -0
- package/dist/agent-workspace/lib/resolvers/utils/streaming.d.ts.map +1 -0
- package/dist/agent-workspace/lib/resolvers/utils/streaming.js +11 -0
- package/dist/agent-workspace/lib/resolvers/utils/streaming.js.map +1 -0
- package/dist/agent-workspace/lib/workspace-renderer.d.ts +13 -0
- package/dist/agent-workspace/lib/workspace-renderer.d.ts.map +1 -0
- package/dist/agent-workspace/lib/workspace-renderer.js +3 -0
- package/dist/agent-workspace/lib/workspace-renderer.js.map +1 -0
- package/dist/api/index.d.ts +11 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +27 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/lib/api-manifest.d.ts +29 -0
- package/dist/api/lib/api-manifest.d.ts.map +1 -0
- package/dist/api/lib/api-manifest.js +28 -0
- package/dist/api/lib/api-manifest.js.map +1 -0
- package/dist/api/lib/biome-db.d.ts +2 -0
- package/dist/api/lib/biome-db.d.ts.map +1 -0
- package/dist/api/lib/biome-db.js +13 -0
- package/dist/api/lib/biome-db.js.map +1 -0
- package/dist/api/lib/code-tool-context.d.ts +16 -0
- package/dist/api/lib/code-tool-context.d.ts.map +1 -0
- package/dist/api/lib/code-tool-context.js +12 -0
- package/dist/api/lib/code-tool-context.js.map +1 -0
- package/dist/api/lib/code-tool-descriptor.d.ts +49 -0
- package/dist/api/lib/code-tool-descriptor.d.ts.map +1 -0
- package/dist/api/lib/code-tool-descriptor.js +3 -0
- package/dist/api/lib/code-tool-descriptor.js.map +1 -0
- package/dist/api/lib/code-tool.decorator.d.ts +17 -0
- package/dist/api/lib/code-tool.decorator.d.ts.map +1 -0
- package/dist/api/lib/code-tool.decorator.js +38 -0
- package/dist/api/lib/code-tool.decorator.js.map +1 -0
- package/dist/api/lib/mutation-context.d.ts +16 -0
- package/dist/api/lib/mutation-context.d.ts.map +1 -0
- package/dist/api/lib/mutation-context.js +17 -0
- package/dist/api/lib/mutation-context.js.map +1 -0
- package/dist/api/lib/pagination.d.ts +8 -0
- package/dist/api/lib/pagination.d.ts.map +1 -0
- package/dist/api/lib/pagination.js +7 -0
- package/dist/api/lib/pagination.js.map +1 -0
- package/dist/api/lib/provider-kind-mirror.d.ts +7 -0
- package/dist/api/lib/provider-kind-mirror.d.ts.map +1 -0
- package/dist/api/lib/provider-kind-mirror.js +11 -0
- package/dist/api/lib/provider-kind-mirror.js.map +1 -0
- package/dist/api/lib/request-context.d.ts +21 -0
- package/dist/api/lib/request-context.d.ts.map +1 -0
- package/dist/api/lib/request-context.js +51 -0
- package/dist/api/lib/request-context.js.map +1 -0
- package/dist/api/lib/route-registry-entry.d.ts +11 -0
- package/dist/api/lib/route-registry-entry.d.ts.map +1 -0
- package/dist/api/lib/route-registry-entry.js +3 -0
- package/dist/api/lib/route-registry-entry.js.map +1 -0
- package/dist/api/nest/controller-base.d.ts +6 -0
- package/dist/api/nest/controller-base.d.ts.map +1 -0
- package/dist/api/nest/controller-base.js +28 -0
- package/dist/api/nest/controller-base.js.map +1 -0
- package/dist/api/nest/events/events.controller.d.ts +10 -0
- package/dist/api/nest/events/events.controller.d.ts.map +1 -0
- package/dist/api/nest/events/events.controller.js +56 -0
- package/dist/api/nest/events/events.controller.js.map +1 -0
- package/dist/api/nest/health/health.controller.d.ts +19 -0
- package/dist/api/nest/health/health.controller.d.ts.map +1 -0
- package/dist/api/nest/health/health.controller.js +63 -0
- package/dist/api/nest/health/health.controller.js.map +1 -0
- package/dist/api/nest/health/health.module.d.ts +6 -0
- package/dist/api/nest/health/health.module.d.ts.map +1 -0
- package/dist/api/nest/health/health.module.js +29 -0
- package/dist/api/nest/health/health.module.js.map +1 -0
- package/dist/api/nest/index.d.ts +7 -0
- package/dist/api/nest/index.d.ts.map +1 -0
- package/dist/api/nest/index.js +23 -0
- package/dist/api/nest/index.js.map +1 -0
- package/dist/api/nest/module.d.ts +6 -0
- package/dist/api/nest/module.d.ts.map +1 -0
- package/dist/api/nest/module.js +34 -0
- package/dist/api/nest/module.js.map +1 -0
- package/dist/api/nest/request-context.d.ts +17 -0
- package/dist/api/nest/request-context.d.ts.map +1 -0
- package/dist/api/nest/request-context.js +75 -0
- package/dist/api/nest/request-context.js.map +1 -0
- package/dist/builder/index.d.ts +7 -0
- package/dist/builder/index.d.ts.map +1 -0
- package/dist/builder/index.js +23 -0
- package/dist/builder/index.js.map +1 -0
- package/dist/builder/lib/content-walker.d.ts +27 -0
- package/dist/builder/lib/content-walker.d.ts.map +1 -0
- package/dist/builder/lib/content-walker.js +274 -0
- package/dist/builder/lib/content-walker.js.map +1 -0
- package/dist/builder/lib/contribution-schemas.d.ts +348 -0
- package/dist/builder/lib/contribution-schemas.d.ts.map +1 -0
- package/dist/builder/lib/contribution-schemas.js +301 -0
- package/dist/builder/lib/contribution-schemas.js.map +1 -0
- package/dist/builder/lib/define-biome.d.ts +17 -0
- package/dist/builder/lib/define-biome.d.ts.map +1 -0
- package/dist/builder/lib/define-biome.js +11 -0
- package/dist/builder/lib/define-biome.js.map +1 -0
- package/dist/builder/lib/define-helpers.d.ts +6 -0
- package/dist/builder/lib/define-helpers.d.ts.map +1 -0
- package/dist/builder/lib/define-helpers.js +20 -0
- package/dist/builder/lib/define-helpers.js.map +1 -0
- package/dist/builder/lib/extends-precedence.d.ts +14 -0
- package/dist/builder/lib/extends-precedence.d.ts.map +1 -0
- package/dist/builder/lib/extends-precedence.js +113 -0
- package/dist/builder/lib/extends-precedence.js.map +1 -0
- package/dist/builder/lib/workflow-phase-config-loader.d.ts +18 -0
- package/dist/builder/lib/workflow-phase-config-loader.d.ts.map +1 -0
- package/dist/builder/lib/workflow-phase-config-loader.js +78 -0
- package/dist/builder/lib/workflow-phase-config-loader.js.map +1 -0
- package/dist/host/index.d.ts +11 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +38 -0
- package/dist/host/index.js.map +1 -0
- package/dist/host/lib/agents-cross-validate.d.ts +7 -0
- package/dist/host/lib/agents-cross-validate.d.ts.map +1 -0
- package/dist/host/lib/agents-cross-validate.js +157 -0
- package/dist/host/lib/agents-cross-validate.js.map +1 -0
- package/dist/host/lib/biome-manifest.d.ts +808 -0
- package/dist/host/lib/biome-manifest.d.ts.map +1 -0
- package/dist/host/lib/biome-manifest.js +490 -0
- package/dist/host/lib/biome-manifest.js.map +1 -0
- package/dist/host/lib/bootstrap-contributions-service.d.ts +35 -0
- package/dist/host/lib/bootstrap-contributions-service.d.ts.map +1 -0
- package/dist/host/lib/bootstrap-contributions-service.js +79 -0
- package/dist/host/lib/bootstrap-contributions-service.js.map +1 -0
- package/dist/host/lib/default-state.d.ts +3 -0
- package/dist/host/lib/default-state.d.ts.map +1 -0
- package/dist/host/lib/default-state.js +20 -0
- package/dist/host/lib/default-state.js.map +1 -0
- package/dist/host/lib/integration-cross-validate.d.ts +12 -0
- package/dist/host/lib/integration-cross-validate.d.ts.map +1 -0
- package/dist/host/lib/integration-cross-validate.js +66 -0
- package/dist/host/lib/integration-cross-validate.js.map +1 -0
- package/dist/host/lib/system-overlay-contribution.d.ts +14 -0
- package/dist/host/lib/system-overlay-contribution.d.ts.map +1 -0
- package/dist/host/lib/system-overlay-contribution.js +3 -0
- package/dist/host/lib/system-overlay-contribution.js.map +1 -0
- package/dist/host/lib/topology.d.ts +7 -0
- package/dist/host/lib/topology.d.ts.map +1 -0
- package/dist/host/lib/topology.js +105 -0
- package/dist/host/lib/topology.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestrator-adapter/index.d.ts +3 -0
- package/dist/orchestrator-adapter/index.d.ts.map +1 -0
- package/dist/orchestrator-adapter/index.js +19 -0
- package/dist/orchestrator-adapter/index.js.map +1 -0
- package/dist/orchestrator-adapter/lib/orchestrator-adapter-registry.d.ts +6 -0
- package/dist/orchestrator-adapter/lib/orchestrator-adapter-registry.d.ts.map +1 -0
- package/dist/orchestrator-adapter/lib/orchestrator-adapter-registry.js +11 -0
- package/dist/orchestrator-adapter/lib/orchestrator-adapter-registry.js.map +1 -0
- package/dist/orchestrator-adapter/lib/orchestrator-adapter.d.ts +11 -0
- package/dist/orchestrator-adapter/lib/orchestrator-adapter.d.ts.map +1 -0
- package/dist/orchestrator-adapter/lib/orchestrator-adapter.js +3 -0
- package/dist/orchestrator-adapter/lib/orchestrator-adapter.js.map +1 -0
- package/package.json +110 -0
- package/src/adapter/index.ts +6 -0
- package/src/adapter/lib/action.ts +60 -0
- package/src/adapter/lib/provider-module.ts +140 -0
- package/src/adapter/lib/resource.ts +52 -0
- package/src/adapter/lib/result.ts +53 -0
- package/src/adapter/lib/sidecar-contract.ts +169 -0
- package/src/adapter/lib/webhook.ts +142 -0
- package/src/agent-workspace/index.ts +7 -0
- package/src/agent-workspace/lib/errors/error-codes.ts +44 -0
- package/src/agent-workspace/lib/errors/index.ts +3 -0
- package/src/agent-workspace/lib/errors/mount-plan-error.ts +29 -0
- package/src/agent-workspace/lib/errors/mount-resolver-error.ts +56 -0
- package/src/agent-workspace/lib/mount-resolver.ts +35 -0
- package/src/agent-workspace/lib/mount-source.ts +11 -0
- package/src/agent-workspace/lib/refid-resolver.ts +135 -0
- package/src/agent-workspace/lib/registries.ts +150 -0
- package/src/agent-workspace/lib/resolvers/agent-definition.resolver.ts +45 -0
- package/src/agent-workspace/lib/resolvers/artifact-store-collection.resolver.ts +43 -0
- package/src/agent-workspace/lib/resolvers/artifact-version.resolver.ts +52 -0
- package/src/agent-workspace/lib/resolvers/clients.ts +297 -0
- package/src/agent-workspace/lib/resolvers/deliverable-specs.resolver.ts +33 -0
- package/src/agent-workspace/lib/resolvers/deliverables.resolver.ts +41 -0
- package/src/agent-workspace/lib/resolvers/index.ts +19 -0
- package/src/agent-workspace/lib/resolvers/instruction-section.resolver.ts +36 -0
- package/src/agent-workspace/lib/resolvers/kb-pages.resolver.ts +62 -0
- package/src/agent-workspace/lib/resolvers/kb-space.resolver.ts +34 -0
- package/src/agent-workspace/lib/resolvers/rendered-agents-md.resolver.ts +40 -0
- package/src/agent-workspace/lib/resolvers/rendered-context-json.resolver.ts +41 -0
- package/src/agent-workspace/lib/resolvers/rendered-system-overlay.resolver.ts +39 -0
- package/src/agent-workspace/lib/resolvers/scm-repo.resolver.ts +43 -0
- package/src/agent-workspace/lib/resolvers/session-attachment.resolver.ts +37 -0
- package/src/agent-workspace/lib/resolvers/skill-bundle.resolver.ts +42 -0
- package/src/agent-workspace/lib/resolvers/static-literal.resolver.ts +69 -0
- package/src/agent-workspace/lib/resolvers/types.ts +94 -0
- package/src/agent-workspace/lib/resolvers/utils/agent-run-context-cache.ts +206 -0
- package/src/agent-workspace/lib/resolvers/utils/auth.ts +39 -0
- package/src/agent-workspace/lib/resolvers/utils/size-cap.ts +38 -0
- package/src/agent-workspace/lib/resolvers/utils/streaming.ts +22 -0
- package/src/agent-workspace/lib/workspace-renderer.ts +25 -0
- package/src/api/index.ts +10 -0
- package/src/api/lib/api-manifest.ts +54 -0
- package/src/api/lib/biome-db.ts +28 -0
- package/src/api/lib/code-tool-context.ts +45 -0
- package/src/api/lib/code-tool-descriptor.ts +102 -0
- package/src/api/lib/code-tool.decorator.ts +111 -0
- package/src/api/lib/mutation-context.ts +49 -0
- package/src/api/lib/pagination.ts +17 -0
- package/src/api/lib/provider-kind-mirror.ts +16 -0
- package/src/api/lib/request-context.ts +90 -0
- package/src/api/lib/route-registry-entry.ts +35 -0
- package/src/api/nest/controller-base.ts +59 -0
- package/src/api/nest/events/events.controller.ts +48 -0
- package/src/api/nest/health/health.controller.ts +36 -0
- package/src/api/nest/health/health.module.ts +29 -0
- package/src/api/nest/index.ts +6 -0
- package/src/api/nest/module.ts +51 -0
- package/src/api/nest/request-context.ts +166 -0
- package/src/builder/index.ts +26 -0
- package/src/builder/lib/content-walker.ts +383 -0
- package/src/builder/lib/contribution-schemas.ts +572 -0
- package/src/builder/lib/define-biome.ts +84 -0
- package/src/builder/lib/define-helpers.ts +42 -0
- package/src/builder/lib/extends-precedence.ts +195 -0
- package/src/builder/lib/workflow-phase-config-loader.ts +163 -0
- package/src/host/index.ts +39 -0
- package/src/host/lib/agents-cross-validate.ts +283 -0
- package/src/host/lib/biome-manifest.ts +1060 -0
- package/src/host/lib/bootstrap-contributions-service.ts +233 -0
- package/src/host/lib/default-state.ts +40 -0
- package/src/host/lib/integration-cross-validate.ts +140 -0
- package/src/host/lib/system-overlay-contribution.ts +53 -0
- package/src/host/lib/topology.ts +174 -0
- package/src/index.ts +58 -0
- package/src/orchestrator-adapter/index.ts +2 -0
- package/src/orchestrator-adapter/lib/orchestrator-adapter-registry.ts +8 -0
- package/src/orchestrator-adapter/lib/orchestrator-adapter.ts +20 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
2
|
+
// `BootstrapContributionsService<TKind, TManifest>` — the generic template
|
|
3
|
+
// that replaces the 14 hand-rolled `*Seeder*Service` classes scattered
|
|
4
|
+
// across `apps/`.
|
|
5
|
+
//
|
|
6
|
+
// Plan-of-record: Phase C.3 of
|
|
7
|
+
// `.claude/plans/following-up-the-xema-os-plan-md-abstract-stream.md`.
|
|
8
|
+
//
|
|
9
|
+
// Why this template exists
|
|
10
|
+
// ------------------------
|
|
11
|
+
// Adding a new content kind takes exactly:
|
|
12
|
+
// - one enum entry in `ContributionKind`,
|
|
13
|
+
// - one Zod schema in the kind-specific contracts package,
|
|
14
|
+
// - one tiny `ContributionKindHandler` implementation,
|
|
15
|
+
// - one `BootstrapContributionsService` subclass that injects the
|
|
16
|
+
// handler and the contribution source.
|
|
17
|
+
//
|
|
18
|
+
// Framework agnosticism
|
|
19
|
+
// ---------------------
|
|
20
|
+
// The SDK is published as zero-runtime-dep TypeScript. We deliberately
|
|
21
|
+
// avoid `@nestjs/common` at this layer so the template is reusable by:
|
|
22
|
+
// - NestJS services (via a thin `onApplicationBootstrap` adapter),
|
|
23
|
+
// - the future `xema-kernel-server` (which does not run NestJS for the
|
|
24
|
+
// bootstrap phase),
|
|
25
|
+
// - test harnesses that exercise contributions in isolation.
|
|
26
|
+
//
|
|
27
|
+
// The contract is a single async method `bootstrap()` that callers may
|
|
28
|
+
// hook into `onApplicationBootstrap` / `OnModuleInit` / `main()` as they
|
|
29
|
+
// see fit.
|
|
30
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
31
|
+
|
|
32
|
+
import {
|
|
33
|
+
type Contribution,
|
|
34
|
+
type ContributionIngestContext,
|
|
35
|
+
type ContributionKind,
|
|
36
|
+
type ContributionKindHandler,
|
|
37
|
+
AnyContributionEnvelopeSchema,
|
|
38
|
+
} from '@xemahq/kernel-contracts/contribution';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Provenance metadata for a single contribution envelope discovered during
|
|
42
|
+
* boot. Subclasses produce these in `loadContributions()`; the template
|
|
43
|
+
* stamps them through to the handler's `ingest` ctx.
|
|
44
|
+
*
|
|
45
|
+
* `envelope` is left `unknown` on purpose — the bootstrap loop validates
|
|
46
|
+
* shape via `AnyContributionEnvelopeSchema` and the kind-specific manifest
|
|
47
|
+
* via the handler's `manifestSchema`. Callers MUST NOT pre-cast.
|
|
48
|
+
*/
|
|
49
|
+
export interface DiscoveredContribution {
|
|
50
|
+
readonly envelope: unknown;
|
|
51
|
+
readonly biomeId: string;
|
|
52
|
+
readonly biomeVersion: string;
|
|
53
|
+
/** Optional human-readable origin string (path, URL). Diagnostics only. */
|
|
54
|
+
readonly origin?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Outcome of a single `bootstrap()` pass. Returned for observability —
|
|
59
|
+
* callers may log it, surface it through `/doctor`, or assert against it
|
|
60
|
+
* in tests.
|
|
61
|
+
*/
|
|
62
|
+
export interface BootstrapContributionsResult {
|
|
63
|
+
readonly kind: ContributionKind;
|
|
64
|
+
readonly ingested: number;
|
|
65
|
+
readonly rejected: readonly BootstrapContributionsRejection[];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface BootstrapContributionsRejection {
|
|
69
|
+
readonly biomeId: string;
|
|
70
|
+
readonly origin: string | undefined;
|
|
71
|
+
readonly reason: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Error thrown when the bootstrap loop encounters a malformed envelope or
|
|
76
|
+
* a manifest that fails its kind-specific Zod schema. The template fails
|
|
77
|
+
* fast (throws) by default — consumers that prefer best-effort ingestion
|
|
78
|
+
* can override `onRejection` to swallow errors and accumulate rejections
|
|
79
|
+
* instead.
|
|
80
|
+
*/
|
|
81
|
+
export class BootstrapContributionsError extends Error {
|
|
82
|
+
public readonly biomeId: string;
|
|
83
|
+
public readonly origin: string | undefined;
|
|
84
|
+
public override readonly cause: unknown;
|
|
85
|
+
|
|
86
|
+
public constructor(args: {
|
|
87
|
+
message: string;
|
|
88
|
+
biomeId: string;
|
|
89
|
+
origin?: string;
|
|
90
|
+
cause?: unknown;
|
|
91
|
+
}) {
|
|
92
|
+
super(args.message);
|
|
93
|
+
this.name = 'BootstrapContributionsError';
|
|
94
|
+
this.biomeId = args.biomeId;
|
|
95
|
+
this.origin = args.origin;
|
|
96
|
+
this.cause = args.cause;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Generic boot-time template. Subclasses provide:
|
|
102
|
+
* 1. `handler` — the per-kind ingestion handler (with Zod schema).
|
|
103
|
+
* 2. `loadContributions()` — discover candidate envelopes from disk,
|
|
104
|
+
* biome manifests, or a fixture set.
|
|
105
|
+
*
|
|
106
|
+
* The template owns the validation + dispatch loop. Implementations of
|
|
107
|
+
* `handler.ingest` may assume the envelope is fully type-checked.
|
|
108
|
+
*
|
|
109
|
+
* Idempotency note
|
|
110
|
+
* ----------------
|
|
111
|
+
* The template re-walks contributions on every `bootstrap()` call. Handlers
|
|
112
|
+
* MUST treat duplicate registrations as no-ops or fail-fast on
|
|
113
|
+
* conflict — the template does NOT dedupe across calls.
|
|
114
|
+
*/
|
|
115
|
+
export abstract class BootstrapContributionsService<
|
|
116
|
+
TKind extends ContributionKind,
|
|
117
|
+
TManifest,
|
|
118
|
+
> {
|
|
119
|
+
protected abstract readonly handler: ContributionKindHandler<TManifest, TKind>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Discover candidate envelopes. Subclasses typically scan biome
|
|
123
|
+
* `contributions/` directories or read a JSON manifest; tests may return
|
|
124
|
+
* an in-memory fixture set.
|
|
125
|
+
*
|
|
126
|
+
* Envelopes that do not match `handler.kind` are SILENTLY ignored by
|
|
127
|
+
* the dispatcher — the template assumes the caller is a kind-specific
|
|
128
|
+
* service that loads ALL contributions and filters by kind itself. This
|
|
129
|
+
* is intentional: the same `contributions/` directory feeds many
|
|
130
|
+
* handlers, and forcing every loader to pre-filter would duplicate the
|
|
131
|
+
* walk logic in every subclass.
|
|
132
|
+
*/
|
|
133
|
+
protected abstract loadContributions(): Promise<readonly DiscoveredContribution[]>;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Run the bootstrap pass. Designed to be called from NestJS's
|
|
137
|
+
* `onApplicationBootstrap` (after every provider is ready) or from a
|
|
138
|
+
* standalone process's `main()`. Returns the ingestion result so
|
|
139
|
+
* callers can log / assert against it.
|
|
140
|
+
*/
|
|
141
|
+
public async bootstrap(): Promise<BootstrapContributionsResult> {
|
|
142
|
+
const discovered = await this.loadContributions();
|
|
143
|
+
const rejected: BootstrapContributionsRejection[] = [];
|
|
144
|
+
let ingested = 0;
|
|
145
|
+
|
|
146
|
+
for (const candidate of discovered) {
|
|
147
|
+
const envelopeParse = AnyContributionEnvelopeSchema.safeParse(
|
|
148
|
+
candidate.envelope,
|
|
149
|
+
);
|
|
150
|
+
if (!envelopeParse.success) {
|
|
151
|
+
await this.onRejection(
|
|
152
|
+
{
|
|
153
|
+
biomeId: candidate.biomeId,
|
|
154
|
+
origin: candidate.origin,
|
|
155
|
+
reason: `envelope shape invalid: ${envelopeParse.error.message}`,
|
|
156
|
+
},
|
|
157
|
+
rejected,
|
|
158
|
+
);
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const envelope = envelopeParse.data;
|
|
163
|
+
if (envelope.kind !== this.handler.kind) {
|
|
164
|
+
// Cross-kind envelope intentionally ignored — see `loadContributions`
|
|
165
|
+
// doc-comment.
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const manifestParse = this.handler.manifestSchema.safeParse(
|
|
170
|
+
envelope.manifest,
|
|
171
|
+
);
|
|
172
|
+
if (!manifestParse.success) {
|
|
173
|
+
await this.onRejection(
|
|
174
|
+
{
|
|
175
|
+
biomeId: candidate.biomeId,
|
|
176
|
+
origin: candidate.origin,
|
|
177
|
+
reason: `manifest invalid for kind "${envelope.kind}": ${manifestParse.error.message}`,
|
|
178
|
+
},
|
|
179
|
+
rejected,
|
|
180
|
+
);
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const typedContribution: Contribution<TKind, TManifest> = {
|
|
185
|
+
kind: this.handler.kind,
|
|
186
|
+
slug: envelope.slug,
|
|
187
|
+
source: envelope.source,
|
|
188
|
+
version: envelope.version,
|
|
189
|
+
manifest: manifestParse.data,
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
const ctx: ContributionIngestContext = {
|
|
193
|
+
biomeId: candidate.biomeId,
|
|
194
|
+
biomeVersion: candidate.biomeVersion,
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
await this.handler.ingest(typedContribution, ctx);
|
|
198
|
+
ingested += 1;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return {
|
|
202
|
+
kind: this.handler.kind,
|
|
203
|
+
ingested,
|
|
204
|
+
rejected,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Default rejection policy — fail-fast. Throws a structured error that
|
|
210
|
+
* carries the biome id and origin for diagnostics. Subclasses MAY
|
|
211
|
+
* override to accumulate rejections instead of throwing (e.g. a
|
|
212
|
+
* non-mandatory biome whose contribution failed validation should not
|
|
213
|
+
* take down the whole boot).
|
|
214
|
+
*/
|
|
215
|
+
protected async onRejection(
|
|
216
|
+
rejection: BootstrapContributionsRejection,
|
|
217
|
+
accumulator: BootstrapContributionsRejection[],
|
|
218
|
+
): Promise<void> {
|
|
219
|
+
accumulator.push(rejection);
|
|
220
|
+
const errorArgs: {
|
|
221
|
+
message: string;
|
|
222
|
+
biomeId: string;
|
|
223
|
+
origin?: string;
|
|
224
|
+
} = {
|
|
225
|
+
message: `Contribution rejected for kind "${this.handler.kind}" from biome "${rejection.biomeId}": ${rejection.reason}`,
|
|
226
|
+
biomeId: rejection.biomeId,
|
|
227
|
+
};
|
|
228
|
+
if (rejection.origin !== undefined) {
|
|
229
|
+
errorArgs.origin = rejection.origin;
|
|
230
|
+
}
|
|
231
|
+
throw new BootstrapContributionsError(errorArgs);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { BiomeManifest } from './biome-manifest';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Pure resolver: given a biome manifest, returns whether it should be
|
|
5
|
+
* enabled by default in the absence of any per-org override. Used by
|
|
6
|
+
* `biome-host-api`'s state resolver and (in Phase 2) by the IaC
|
|
7
|
+
* reconciler to compute the seed state of a new install.
|
|
8
|
+
*
|
|
9
|
+
* Rules:
|
|
10
|
+
* - mandatory biomes (kernel + any explicitly mandatory) always
|
|
11
|
+
* resolve to enabled — defence-in-depth alongside the boot guard
|
|
12
|
+
* and write-time refusal of `disable` on mandatory biomes.
|
|
13
|
+
* - kernel, system, base, and platform scopes default to enabled.
|
|
14
|
+
* `system` biomes (Wave 18 — the systemd / dbus / sshd / libc
|
|
15
|
+
* analogues) are the always-on userspace base that every base and
|
|
16
|
+
* domain biome assumes is present; defaulting them to disabled would
|
|
17
|
+
* be like shipping a Linux box with dbus masked. Base biomes (L2.5 —
|
|
18
|
+
* Wave 16E-3) are foundational primitives any biome may depend on;
|
|
19
|
+
* disabling one would break every domain biome that consumes it.
|
|
20
|
+
* - `system` here means "on by tier"; the *undisableable* subset is
|
|
21
|
+
* expressed orthogonally by `mandatory: true` (the dbus-vs-sshd
|
|
22
|
+
* distinction — a system biome may still be admin-disabled unless it
|
|
23
|
+
* also declares `mandatory`). See `enablement-resolver`'s
|
|
24
|
+
* `computeFixedReason`.
|
|
25
|
+
* - third-party defaults to disabled until install (Phase 4).
|
|
26
|
+
*
|
|
27
|
+
* No silent fallback — an unknown scope is a programmer error and
|
|
28
|
+
* resolves to `false`, which surfaces in the admin UI as "disabled by
|
|
29
|
+
* default" rather than silently defaulting to enabled.
|
|
30
|
+
*/
|
|
31
|
+
export function defaultEnabledFor(manifest: BiomeManifest): boolean {
|
|
32
|
+
const xema = manifest.xema;
|
|
33
|
+
if (xema.mandatory === true) return true;
|
|
34
|
+
if (xema.scope === 'kernel') return true;
|
|
35
|
+
if (xema.scope === 'system') return true;
|
|
36
|
+
if (xema.scope === 'base') return true;
|
|
37
|
+
if (xema.scope === 'platform') return true;
|
|
38
|
+
if (xema.scope === 'third-party') return false;
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import {
|
|
2
|
+
collectFilterExprPathRefs,
|
|
3
|
+
isAllowedEnvelopePath,
|
|
4
|
+
type AdapterKindRef,
|
|
5
|
+
} from '@xemahq/kernel-contracts/connector';
|
|
6
|
+
|
|
7
|
+
import type { ServerBiomeManifest, WebhookFilter } from './biome-manifest';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Subset of `WorkflowDocument` (from `@xemahq/dsl/workflow`) this
|
|
11
|
+
* validator needs. We avoid importing the DSL here so this SDK stays
|
|
12
|
+
* dependency-free at the kernel layer; the caller passes already-parsed
|
|
13
|
+
* workflow documents.
|
|
14
|
+
*/
|
|
15
|
+
export interface ShippedWorkflowSummary {
|
|
16
|
+
/** The id used inside the YAML's `metadata.name`. */
|
|
17
|
+
readonly id: string;
|
|
18
|
+
/** The webhook event slugs declared under `on.webhook[].event`. */
|
|
19
|
+
readonly webhookEvents: readonly string[];
|
|
20
|
+
/**
|
|
21
|
+
* The `requires.integrations[].adapterKind` slugs the workflow asks
|
|
22
|
+
* for. May be empty for workflows that don't touch external systems.
|
|
23
|
+
*/
|
|
24
|
+
readonly requiredAdapterKinds: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export class IntegrationCrossValidationError extends Error {
|
|
28
|
+
readonly issues: readonly string[];
|
|
29
|
+
constructor(biomeId: string, issues: readonly string[]) {
|
|
30
|
+
super(
|
|
31
|
+
`biome "${biomeId}": integration cross-validation failed:\n - ${issues.join('\n - ')}`,
|
|
32
|
+
);
|
|
33
|
+
this.name = 'IntegrationCrossValidationError';
|
|
34
|
+
this.issues = issues;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Cross-check a server biome manifest against the workflow documents
|
|
40
|
+
* it ships. Fails fast on the four invariants the plan locks in:
|
|
41
|
+
*
|
|
42
|
+
* 1. Every workflow's `requires.integrations[].adapterKind` MUST be
|
|
43
|
+
* declared in the manifest's `integrationRequirements[]`.
|
|
44
|
+
* 2. Every `webhookFilters[].workflowId` MUST resolve to a shipped
|
|
45
|
+
* workflow id.
|
|
46
|
+
* 3. Every `webhookFilters[].event` MUST appear in the referenced
|
|
47
|
+
* workflow's `on.webhook[].event` set.
|
|
48
|
+
* 4. A manifest with `webhookFilters` MUST also declare at least one
|
|
49
|
+
* `integrationRequirements` entry. (Shape rule the Zod schema
|
|
50
|
+
* already enforces; restated here so the error message lands on
|
|
51
|
+
* the biome-host boot path instead of the parse path.)
|
|
52
|
+
*
|
|
53
|
+
* Returns nothing on success; throws `IntegrationCrossValidationError`
|
|
54
|
+
* with the full issue list on failure so biome-host refuses to start
|
|
55
|
+
* with all problems reported at once.
|
|
56
|
+
*/
|
|
57
|
+
export function crossValidateIntegrationContract(
|
|
58
|
+
manifest: ServerBiomeManifest,
|
|
59
|
+
workflows: readonly ShippedWorkflowSummary[],
|
|
60
|
+
): void {
|
|
61
|
+
const issues: string[] = [];
|
|
62
|
+
const requirements = manifest.xema.integrationRequirements ?? [];
|
|
63
|
+
const webhookFilters: readonly WebhookFilter[] = manifest.xema.webhookFilters ?? [];
|
|
64
|
+
const requirementKinds = new Set(requirements.map((r) => r.adapterKind));
|
|
65
|
+
const workflowsById = new Map(workflows.map((w) => [w.id, w]));
|
|
66
|
+
|
|
67
|
+
// (1) workflow requires.integrations ⊆ manifest integrationRequirements
|
|
68
|
+
for (const workflow of workflows) {
|
|
69
|
+
for (const kind of workflow.requiredAdapterKinds) {
|
|
70
|
+
if (!requirementKinds.has(kind)) {
|
|
71
|
+
issues.push(
|
|
72
|
+
`workflow "${workflow.id}" declares requires.integrations.adapterKind="${kind}" ` +
|
|
73
|
+
`but the manifest does not list it under integrationRequirements`,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// (2) + (3) webhookFilters reference real (workflowId, event) pairs
|
|
80
|
+
// (4) every $envelope path in the predicate is permitted for at
|
|
81
|
+
// least one of the workflow's required AdapterKinds — fails fast
|
|
82
|
+
// on typos like `$envelope.branchName` (real field: `branch`).
|
|
83
|
+
for (const filter of webhookFilters) {
|
|
84
|
+
const workflow = workflowsById.get(filter.workflowId);
|
|
85
|
+
if (!workflow) {
|
|
86
|
+
issues.push(
|
|
87
|
+
`webhookFilters entry references workflowId="${filter.workflowId}" ` +
|
|
88
|
+
`which is not among the shipped workflows`,
|
|
89
|
+
);
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (!workflow.webhookEvents.includes(filter.event)) {
|
|
93
|
+
issues.push(
|
|
94
|
+
`webhookFilters entry for workflow "${filter.workflowId}" references event="${filter.event}" ` +
|
|
95
|
+
`which is not declared under that workflow's on.webhook[].event set ` +
|
|
96
|
+
`(known events: ${workflow.webhookEvents.join(', ') || '(none)'})`,
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
collectPredicatePathIssues(filter, workflow.requiredAdapterKinds, issues);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (issues.length > 0) {
|
|
103
|
+
throw new IntegrationCrossValidationError(manifest.xema.id, issues);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Walk the filter's predicate AST and push an issue for every
|
|
109
|
+
* `$envelope.<path>` that none of the workflow's required adapter
|
|
110
|
+
* kinds accepts. Workflows declaring zero `requires.integrations[]`
|
|
111
|
+
* skip path validation — there is no schema to check against. Biome-
|
|
112
|
+
* contributed adapter kinds whose schema isn't registered fall back
|
|
113
|
+
* to "allow" inside `isAllowedEnvelopePath`, so this only catches the
|
|
114
|
+
* built-in-kind typo class.
|
|
115
|
+
*/
|
|
116
|
+
function collectPredicatePathIssues(
|
|
117
|
+
filter: WebhookFilter,
|
|
118
|
+
requiredAdapterKinds: readonly AdapterKindRef[],
|
|
119
|
+
issues: string[],
|
|
120
|
+
): void {
|
|
121
|
+
if (requiredAdapterKinds.length === 0) return;
|
|
122
|
+
const entityKind = filter.entityKind;
|
|
123
|
+
const paths = collectFilterExprPathRefs(filter.predicate);
|
|
124
|
+
for (const ref of paths) {
|
|
125
|
+
if (ref.source !== '$envelope') continue;
|
|
126
|
+
const acceptedBy = requiredAdapterKinds.filter((kind) =>
|
|
127
|
+
isAllowedEnvelopePath(kind, ref.path, entityKind),
|
|
128
|
+
);
|
|
129
|
+
if (acceptedBy.length === 0) {
|
|
130
|
+
const scope = entityKind
|
|
131
|
+
? `(adapterKind in [${requiredAdapterKinds.join(', ')}], entityKind="${entityKind}")`
|
|
132
|
+
: `any required adapterKind (${requiredAdapterKinds.join(', ')})`;
|
|
133
|
+
issues.push(
|
|
134
|
+
`webhookFilters entry for workflow "${filter.workflowId}" event="${filter.event}" ` +
|
|
135
|
+
`references $envelope.${ref.path} which is not a known field on the canonical ` +
|
|
136
|
+
`envelope for ${scope}`,
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
2
|
+
// ── Biome extension surface: system-overlay contributions ──
|
|
3
|
+
//
|
|
4
|
+
// Pluggable section-2c entries for the LLM-readable Xema system overlay
|
|
5
|
+
// (`/workspace/.xema/system-overlay.md`). A first- or third-party biome
|
|
6
|
+
// may register one or more contributions to inject domain-specific
|
|
7
|
+
// platform rules (compliance overlays, sub-app envelopes, …) into every
|
|
8
|
+
// Xema run that loads the biome.
|
|
9
|
+
//
|
|
10
|
+
// Biomes declare this module by listing `systemOverlayContributions`
|
|
11
|
+
// in `xema.ships.modules[]` of their `xema-biome.json`. The convention
|
|
12
|
+
// loads `<biomeRoot>/dist/system-overlay-contributions/index.js`; its
|
|
13
|
+
// default export is an array of `SystemOverlayContribution`s. The
|
|
14
|
+
// biome-host merges every contribution into the composer's section-2c
|
|
15
|
+
// phase, sorted by `priority` (descending).
|
|
16
|
+
//
|
|
17
|
+
// Contributions are rendered as plain markdown — the composer adds no
|
|
18
|
+
// section header beyond what the contribution itself emits.
|
|
19
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Minimal run-context handed to a contribution's `render`. Kept narrow
|
|
23
|
+
* so the contribution stays a pure function of its declared inputs;
|
|
24
|
+
* adding new fields here is an opt-in, additive change.
|
|
25
|
+
*/
|
|
26
|
+
export interface SystemOverlayRunContext {
|
|
27
|
+
readonly orgId: string;
|
|
28
|
+
readonly projectId: string | null;
|
|
29
|
+
readonly role: string;
|
|
30
|
+
readonly surface: string;
|
|
31
|
+
readonly phaseKey: string | null;
|
|
32
|
+
readonly runId: string | null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* One section that a biome contributes to system overlay 2c.
|
|
37
|
+
*
|
|
38
|
+
* `render` returns either a non-empty string (markdown) or `null` when
|
|
39
|
+
* the contribution does not apply to the current run. The composer skips
|
|
40
|
+
* `null` outputs entirely; an empty string is treated as a contribution
|
|
41
|
+
* misconfiguration and refused (use `null` for "skip").
|
|
42
|
+
*/
|
|
43
|
+
export interface SystemOverlayContribution {
|
|
44
|
+
/** Stable id for the contribution; used for diagnostics + dedup. */
|
|
45
|
+
readonly id: string;
|
|
46
|
+
/**
|
|
47
|
+
* Higher numbers render earlier within section 2c. Default-ranked
|
|
48
|
+
* contributions should pick a priority in the 0–999 range; reserve
|
|
49
|
+
* ≥1000 for platform-critical rules (e.g. legal/compliance).
|
|
50
|
+
*/
|
|
51
|
+
readonly priority: number;
|
|
52
|
+
readonly render: (ctx: SystemOverlayRunContext) => string | null;
|
|
53
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import type { BiomeManifest, ServerBiomeManifest } from './biome-manifest';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Tier order for boot-time ordering: kernel boots first, then system,
|
|
5
|
+
* then base, then platform, then third-party. Used to bias the
|
|
6
|
+
* topological-sort visit order so the resulting boot sequence is stable
|
|
7
|
+
* across different valid topo-sorts.
|
|
8
|
+
*
|
|
9
|
+
* Plan-of-record v4.6 §22.5.7 ("Linux-faithful" model): `system` biomes
|
|
10
|
+
* (Wave 18) sit between kernel and base — the systemd / dbus / sshd /
|
|
11
|
+
* libc analogues. Base biomes (L2.5) sit between system and platform.
|
|
12
|
+
* Domain biomes may depend on every layer below them; lower layers MUST
|
|
13
|
+
* NOT depend on higher layers.
|
|
14
|
+
*/
|
|
15
|
+
export const TIER_ORDER: Readonly<Record<string, number>> = {
|
|
16
|
+
kernel: 0,
|
|
17
|
+
system: 1,
|
|
18
|
+
base: 2,
|
|
19
|
+
platform: 3,
|
|
20
|
+
'third-party': 4,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* For each scope, the set of scopes a biome of that scope MAY depend on.
|
|
25
|
+
* Plan-of-record v4.6 §22.5.8 dependency rules:
|
|
26
|
+
* - kernel → kernel only
|
|
27
|
+
* - system → kernel, system
|
|
28
|
+
* - base → kernel, system, base
|
|
29
|
+
* - platform → kernel, system, base, platform
|
|
30
|
+
* - third-party → kernel, system, base, platform, third-party
|
|
31
|
+
*/
|
|
32
|
+
const ALLOWED_DEPENDENCY_SCOPES: Readonly<Record<string, ReadonlySet<string>>> = {
|
|
33
|
+
kernel: new Set(['kernel']),
|
|
34
|
+
system: new Set(['kernel', 'system']),
|
|
35
|
+
base: new Set(['kernel', 'system', 'base']),
|
|
36
|
+
platform: new Set(['kernel', 'system', 'base', 'platform']),
|
|
37
|
+
'third-party': new Set(['kernel', 'system', 'base', 'platform', 'third-party']),
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Generic dependency-layering check used by every scope. A biome may only
|
|
42
|
+
* depend on biomes whose scope sits AT or BELOW its own per
|
|
43
|
+
* `ALLOWED_DEPENDENCY_SCOPES`. Returns the offending dependency ids, if any.
|
|
44
|
+
* Server-only — web biomes use `requiresServerBiomes` (refs into the server
|
|
45
|
+
* tier, no nested deps).
|
|
46
|
+
*
|
|
47
|
+
* Plan-of-record v4.6 §22.5.8 ("Linux-faithful" dependency rules):
|
|
48
|
+
* - kernel → kernel only
|
|
49
|
+
* - system → kernel, system
|
|
50
|
+
* - base → kernel, system, base
|
|
51
|
+
* - platform → kernel, system, base, platform
|
|
52
|
+
* - third-party → kernel, system, base, platform, third-party
|
|
53
|
+
*/
|
|
54
|
+
export function findIllegalDependencies(
|
|
55
|
+
manifest: ServerBiomeManifest,
|
|
56
|
+
allManifestsById: ReadonlyMap<string, ServerBiomeManifest>,
|
|
57
|
+
): string[] {
|
|
58
|
+
const allowed = ALLOWED_DEPENDENCY_SCOPES[manifest.xema.scope];
|
|
59
|
+
if (!allowed) return [];
|
|
60
|
+
const deps = manifest.xema.dependencies ?? [];
|
|
61
|
+
const illegal: string[] = [];
|
|
62
|
+
for (const depId of deps) {
|
|
63
|
+
const dep = allManifestsById.get(depId);
|
|
64
|
+
if (!dep) continue; // missing dep handled by the dep-resolver pass
|
|
65
|
+
if (!allowed.has(dep.xema.scope)) {
|
|
66
|
+
illegal.push(depId);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return illegal;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Topological sort of server biomes by dependency, biased by tier so
|
|
74
|
+
* kernel biomes land before platform biomes before third-party biomes
|
|
75
|
+
* for any free choice in the topo order. Cycles fail fast.
|
|
76
|
+
*
|
|
77
|
+
* Web biomes are never topo-sorted: they only declare cross-target refs
|
|
78
|
+
* (`requiresServerBiomes`) and no nested deps among themselves.
|
|
79
|
+
*/
|
|
80
|
+
export function topoSortServerBiomes(
|
|
81
|
+
manifestsById: ReadonlyMap<string, ServerBiomeManifest>,
|
|
82
|
+
): string[] {
|
|
83
|
+
const visited = new Set<string>();
|
|
84
|
+
const visiting = new Set<string>();
|
|
85
|
+
const result: string[] = [];
|
|
86
|
+
|
|
87
|
+
function visit(id: string, stack: string[]): void {
|
|
88
|
+
if (visited.has(id)) return;
|
|
89
|
+
if (visiting.has(id)) {
|
|
90
|
+
throw new Error(
|
|
91
|
+
`biome-host: dependency cycle detected: ${[...stack, id].join(' → ')}`,
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
const m = manifestsById.get(id);
|
|
95
|
+
if (!m) return;
|
|
96
|
+
visiting.add(id);
|
|
97
|
+
for (const depId of m.xema.dependencies ?? []) {
|
|
98
|
+
visit(depId, [...stack, id]);
|
|
99
|
+
}
|
|
100
|
+
visiting.delete(id);
|
|
101
|
+
visited.add(id);
|
|
102
|
+
result.push(id);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Visit in stable id order biased by tier so the sort is deterministic.
|
|
106
|
+
const ids = Array.from(manifestsById.keys()).sort((a, b) => {
|
|
107
|
+
const ma = manifestsById.get(a);
|
|
108
|
+
const mb = manifestsById.get(b);
|
|
109
|
+
if (!ma || !mb) return a.localeCompare(b);
|
|
110
|
+
const ta = TIER_ORDER[ma.xema.scope] ?? 99;
|
|
111
|
+
const tb = TIER_ORDER[mb.xema.scope] ?? 99;
|
|
112
|
+
if (ta !== tb) return ta - tb;
|
|
113
|
+
return a.localeCompare(b);
|
|
114
|
+
});
|
|
115
|
+
for (const id of ids) visit(id, []);
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Validate every declared server-biome dependency resolves to a known
|
|
121
|
+
* manifest. Throws on the first unsatisfied dep with a clear message.
|
|
122
|
+
*/
|
|
123
|
+
export function validateServerDependencies(
|
|
124
|
+
manifestsById: ReadonlyMap<string, ServerBiomeManifest>,
|
|
125
|
+
): void {
|
|
126
|
+
for (const manifest of manifestsById.values()) {
|
|
127
|
+
const deps = manifest.xema.dependencies ?? [];
|
|
128
|
+
for (const depId of deps) {
|
|
129
|
+
if (!manifestsById.has(depId)) {
|
|
130
|
+
throw new Error(
|
|
131
|
+
`biome-host: server biome "${manifest.xema.id}" declares dependency "${depId}" ` +
|
|
132
|
+
`which is not registered. Known server biomes: [${Array.from(manifestsById.keys()).join(', ')}].`,
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const illegal = findIllegalDependencies(manifest, manifestsById);
|
|
137
|
+
if (illegal.length > 0) {
|
|
138
|
+
const scope = manifest.xema.scope;
|
|
139
|
+
const allowed = Array.from(ALLOWED_DEPENDENCY_SCOPES[scope] ?? []).join(', ');
|
|
140
|
+
throw new Error(
|
|
141
|
+
`biome-host: ${scope} biome "${manifest.xema.id}" depends on biomes with disallowed scope ` +
|
|
142
|
+
`[${illegal.join(', ')}]. A ${scope} biome may only depend on biomes with scope: [${allowed}].`,
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* For each web manifest's `requiresServerBiomes`, ensure every referenced
|
|
150
|
+
* server id is present in the server catalog. Throws on the first
|
|
151
|
+
* unsatisfied ref with a clear message. `optionalServerBiomes` are NOT
|
|
152
|
+
* validated — they are best-effort integrations the web biome works without.
|
|
153
|
+
*
|
|
154
|
+
* Skipped when the server catalog is empty by deployment configuration
|
|
155
|
+
* (e.g. a cluster that doesn't host server biomes) — caller is
|
|
156
|
+
* responsible for that decision.
|
|
157
|
+
*/
|
|
158
|
+
export function validateWebToServerCrossDeps(
|
|
159
|
+
webManifestsById: ReadonlyMap<string, BiomeManifest>,
|
|
160
|
+
serverIds: ReadonlySet<string>,
|
|
161
|
+
): void {
|
|
162
|
+
for (const manifest of webManifestsById.values()) {
|
|
163
|
+
if (manifest.xema.target !== 'web') continue;
|
|
164
|
+
const refs = manifest.xema.requiresServerBiomes ?? [];
|
|
165
|
+
for (const ref of refs) {
|
|
166
|
+
if (!serverIds.has(ref)) {
|
|
167
|
+
throw new Error(
|
|
168
|
+
`biome-host: web biome "${manifest.xema.id}" requires server biome "${ref}" ` +
|
|
169
|
+
`which is not registered. Known server biomes: [${Array.from(serverIds).join(', ')}].`,
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|