@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,572 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
2
|
+
// Contribution-kind YAML schemas.
|
|
3
|
+
//
|
|
4
|
+
// Each schema validates ONE YAML file under a biome's content directory.
|
|
5
|
+
// Used by both biome authors (build-time validation) and server-side
|
|
6
|
+
// seeders (boot-time validation). Adding a new contribution kind:
|
|
7
|
+
// 1. Define + export the Zod schema here.
|
|
8
|
+
// 2. Add the directory field to BiomeContentSchema in biome-host-sdk.
|
|
9
|
+
// 3. Add a seeder in llm-registry-api (or the relevant service) that
|
|
10
|
+
// walks the contribution directory using `walkContent()` and parses
|
|
11
|
+
// each file with this schema.
|
|
12
|
+
//
|
|
13
|
+
// Schemas are intentionally permissive on `description` / metadata fields
|
|
14
|
+
// (string/optional) so biome authors get IDE help without being blocked
|
|
15
|
+
// on documentation completeness. Behaviour fields are strict — the
|
|
16
|
+
// closed-domain rule applies to enum-shaped values.
|
|
17
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
18
|
+
|
|
19
|
+
import { z } from 'zod';
|
|
20
|
+
|
|
21
|
+
// ── MCP service catalog entry (one per kernel canonical service) ──────
|
|
22
|
+
|
|
23
|
+
export const ToolGroupSchema = z.enum([
|
|
24
|
+
'read',
|
|
25
|
+
'write',
|
|
26
|
+
'search',
|
|
27
|
+
'manage',
|
|
28
|
+
'execute',
|
|
29
|
+
]);
|
|
30
|
+
export type ToolGroup = z.infer<typeof ToolGroupSchema>;
|
|
31
|
+
|
|
32
|
+
export const McpCatalogToolSchema = z
|
|
33
|
+
.object({
|
|
34
|
+
name: z.string().min(1),
|
|
35
|
+
description: z.string().min(1),
|
|
36
|
+
group: ToolGroupSchema,
|
|
37
|
+
})
|
|
38
|
+
.strict();
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Server-type discriminator mirroring the `McpServerType` enum in
|
|
42
|
+
* `mcp-gateway-api/src/gateway/mcp-gateway.types.ts`. Catalog YAMLs
|
|
43
|
+
* declare this so the gateway's boot reconciler knows whether to seed
|
|
44
|
+
* the system `OrgMcpServer` row as a Native MCP host (the upstream
|
|
45
|
+
* service self-hosts `/mcp`) or as an OpenAPI bridge (the gateway
|
|
46
|
+
* synthesizes `/mcp/<key>` on top of an OpenAPI document).
|
|
47
|
+
*/
|
|
48
|
+
export const McpCatalogServerTypeSchema = z.enum([
|
|
49
|
+
'native_mcp',
|
|
50
|
+
'openapi_bridge',
|
|
51
|
+
]);
|
|
52
|
+
export type McpCatalogServerType = z.infer<typeof McpCatalogServerTypeSchema>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Connection metadata for catalog entries that the gateway boot
|
|
56
|
+
* reconciler should materialize into a system `OrgMcpServer` row. When
|
|
57
|
+
* a YAML omits this block the entry is metadata-only (the gateway will
|
|
58
|
+
* NOT auto-seed a system row).
|
|
59
|
+
*
|
|
60
|
+
* `envVar` names the environment variable on the gateway pod whose
|
|
61
|
+
* value is the base URL of the upstream service (e.g. `MEMORY_API_URL`
|
|
62
|
+
* → `http://memory-api.xema-prod.svc.cluster.local`). The reconciler
|
|
63
|
+
* resolves `connectionUrl = process.env[envVar] + path` at boot and
|
|
64
|
+
* fail-fasts if the env var is missing — by design, since a missing
|
|
65
|
+
* upstream URL means the corresponding system server cannot be served.
|
|
66
|
+
*/
|
|
67
|
+
export const McpCatalogConnectionSchema = z
|
|
68
|
+
.object({
|
|
69
|
+
serverType: McpCatalogServerTypeSchema,
|
|
70
|
+
envVar: z
|
|
71
|
+
.string()
|
|
72
|
+
.min(1)
|
|
73
|
+
.regex(
|
|
74
|
+
/^[A-Z][A-Z0-9_]*$/,
|
|
75
|
+
'envVar must be UPPER_SNAKE_CASE',
|
|
76
|
+
),
|
|
77
|
+
path: z.string().min(1).default('/mcp'),
|
|
78
|
+
})
|
|
79
|
+
.strict();
|
|
80
|
+
export type McpCatalogConnection = z.infer<typeof McpCatalogConnectionSchema>;
|
|
81
|
+
|
|
82
|
+
export const McpCatalogServiceSchema = z
|
|
83
|
+
.object({
|
|
84
|
+
key: z
|
|
85
|
+
.string()
|
|
86
|
+
.min(1)
|
|
87
|
+
.regex(/^[a-z][a-z0-9-]*$/, 'service key must be kebab-case'),
|
|
88
|
+
displayName: z.string().min(1),
|
|
89
|
+
purpose: z.string().min(1),
|
|
90
|
+
tools: z.array(McpCatalogToolSchema).min(1),
|
|
91
|
+
/**
|
|
92
|
+
* Optional. When present, the mcp-gateway boot reconciler upserts a
|
|
93
|
+
* system `OrgMcpServer` row using these fields. Catalogs without a
|
|
94
|
+
* `connection` block are advertised in the catalog API but are NOT
|
|
95
|
+
* automatically materialized as a system server.
|
|
96
|
+
*/
|
|
97
|
+
connection: McpCatalogConnectionSchema.optional(),
|
|
98
|
+
})
|
|
99
|
+
.strict();
|
|
100
|
+
|
|
101
|
+
export type McpCatalogService = z.infer<typeof McpCatalogServiceSchema>;
|
|
102
|
+
|
|
103
|
+
// ── MCP tool profile (one per agent slug) ─────────────────────────────
|
|
104
|
+
|
|
105
|
+
export const ServiceToolAccessSchema = z.union([
|
|
106
|
+
z.literal('*'),
|
|
107
|
+
z.array(ToolGroupSchema),
|
|
108
|
+
z
|
|
109
|
+
.object({
|
|
110
|
+
groups: z.union([z.literal('*'), z.array(ToolGroupSchema)]),
|
|
111
|
+
allowedTools: z.array(z.string()).optional(),
|
|
112
|
+
optional: z.boolean().optional(),
|
|
113
|
+
})
|
|
114
|
+
.strict(),
|
|
115
|
+
]);
|
|
116
|
+
export type ServiceToolAccess = z.infer<typeof ServiceToolAccessSchema>;
|
|
117
|
+
|
|
118
|
+
export const ToolProfileSchema = z
|
|
119
|
+
.object({
|
|
120
|
+
agentSlug: z
|
|
121
|
+
.string()
|
|
122
|
+
.min(1)
|
|
123
|
+
.regex(/^[a-z][a-z0-9-_]*$/, 'agent slug must be kebab-case'),
|
|
124
|
+
/** Per-service access. Map of MCP service key → ServiceToolAccess. */
|
|
125
|
+
access: z.record(z.string(), ServiceToolAccessSchema),
|
|
126
|
+
})
|
|
127
|
+
.strict();
|
|
128
|
+
export type ToolProfile = z.infer<typeof ToolProfileSchema>;
|
|
129
|
+
|
|
130
|
+
// ── Role capability profile (kernel runtime only) ─────────────────────
|
|
131
|
+
|
|
132
|
+
export const InvocationSurfaceSchema = z.enum([
|
|
133
|
+
'pipeline-run',
|
|
134
|
+
'agent-session',
|
|
135
|
+
'design-system-builder',
|
|
136
|
+
'gate-review',
|
|
137
|
+
]);
|
|
138
|
+
|
|
139
|
+
export const WritePolicySchema = z.enum([
|
|
140
|
+
'read-only',
|
|
141
|
+
'own-pages-only',
|
|
142
|
+
'full-write',
|
|
143
|
+
]);
|
|
144
|
+
|
|
145
|
+
export const RoleCapabilityProfileSchema = z
|
|
146
|
+
.object({
|
|
147
|
+
role: z
|
|
148
|
+
.string()
|
|
149
|
+
.min(1)
|
|
150
|
+
.regex(/^[a-z][a-z0-9-]*$/, 'role must be kebab-case'),
|
|
151
|
+
surface: InvocationSurfaceSchema,
|
|
152
|
+
writePolicy: WritePolicySchema,
|
|
153
|
+
mayEditRepos: z.enum(['never', 'when-granted']),
|
|
154
|
+
mayWriteKnowledgeBase: z.boolean(),
|
|
155
|
+
allowedXemaTools: z.array(z.string().min(1)),
|
|
156
|
+
})
|
|
157
|
+
.strict();
|
|
158
|
+
export type RoleCapabilityProfile = z.infer<
|
|
159
|
+
typeof RoleCapabilityProfileSchema
|
|
160
|
+
>;
|
|
161
|
+
|
|
162
|
+
// ── Agent .md frontmatter ─────────────────────────────────────────────
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Closed enum of LLM-routing tiers consumed by llm-registry's
|
|
166
|
+
* model-strategy resolver. Each agent declares the *kind* of model its
|
|
167
|
+
* work needs; strategy entries map class → modelSlug.
|
|
168
|
+
*
|
|
169
|
+
* Distinct from `AgentRunRole` (the permissions/authority concept
|
|
170
|
+
* declared per workflow job and resolved through `RoleCapabilityProfile`).
|
|
171
|
+
*
|
|
172
|
+
* Adding a new class requires platform-side support (strategy seeder +
|
|
173
|
+
* dispatch logic), so the enum stays narrow.
|
|
174
|
+
*
|
|
175
|
+
* ─────────────────────────────────────────────────────────────────────
|
|
176
|
+
* SOURCE OF TRUTH: `ModelClass` enum in `@xemahq/kernel-contracts/workflow`
|
|
177
|
+
* (`packages/kernel/workflow-contracts/src/lib/model-ref.ts`).
|
|
178
|
+
*
|
|
179
|
+
* This copy is inlined because `biome-builder` publishes to the public
|
|
180
|
+
* npm registry and cannot depend on a GitHub-Packages-scoped kernel
|
|
181
|
+
* package — same reason `InvocationSurfaceSchema` and the `ProjectKit*`
|
|
182
|
+
* schemas above inline their values.
|
|
183
|
+
*
|
|
184
|
+
* MUST stay value-identical to the kernel `MODEL_CLASS_VALUES` list. The
|
|
185
|
+
* parity gate in
|
|
186
|
+
* `biomes/agent-runtime/api/llm-registry-api/tests/agent-definition/agent-frontmatter-shape.spec.ts`
|
|
187
|
+
* fails fast if the two drift.
|
|
188
|
+
* ─────────────────────────────────────────────────────────────────────
|
|
189
|
+
*/
|
|
190
|
+
export const ModelClassSchema = z.enum([
|
|
191
|
+
'utility',
|
|
192
|
+
'planning',
|
|
193
|
+
'creative',
|
|
194
|
+
'coding',
|
|
195
|
+
'review',
|
|
196
|
+
]);
|
|
197
|
+
export type ModelClass = z.infer<typeof ModelClassSchema>;
|
|
198
|
+
|
|
199
|
+
export const AgentFrontmatterSchema = z
|
|
200
|
+
.object({
|
|
201
|
+
/** Kebab-case slug — must match the .md file basename. */
|
|
202
|
+
slug: z
|
|
203
|
+
.string()
|
|
204
|
+
.min(1)
|
|
205
|
+
.regex(/^[a-z][a-z0-9-_]*$/, 'agent slug must be kebab-case')
|
|
206
|
+
.optional(),
|
|
207
|
+
/**
|
|
208
|
+
* Single bio paragraph rendered in the agent profile UI and
|
|
209
|
+
* embedded in the seeded `description` column. The only display
|
|
210
|
+
* text on `AgentDefinition`; `title` and `shortBio` were removed
|
|
211
|
+
* in favour of one canonical field.
|
|
212
|
+
*/
|
|
213
|
+
description: z.string().min(1),
|
|
214
|
+
/** OpenCode agent mode (primary, subagent, …). */
|
|
215
|
+
mode: z.enum(['primary', 'subagent', 'all']).optional(),
|
|
216
|
+
color: z.string().optional(),
|
|
217
|
+
temperature: z.number().min(0).max(2).optional(),
|
|
218
|
+
/** Max agentic iterations. */
|
|
219
|
+
steps: z.number().int().positive().optional(),
|
|
220
|
+
/**
|
|
221
|
+
* Hide this agent from user-facing pickers (talent pool, interactive
|
|
222
|
+
* session catalog). Internal-only agents (gate reviewers, leaf
|
|
223
|
+
* subagents) set this true. Stays invocable via `task` and workflow
|
|
224
|
+
* `agentRef:` — only human discovery surfaces filter on it.
|
|
225
|
+
*/
|
|
226
|
+
hidden: z.boolean().optional(),
|
|
227
|
+
|
|
228
|
+
// ── Required platform metadata ────────────────────────────────────
|
|
229
|
+
displayName: z.string(),
|
|
230
|
+
/**
|
|
231
|
+
* LLM-routing tier. Closed enum (`ModelClass`). Required — the
|
|
232
|
+
* seeder fail-fasts when omitted.
|
|
233
|
+
*/
|
|
234
|
+
modelClass: ModelClassSchema,
|
|
235
|
+
|
|
236
|
+
// ── Optional platform metadata ────────────────────────────────────
|
|
237
|
+
/** Skill slugs this agent uses. */
|
|
238
|
+
skills: z.array(z.string()).optional(),
|
|
239
|
+
/**
|
|
240
|
+
* MCP service keys the agent connects to at runtime. Optional —
|
|
241
|
+
* when omitted, the agent-definition seeder derives the set from
|
|
242
|
+
* the corresponding `<slug>.tool-profile.yaml` (the keys of its
|
|
243
|
+
* `access` map). Use this field when an agent has no tool-profile
|
|
244
|
+
* (e.g. interactive-primary agents) but still needs MCP servers.
|
|
245
|
+
*/
|
|
246
|
+
mcpServices: z.array(z.string()).optional(),
|
|
247
|
+
|
|
248
|
+
// OpenCode tools/permissions blocks. Pass through any nested object.
|
|
249
|
+
tools: z.unknown().optional(),
|
|
250
|
+
permission: z.unknown().optional(),
|
|
251
|
+
})
|
|
252
|
+
// OpenCode itself parses tools/permission as nested objects. Use passthrough so
|
|
253
|
+
// unknown nested keys (e.g. permission.bash patterns) survive without strict-mode
|
|
254
|
+
// failures. Top-level unknown keys still fail through z.object's default behaviour.
|
|
255
|
+
.passthrough();
|
|
256
|
+
|
|
257
|
+
export type AgentFrontmatter = z.infer<typeof AgentFrontmatterSchema>;
|
|
258
|
+
|
|
259
|
+
// ── OpenCode skill SKILL.md frontmatter ───────────────────────────────
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Frontmatter shape on `SKILL.md` files inside an
|
|
263
|
+
* `<biome-root>/<openCodeSkills>/<skill-key>/` directory. The skill
|
|
264
|
+
* `key` is the directory name; the body of the markdown file is the
|
|
265
|
+
* skill content rendered into agent prompts.
|
|
266
|
+
*/
|
|
267
|
+
export const SkillFrontmatterSchema = z
|
|
268
|
+
.object({
|
|
269
|
+
/** Human-readable display name. */
|
|
270
|
+
name: z.string().min(1),
|
|
271
|
+
/** One-line summary used in capability catalogs. */
|
|
272
|
+
description: z.string().min(1),
|
|
273
|
+
/** Skill category (free-form short string for grouping). */
|
|
274
|
+
category: z.string().optional(),
|
|
275
|
+
/** Phase keys for which this skill is relevant. */
|
|
276
|
+
phases: z.array(z.string()).optional(),
|
|
277
|
+
/** Free-form tags for cataloguing. */
|
|
278
|
+
tags: z.array(z.string()).optional(),
|
|
279
|
+
/**
|
|
280
|
+
* Optional surface gate. Closed values mirror the kernel
|
|
281
|
+
* `SkillSurface` enum: `workflow`, `agent-session`. When omitted, the
|
|
282
|
+
* skill applies to BOTH surfaces. The always-on skill resolver in
|
|
283
|
+
* `llm-registry-api` filters its listing by this field against the
|
|
284
|
+
* requesting surface.
|
|
285
|
+
*/
|
|
286
|
+
surfaces: z.array(z.enum(['workflow', 'agent-session'])).optional(),
|
|
287
|
+
})
|
|
288
|
+
.passthrough();
|
|
289
|
+
export type SkillFrontmatter = z.infer<typeof SkillFrontmatterSchema>;
|
|
290
|
+
|
|
291
|
+
// ── Project Kit definition (one per <root>/project-kits/*.yaml) ───────
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Wire values restated from the kernel `ProjectKit*` enums in
|
|
295
|
+
* `@xemahq/kernel-contracts/agent-workspace`. They are inlined (not imported)
|
|
296
|
+
* because `biome-builder` publishes to the public npm registry and must
|
|
297
|
+
* not depend on a GitHub-Packages-scoped kernel package — the same reason
|
|
298
|
+
* `InvocationSurfaceSchema` above inlines its values. The kernel enum is the
|
|
299
|
+
* source of truth; keep these literals value-identical with it.
|
|
300
|
+
*/
|
|
301
|
+
export const ProjectKitKindSchema = z.enum(['npm-dependency', 'shadcn-registry']);
|
|
302
|
+
export const ProjectKitPurposeSchema = z.enum([
|
|
303
|
+
'component-library',
|
|
304
|
+
'generic-dependency',
|
|
305
|
+
]);
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Registry visibility tier. Mirrors the kernel `RegistryVisibilityTier` enum
|
|
309
|
+
* in `@xemahq/kernel-contracts/project-kit`; restated as string literals because
|
|
310
|
+
* biome-builder publishes to the public npm registry and can't depend on a
|
|
311
|
+
* GitHub-Packages-scoped kernel package.
|
|
312
|
+
*/
|
|
313
|
+
export const RegistryVisibilityTierSchema = z.enum([
|
|
314
|
+
'system',
|
|
315
|
+
'system-shareable',
|
|
316
|
+
'org',
|
|
317
|
+
'external',
|
|
318
|
+
]);
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Wallet-backed auth for a private kit source. `walletName` is resolved at
|
|
322
|
+
* session start; `tokenEnvVar` names the wallet entry holding the token.
|
|
323
|
+
*/
|
|
324
|
+
const ProjectKitAuthSchema = z
|
|
325
|
+
.object({
|
|
326
|
+
walletName: z
|
|
327
|
+
.string()
|
|
328
|
+
.regex(
|
|
329
|
+
/^[a-z][a-z0-9-]{0,62}$/,
|
|
330
|
+
'walletName must be a kebab-case wallet name',
|
|
331
|
+
),
|
|
332
|
+
tokenEnvVar: z
|
|
333
|
+
.string()
|
|
334
|
+
.regex(
|
|
335
|
+
/^[A-Z][A-Z0-9_]*$/,
|
|
336
|
+
'tokenEnvVar must be a SCREAMING_SNAKE_CASE env-var name',
|
|
337
|
+
),
|
|
338
|
+
})
|
|
339
|
+
.strict();
|
|
340
|
+
|
|
341
|
+
const ProjectKitNpmRegistrySourceSchema = z
|
|
342
|
+
.object({
|
|
343
|
+
kind: z.literal('npm-registry'),
|
|
344
|
+
package: z.string().min(1),
|
|
345
|
+
versionRange: z.string().min(1),
|
|
346
|
+
registryUrl: z.string().url().optional(),
|
|
347
|
+
scope: z
|
|
348
|
+
.string()
|
|
349
|
+
.min(1)
|
|
350
|
+
.regex(/^@[a-z0-9-]+$/, 'scope must be a lowercase npm scope like @acme')
|
|
351
|
+
.optional(),
|
|
352
|
+
auth: ProjectKitAuthSchema.optional(),
|
|
353
|
+
})
|
|
354
|
+
.strict()
|
|
355
|
+
.refine((s) => (s.registryUrl ? Boolean(s.scope) : true), {
|
|
356
|
+
message: 'scope is required when registryUrl is set',
|
|
357
|
+
path: ['scope'],
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
const ProjectKitGitSourceSchema = z
|
|
361
|
+
.object({
|
|
362
|
+
kind: z.literal('git'),
|
|
363
|
+
gitUrl: z.string().url(),
|
|
364
|
+
ref: z.string().min(1).optional(),
|
|
365
|
+
packageName: z.string().min(1).optional(),
|
|
366
|
+
auth: ProjectKitAuthSchema.optional(),
|
|
367
|
+
})
|
|
368
|
+
.strict();
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
/** Shadcn style preset — closed set matching upstream's `--style` flag. */
|
|
372
|
+
const ShadcnStyleSchema = z.enum(['default', 'new-york']);
|
|
373
|
+
|
|
374
|
+
/** Shadcn base color palette — closed set matching upstream's `--base-color`. */
|
|
375
|
+
const ShadcnBaseColorSchema = z.enum([
|
|
376
|
+
'neutral',
|
|
377
|
+
'stone',
|
|
378
|
+
'zinc',
|
|
379
|
+
'mauve',
|
|
380
|
+
'olive',
|
|
381
|
+
'mist',
|
|
382
|
+
'taupe',
|
|
383
|
+
]);
|
|
384
|
+
|
|
385
|
+
/** Icon library shadcn components import from. */
|
|
386
|
+
const ShadcnIconLibrarySchema = z.enum(['lucide', 'radix']);
|
|
387
|
+
|
|
388
|
+
/** One declared custom registry for shadcn's `components.json#registries` block. */
|
|
389
|
+
const ShadcnCustomRegistrySchema = z
|
|
390
|
+
.object({
|
|
391
|
+
scope: z
|
|
392
|
+
.string()
|
|
393
|
+
.regex(
|
|
394
|
+
/^@[a-z0-9-]+$/,
|
|
395
|
+
'shadcn custom-registry scope must be a lowercase npm scope like @acme',
|
|
396
|
+
),
|
|
397
|
+
url: z
|
|
398
|
+
.string()
|
|
399
|
+
.url()
|
|
400
|
+
.refine((u) => u.includes('{name}'), {
|
|
401
|
+
message:
|
|
402
|
+
'shadcn custom-registry url must contain {name} substitution token',
|
|
403
|
+
}),
|
|
404
|
+
auth: ProjectKitAuthSchema.optional(),
|
|
405
|
+
})
|
|
406
|
+
.strict();
|
|
407
|
+
|
|
408
|
+
const ProjectKitShadcnRegistrySourceSchema = z
|
|
409
|
+
.object({
|
|
410
|
+
kind: z.literal('shadcn-registry'),
|
|
411
|
+
style: ShadcnStyleSchema,
|
|
412
|
+
baseColor: ShadcnBaseColorSchema,
|
|
413
|
+
components: z.array(z.string().min(1)).min(1),
|
|
414
|
+
iconLibrary: ShadcnIconLibrarySchema.optional(),
|
|
415
|
+
customRegistries: z.array(ShadcnCustomRegistrySchema).optional(),
|
|
416
|
+
typescript: z.boolean().optional(),
|
|
417
|
+
rsc: z.boolean().optional(),
|
|
418
|
+
})
|
|
419
|
+
.strict();
|
|
420
|
+
|
|
421
|
+
export const ProjectKitSourceSchema = z.discriminatedUnion('kind', [
|
|
422
|
+
ProjectKitNpmRegistrySourceSchema,
|
|
423
|
+
ProjectKitGitSourceSchema,
|
|
424
|
+
ProjectKitShadcnRegistrySourceSchema,
|
|
425
|
+
]);
|
|
426
|
+
export type ProjectKitSourceYaml = z.infer<typeof ProjectKitSourceSchema>;
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* One `project-kits/<slug>.yaml` file. A Project Kit is a reusable unit an
|
|
430
|
+
* interactive session installs into the user's project repo. `compatibleTargets`
|
|
431
|
+
* / `defaultForTargets` are opaque tech-stack tags — the consuming session type
|
|
432
|
+
* (webapp-studio) matches them against its own targets; the catalog stays
|
|
433
|
+
* domain-agnostic.
|
|
434
|
+
*/
|
|
435
|
+
export const ProjectKitDefinitionSchema = z
|
|
436
|
+
.object({
|
|
437
|
+
slug: z
|
|
438
|
+
.string()
|
|
439
|
+
.min(1)
|
|
440
|
+
.regex(/^[a-z][a-z0-9-]*$/, 'kit slug must be kebab-case'),
|
|
441
|
+
displayName: z.string().min(1),
|
|
442
|
+
description: z.string().optional(),
|
|
443
|
+
kitKind: ProjectKitKindSchema,
|
|
444
|
+
purpose: ProjectKitPurposeSchema,
|
|
445
|
+
/** Visibility scope of this kit definition. */
|
|
446
|
+
visibilityTier: RegistryVisibilityTierSchema.optional(),
|
|
447
|
+
/** Tech-stack tags the kit is valid for (at least one). */
|
|
448
|
+
compatibleTargets: z.array(z.string().min(1)).min(1),
|
|
449
|
+
/** Tags for which the kit is pre-selected on a new project. Subset of compatibleTargets. */
|
|
450
|
+
defaultForTargets: z.array(z.string().min(1)).default([]),
|
|
451
|
+
source: ProjectKitSourceSchema,
|
|
452
|
+
/** Skill slug mounted so the code-producing agent knows how to use the kit. */
|
|
453
|
+
enrichmentSkillSlug: z.string().min(1).optional(),
|
|
454
|
+
})
|
|
455
|
+
.strict()
|
|
456
|
+
.refine(
|
|
457
|
+
(k) => k.defaultForTargets.every((t) => k.compatibleTargets.includes(t)),
|
|
458
|
+
{
|
|
459
|
+
message: 'defaultForTargets must be a subset of compatibleTargets',
|
|
460
|
+
path: ['defaultForTargets'],
|
|
461
|
+
},
|
|
462
|
+
);
|
|
463
|
+
export type ProjectKitDefinitionYaml = z.infer<
|
|
464
|
+
typeof ProjectKitDefinitionSchema
|
|
465
|
+
>;
|
|
466
|
+
|
|
467
|
+
// ── Workflow phase configuration ──────────────────────────────────────
|
|
468
|
+
//
|
|
469
|
+
// A sub-app biome that defines an ordered, gated delivery pipeline ships
|
|
470
|
+
// ONE `phase-config.json` under its `workflow-config/` directory. It
|
|
471
|
+
// declares the workflow's ordered stages, their hierarchy, and per-stage
|
|
472
|
+
// gate reviewers. The kernel carries no domain phase enum; this is the
|
|
473
|
+
// biome-owned source of truth, loaded at runtime by the platform
|
|
474
|
+
// services that need it (llm-registry-api, opencode-pool-api).
|
|
475
|
+
|
|
476
|
+
/** lifecycle vs delivery — mirrors `WorkflowStageCategory` in the kernel. */
|
|
477
|
+
export const WorkflowPhaseCategorySchema = z.enum(['lifecycle', 'delivery']);
|
|
478
|
+
export type WorkflowPhaseCategory = z.infer<typeof WorkflowPhaseCategorySchema>;
|
|
479
|
+
|
|
480
|
+
/** One ordered phase: a free-form key + its engine category. */
|
|
481
|
+
export const WorkflowPhaseSchema = z
|
|
482
|
+
.object({
|
|
483
|
+
key: z
|
|
484
|
+
.string()
|
|
485
|
+
.min(1)
|
|
486
|
+
.regex(/^[a-z][a-z0-9_]*$/, 'phase key must be lower_snake_case'),
|
|
487
|
+
category: WorkflowPhaseCategorySchema,
|
|
488
|
+
})
|
|
489
|
+
.strict();
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* The `workflow-config/phase-config.json` document. Exactly one per
|
|
493
|
+
* biome that declares a gated phase pipeline.
|
|
494
|
+
*
|
|
495
|
+
* Per-phase gate-reviewer policy used to live here as a `gateReviewers`
|
|
496
|
+
* block (`{ guild, agentId, perspective, scopeRules }`). It was migrated
|
|
497
|
+
* to first-class Skill bundles under `biomes/<biome>/skills/gate-review/`
|
|
498
|
+
* so reviewer policy follows the same kernel primitive as every other
|
|
499
|
+
* agent capability. Workflow YAMLs attach the relevant skill on the
|
|
500
|
+
* reviewer recipient directly (`target: { agentRef, skills: [...] }`).
|
|
501
|
+
*/
|
|
502
|
+
export const WorkflowPhaseConfigSchema = z
|
|
503
|
+
.object({
|
|
504
|
+
schemaVersion: z.string().min(1),
|
|
505
|
+
/** Ordered phase list — first entry is the entry phase. */
|
|
506
|
+
phases: z.array(WorkflowPhaseSchema).min(1),
|
|
507
|
+
/**
|
|
508
|
+
* Phases that are configurable but run OUTSIDE the sequential
|
|
509
|
+
* pipeline (e.g. a direct-call analyst agent). Free-form keys.
|
|
510
|
+
*/
|
|
511
|
+
directAgentPhases: z.array(z.string().min(1)).default([]),
|
|
512
|
+
/** Sub-phase coordinator agent slug → parent phase key. */
|
|
513
|
+
subPhaseToParent: z.record(z.string(), z.string().min(1)).default({}),
|
|
514
|
+
/** Phase key → required review-capability keys. */
|
|
515
|
+
reviewCapabilities: z
|
|
516
|
+
.record(z.string(), z.array(z.string().min(1)))
|
|
517
|
+
.default({}),
|
|
518
|
+
})
|
|
519
|
+
.strict()
|
|
520
|
+
.superRefine((cfg, ctx) => {
|
|
521
|
+
const phaseKeys = new Set(cfg.phases.map((p) => p.key));
|
|
522
|
+
// Every review-capability / sub-phase parent must name a declared
|
|
523
|
+
// phase — fail-fast on a typo'd phase key.
|
|
524
|
+
for (const key of Object.keys(cfg.reviewCapabilities)) {
|
|
525
|
+
if (!phaseKeys.has(key)) {
|
|
526
|
+
ctx.addIssue({
|
|
527
|
+
code: 'custom',
|
|
528
|
+
message: `reviewCapabilities references unknown phase "${key}"`,
|
|
529
|
+
path: ['reviewCapabilities', key],
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
for (const [slug, parent] of Object.entries(cfg.subPhaseToParent)) {
|
|
534
|
+
if (!phaseKeys.has(parent)) {
|
|
535
|
+
ctx.addIssue({
|
|
536
|
+
code: 'custom',
|
|
537
|
+
message: `subPhaseToParent["${slug}"] references unknown phase "${parent}"`,
|
|
538
|
+
path: ['subPhaseToParent', slug],
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
export type WorkflowPhaseConfig = z.infer<typeof WorkflowPhaseConfigSchema>;
|
|
544
|
+
export type WorkflowPhase = z.infer<typeof WorkflowPhaseSchema>;
|
|
545
|
+
|
|
546
|
+
// ── Helper: parse YAML + validate against a contribution schema ───────
|
|
547
|
+
|
|
548
|
+
export class ContributionParseError extends Error {
|
|
549
|
+
constructor(
|
|
550
|
+
public readonly contributionPath: string,
|
|
551
|
+
public readonly issues: readonly z.core.$ZodIssue[],
|
|
552
|
+
) {
|
|
553
|
+
super(
|
|
554
|
+
`Invalid contribution file ${contributionPath}: ${issues
|
|
555
|
+
.map((i) => `[${i.path.join('.')}] ${i.message}`)
|
|
556
|
+
.join('; ')}`,
|
|
557
|
+
);
|
|
558
|
+
this.name = 'ContributionParseError';
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export function parseContribution<T extends z.ZodTypeAny>(
|
|
563
|
+
schema: T,
|
|
564
|
+
raw: unknown,
|
|
565
|
+
contributionPath: string,
|
|
566
|
+
): z.infer<T> {
|
|
567
|
+
const result = schema.safeParse(raw);
|
|
568
|
+
if (!result.success) {
|
|
569
|
+
throw new ContributionParseError(contributionPath, result.error.issues);
|
|
570
|
+
}
|
|
571
|
+
return result.data;
|
|
572
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
2
|
+
// `defineBiome` — the in-biome entry point.
|
|
3
|
+
//
|
|
4
|
+
// Today (Epoch A) this is a thin marker that wraps imperative install
|
|
5
|
+
// logic (e.g. registering pipeline agents into opencode-client's
|
|
6
|
+
// agentRegistry). As more registries land in Epochs B–C, this helper
|
|
7
|
+
// absorbs auto-install logic so a content-only biome does not need to
|
|
8
|
+
// write any imperative code — the manifest's content directories are
|
|
9
|
+
// enough.
|
|
10
|
+
//
|
|
11
|
+
// Biome install functions all share the same shape:
|
|
12
|
+
// `(ctx: BiomeInstallContext) => void | Promise<void>`
|
|
13
|
+
//
|
|
14
|
+
// `ctx` is opaque on purpose: each kernel registry passes its own context
|
|
15
|
+
// when it loads the biome. Biome authors do not construct it.
|
|
16
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
17
|
+
|
|
18
|
+
import type { BiomeManifest } from '../../host';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Loosely-typed context. Each registry that calls into a biome's
|
|
22
|
+
* install function passes its own ctx, with extra fields named to match
|
|
23
|
+
* what the registry needs. Biome authors cast to a more specific
|
|
24
|
+
* context type matching the registry they are extending. This keeps
|
|
25
|
+
* @xemahq/biome-builder free of import-time dependencies on every
|
|
26
|
+
* registry package.
|
|
27
|
+
*/
|
|
28
|
+
export interface BiomeInstallContext {
|
|
29
|
+
/** Biome manifest (already parsed + validated by biome-host). */
|
|
30
|
+
readonly manifest: BiomeManifest;
|
|
31
|
+
/** Absolute path to the biome's package root. */
|
|
32
|
+
readonly biomeRoot: string;
|
|
33
|
+
/** Free-form bag of registries — the calling host adds its own fields. */
|
|
34
|
+
[registryKey: string]: unknown;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type BiomeInstallFn = (
|
|
38
|
+
ctx: BiomeInstallContext,
|
|
39
|
+
) => void | Promise<void>;
|
|
40
|
+
|
|
41
|
+
export interface BiomeDefinition {
|
|
42
|
+
readonly manifest: BiomeManifest;
|
|
43
|
+
readonly install: BiomeInstallFn;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface DefineBiomeOptions {
|
|
47
|
+
readonly manifest: BiomeManifest;
|
|
48
|
+
/**
|
|
49
|
+
* Imperative install hook. Called once when biome-host (or a kernel
|
|
50
|
+
* registry) loads the biome. May be omitted entirely for content-only
|
|
51
|
+
* biomes — the SDK auto-derives registrations from the manifest's
|
|
52
|
+
* content directories in that case.
|
|
53
|
+
*/
|
|
54
|
+
readonly install?: BiomeInstallFn;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Defines a biome's runtime registration. Biome authors export the
|
|
59
|
+
* return value as a named export `install` (or default) from their
|
|
60
|
+
* `src/index.ts`; biome-host imports the module and invokes
|
|
61
|
+
* `install(ctx)` at boot.
|
|
62
|
+
*
|
|
63
|
+
* Example:
|
|
64
|
+
*
|
|
65
|
+
* ```ts
|
|
66
|
+
* import { defineBiome } from '@xemahq/biome-sdk/builder';
|
|
67
|
+
* import manifest from '../xema-biome.json' with { type: 'json' };
|
|
68
|
+
*
|
|
69
|
+
* export default defineBiome({
|
|
70
|
+
* manifest,
|
|
71
|
+
* install: async (ctx) => {
|
|
72
|
+
* // Imperative bits go here. Most biomes don't need any — the
|
|
73
|
+
* // manifest's content directories are the source of truth.
|
|
74
|
+
* },
|
|
75
|
+
* });
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export function defineBiome(opts: DefineBiomeOptions): BiomeDefinition {
|
|
79
|
+
const noop: BiomeInstallFn = () => undefined;
|
|
80
|
+
return {
|
|
81
|
+
manifest: opts.manifest,
|
|
82
|
+
install: opts.install ?? noop,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
2
|
+
// Typed builders for in-biome imperative contributions.
|
|
3
|
+
//
|
|
4
|
+
// These helpers exist for the cases where a biome author chooses to
|
|
5
|
+
// declare contributions in TS instead of YAML. They are pure pass-through
|
|
6
|
+
// functions whose value is type-checking + IDE autocomplete via the
|
|
7
|
+
// associated Zod schema. Each helper returns the value unchanged so the
|
|
8
|
+
// biome can collect them into arrays for the install function to register.
|
|
9
|
+
//
|
|
10
|
+
// For purely declarative biomes (the common case), use the YAML files
|
|
11
|
+
// under content directories instead — these helpers should be reserved
|
|
12
|
+
// for rare imperative extension points.
|
|
13
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
type AgentFrontmatter,
|
|
17
|
+
AgentFrontmatterSchema,
|
|
18
|
+
type McpCatalogService,
|
|
19
|
+
McpCatalogServiceSchema,
|
|
20
|
+
type RoleCapabilityProfile,
|
|
21
|
+
RoleCapabilityProfileSchema,
|
|
22
|
+
type ToolProfile,
|
|
23
|
+
ToolProfileSchema,
|
|
24
|
+
} from './contribution-schemas';
|
|
25
|
+
|
|
26
|
+
export function defineAgent(input: AgentFrontmatter): AgentFrontmatter {
|
|
27
|
+
return AgentFrontmatterSchema.parse(input);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function defineToolProfile(input: ToolProfile): ToolProfile {
|
|
31
|
+
return ToolProfileSchema.parse(input);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function defineMcpService(input: McpCatalogService): McpCatalogService {
|
|
35
|
+
return McpCatalogServiceSchema.parse(input);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function defineRoleCapability(
|
|
39
|
+
input: RoleCapabilityProfile,
|
|
40
|
+
): RoleCapabilityProfile {
|
|
41
|
+
return RoleCapabilityProfileSchema.parse(input);
|
|
42
|
+
}
|