@bevel-software/platform-core-backend 0.13.6 → 0.15.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/THIRD-PARTY-NOTICES.md +6 -6
- package/dist/core/catalog-cache-invalidation.d.ts +29 -0
- package/dist/core/catalog-cache-invalidation.d.ts.map +1 -0
- package/dist/core/catalog-cache-invalidation.js +71 -0
- package/dist/core/catalog-cache-invalidation.js.map +1 -0
- package/dist/core/create-core-server.d.ts.map +1 -1
- package/dist/core/create-core-server.js +101 -9
- package/dist/core/create-core-server.js.map +1 -1
- package/dist/core/create-core-services.d.ts +20 -1
- package/dist/core/create-core-services.d.ts.map +1 -1
- package/dist/core/create-core-services.js +105 -43
- package/dist/core/create-core-services.js.map +1 -1
- package/dist/core-config.d.ts.map +1 -1
- package/dist/core-config.js +12 -5
- package/dist/core-config.js.map +1 -1
- package/dist/modules/access/access-control.interface.d.ts +18 -6
- package/dist/modules/access/access-control.interface.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.d.ts +26 -1
- package/dist/modules/access/access-control.service.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.js +213 -71
- package/dist/modules/access/access-control.service.js.map +1 -1
- package/dist/modules/access/access.routes.d.ts.map +1 -1
- package/dist/modules/access/access.routes.js +59 -7
- package/dist/modules/access/access.routes.js.map +1 -1
- package/dist/modules/access-model/access-grammar.d.ts +51 -1
- package/dist/modules/access-model/access-grammar.d.ts.map +1 -1
- package/dist/modules/access-model/access-grammar.js +95 -1
- package/dist/modules/access-model/access-grammar.js.map +1 -1
- package/dist/modules/access-model/group-files.d.ts.map +1 -1
- package/dist/modules/access-model/group-files.js +4 -1
- package/dist/modules/access-model/group-files.js.map +1 -1
- package/dist/modules/access-model/kb-read-filter.d.ts +12 -0
- package/dist/modules/access-model/kb-read-filter.d.ts.map +1 -1
- package/dist/modules/access-model/kb-read-filter.js +15 -0
- package/dist/modules/access-model/kb-read-filter.js.map +1 -1
- package/dist/modules/access-model/plugin-principals.d.ts +49 -0
- package/dist/modules/access-model/plugin-principals.d.ts.map +1 -0
- package/dist/modules/access-model/plugin-principals.js +125 -0
- package/dist/modules/access-model/plugin-principals.js.map +1 -0
- package/dist/modules/connection-probe/connection-probe.contract.d.ts +43 -0
- package/dist/modules/connection-probe/connection-probe.contract.d.ts.map +1 -0
- package/dist/modules/connection-probe/connection-probe.contract.js +2 -0
- package/dist/modules/connection-probe/connection-probe.contract.js.map +1 -0
- package/dist/modules/connection-probe/connection-probe.service.d.ts +94 -0
- package/dist/modules/connection-probe/connection-probe.service.d.ts.map +1 -0
- package/dist/modules/connection-probe/connection-probe.service.js +684 -0
- package/dist/modules/connection-probe/connection-probe.service.js.map +1 -0
- package/dist/modules/connection-probe/index.d.ts +3 -0
- package/dist/modules/connection-probe/index.d.ts.map +1 -0
- package/dist/modules/connection-probe/index.js +3 -0
- package/dist/modules/connection-probe/index.js.map +1 -0
- package/dist/modules/database/core-schema.d.ts +326 -0
- package/dist/modules/database/core-schema.d.ts.map +1 -1
- package/dist/modules/database/core-schema.js +52 -0
- package/dist/modules/database/core-schema.js.map +1 -1
- package/dist/modules/diff/diff.routes.d.ts.map +1 -1
- package/dist/modules/diff/diff.routes.js +3 -5
- package/dist/modules/diff/diff.routes.js.map +1 -1
- package/dist/modules/kb-fs/mutex.d.ts +37 -0
- package/dist/modules/kb-fs/mutex.d.ts.map +1 -1
- package/dist/modules/kb-fs/mutex.js +48 -5
- package/dist/modules/kb-fs/mutex.js.map +1 -1
- package/dist/modules/kb-sync/index.d.ts +6 -0
- package/dist/modules/kb-sync/index.d.ts.map +1 -0
- package/dist/modules/kb-sync/index.js +5 -0
- package/dist/modules/kb-sync/index.js.map +1 -0
- package/dist/modules/kb-sync/kb-sync.interface.d.ts +77 -0
- package/dist/modules/kb-sync/kb-sync.interface.d.ts.map +1 -0
- package/dist/modules/kb-sync/kb-sync.interface.js +2 -0
- package/dist/modules/kb-sync/kb-sync.interface.js.map +1 -0
- package/dist/modules/kb-sync/kb-sync.routes.d.ts +70 -0
- package/dist/modules/kb-sync/kb-sync.routes.d.ts.map +1 -0
- package/dist/modules/kb-sync/kb-sync.routes.js +135 -0
- package/dist/modules/kb-sync/kb-sync.routes.js.map +1 -0
- package/dist/modules/kb-sync/kb-sync.service.d.ts +45 -0
- package/dist/modules/kb-sync/kb-sync.service.d.ts.map +1 -0
- package/dist/modules/kb-sync/kb-sync.service.js +183 -0
- package/dist/modules/kb-sync/kb-sync.service.js.map +1 -0
- package/dist/modules/kb-sync/sync-auth.d.ts +59 -0
- package/dist/modules/kb-sync/sync-auth.d.ts.map +1 -0
- package/dist/modules/kb-sync/sync-auth.js +62 -0
- package/dist/modules/kb-sync/sync-auth.js.map +1 -0
- package/dist/modules/kb-sync/sync-payload.d.ts +32 -0
- package/dist/modules/kb-sync/sync-payload.d.ts.map +1 -0
- package/dist/modules/kb-sync/sync-payload.js +105 -0
- package/dist/modules/kb-sync/sync-payload.js.map +1 -0
- package/dist/modules/marketplace/git-http.routes.d.ts +42 -0
- package/dist/modules/marketplace/git-http.routes.d.ts.map +1 -0
- package/dist/modules/marketplace/git-http.routes.js +190 -0
- package/dist/modules/marketplace/git-http.routes.js.map +1 -0
- package/dist/modules/marketplace/github-facade/github-facade-admin.routes.d.ts +23 -0
- package/dist/modules/marketplace/github-facade/github-facade-admin.routes.d.ts.map +1 -0
- package/dist/modules/marketplace/github-facade/github-facade-admin.routes.js +59 -0
- package/dist/modules/marketplace/github-facade/github-facade-admin.routes.js.map +1 -0
- package/dist/modules/marketplace/github-facade/github-facade-codes.store.d.ts +59 -0
- package/dist/modules/marketplace/github-facade/github-facade-codes.store.d.ts.map +1 -0
- package/dist/modules/marketplace/github-facade/github-facade-codes.store.js +96 -0
- package/dist/modules/marketplace/github-facade/github-facade-codes.store.js.map +1 -0
- package/dist/modules/marketplace/github-facade/github-facade-credentials.service.d.ts +99 -0
- package/dist/modules/marketplace/github-facade/github-facade-credentials.service.d.ts.map +1 -0
- package/dist/modules/marketplace/github-facade/github-facade-credentials.service.js +147 -0
- package/dist/modules/marketplace/github-facade/github-facade-credentials.service.js.map +1 -0
- package/dist/modules/marketplace/github-facade/github-facade.routes.d.ts +47 -0
- package/dist/modules/marketplace/github-facade/github-facade.routes.d.ts.map +1 -0
- package/dist/modules/marketplace/github-facade/github-facade.routes.js +228 -0
- package/dist/modules/marketplace/github-facade/github-facade.routes.js.map +1 -0
- package/dist/modules/marketplace/github-facade/github-facade.service.d.ts +109 -0
- package/dist/modules/marketplace/github-facade/github-facade.service.d.ts.map +1 -0
- package/dist/modules/marketplace/github-facade/github-facade.service.js +172 -0
- package/dist/modules/marketplace/github-facade/github-facade.service.js.map +1 -0
- package/dist/modules/marketplace/github-facade/index.d.ts +6 -0
- package/dist/modules/marketplace/github-facade/index.d.ts.map +1 -0
- package/dist/modules/marketplace/github-facade/index.js +6 -0
- package/dist/modules/marketplace/github-facade/index.js.map +1 -0
- package/dist/modules/marketplace/index.d.ts +4 -0
- package/dist/modules/marketplace/index.d.ts.map +1 -0
- package/dist/modules/marketplace/index.js +4 -0
- package/dist/modules/marketplace/index.js.map +1 -0
- package/dist/modules/marketplace/marketplace-repo.service.d.ts +122 -0
- package/dist/modules/marketplace/marketplace-repo.service.d.ts.map +1 -0
- package/dist/modules/marketplace/marketplace-repo.service.js +300 -0
- package/dist/modules/marketplace/marketplace-repo.service.js.map +1 -0
- package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts.map +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js +4 -0
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js.map +1 -1
- package/dist/modules/mcp/oauth/oauth-consent.routes.d.ts +14 -8
- package/dist/modules/mcp/oauth/oauth-consent.routes.d.ts.map +1 -1
- package/dist/modules/mcp/oauth/oauth-consent.routes.js +13 -1
- package/dist/modules/mcp/oauth/oauth-consent.routes.js.map +1 -1
- package/dist/modules/mcp/oauth/oauth-state.d.ts +13 -2
- package/dist/modules/mcp/oauth/oauth-state.d.ts.map +1 -1
- package/dist/modules/mcp/oauth/oauth-state.js +3 -1
- package/dist/modules/mcp/oauth/oauth-state.js.map +1 -1
- package/dist/modules/plugins/compile/compile-marketplace.d.ts +97 -0
- package/dist/modules/plugins/compile/compile-marketplace.d.ts.map +1 -0
- package/dist/modules/plugins/compile/compile-marketplace.js +240 -0
- package/dist/modules/plugins/compile/compile-marketplace.js.map +1 -0
- package/dist/modules/plugins/compile/marketplace-compiler.service.d.ts +66 -0
- package/dist/modules/plugins/compile/marketplace-compiler.service.d.ts.map +1 -0
- package/dist/modules/plugins/compile/marketplace-compiler.service.js +132 -0
- package/dist/modules/plugins/compile/marketplace-compiler.service.js.map +1 -0
- package/dist/modules/plugins/discovery/bundle-dialect/bundle.source.d.ts +37 -0
- package/dist/modules/plugins/discovery/bundle-dialect/bundle.source.d.ts.map +1 -0
- package/dist/modules/plugins/discovery/bundle-dialect/bundle.source.js +135 -0
- package/dist/modules/plugins/discovery/bundle-dialect/bundle.source.js.map +1 -0
- package/dist/modules/plugins/discovery/bundle-dialect/registry.d.ts +45 -0
- package/dist/modules/plugins/discovery/bundle-dialect/registry.d.ts.map +1 -0
- package/dist/modules/plugins/discovery/bundle-dialect/registry.js +147 -0
- package/dist/modules/plugins/discovery/bundle-dialect/registry.js.map +1 -0
- package/dist/modules/plugins/discovery/kb-plugin-source.d.ts +37 -0
- package/dist/modules/plugins/discovery/kb-plugin-source.d.ts.map +1 -0
- package/dist/modules/plugins/discovery/kb-plugin-source.js +107 -0
- package/dist/modules/plugins/discovery/kb-plugin-source.js.map +1 -0
- package/dist/modules/plugins/discovery/native.source.d.ts +15 -0
- package/dist/modules/plugins/discovery/native.source.d.ts.map +1 -0
- package/dist/modules/plugins/discovery/native.source.js +102 -0
- package/dist/modules/plugins/discovery/native.source.js.map +1 -0
- package/dist/modules/plugins/discovery/plugin-source.d.ts +96 -0
- package/dist/modules/plugins/discovery/plugin-source.d.ts.map +1 -0
- package/dist/modules/plugins/discovery/plugin-source.js +2 -0
- package/dist/modules/plugins/discovery/plugin-source.js.map +1 -0
- package/dist/modules/plugins/index.d.ts +10 -1
- package/dist/modules/plugins/index.d.ts.map +1 -1
- package/dist/modules/plugins/index.js +8 -0
- package/dist/modules/plugins/index.js.map +1 -1
- package/dist/modules/plugins/plugin-links.d.ts +66 -0
- package/dist/modules/plugins/plugin-links.d.ts.map +1 -0
- package/dist/modules/plugins/plugin-links.js +160 -0
- package/dist/modules/plugins/plugin-links.js.map +1 -0
- package/dist/modules/plugins/plugin-links.service.d.ts +114 -0
- package/dist/modules/plugins/plugin-links.service.d.ts.map +1 -0
- package/dist/modules/plugins/plugin-links.service.js +304 -0
- package/dist/modules/plugins/plugin-links.service.js.map +1 -0
- package/dist/modules/plugins/plugin-provision.service.d.ts +39 -3
- package/dist/modules/plugins/plugin-provision.service.d.ts.map +1 -1
- package/dist/modules/plugins/plugin-provision.service.js +152 -52
- package/dist/modules/plugins/plugin-provision.service.js.map +1 -1
- package/dist/modules/plugins/plugin-rename.service.d.ts +69 -0
- package/dist/modules/plugins/plugin-rename.service.d.ts.map +1 -0
- package/dist/modules/plugins/plugin-rename.service.js +245 -0
- package/dist/modules/plugins/plugin-rename.service.js.map +1 -0
- package/dist/modules/plugins/plugins.contract.d.ts +27 -1
- package/dist/modules/plugins/plugins.contract.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.routes.d.ts +7 -1
- package/dist/modules/plugins/plugins.routes.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.routes.js +120 -12
- package/dist/modules/plugins/plugins.routes.js.map +1 -1
- package/dist/modules/plugins/plugins.service.d.ts +50 -3
- package/dist/modules/plugins/plugins.service.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.service.js +108 -47
- package/dist/modules/plugins/plugins.service.js.map +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.js +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.js.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.d.ts +6 -0
- package/dist/modules/secrets-vault/secrets-vault.routes.d.ts.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.js +31 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.js.map +1 -1
- package/dist/modules/settings/deployment-settings.service.d.ts +9 -0
- package/dist/modules/settings/deployment-settings.service.d.ts.map +1 -1
- package/dist/modules/settings/deployment-settings.service.js +82 -2
- package/dist/modules/settings/deployment-settings.service.js.map +1 -1
- package/dist/modules/settings/setup.routes.d.ts +26 -0
- package/dist/modules/settings/setup.routes.d.ts.map +1 -1
- package/dist/modules/settings/setup.routes.js +9 -1
- package/dist/modules/settings/setup.routes.js.map +1 -1
- package/dist/modules/skills/index.d.ts +1 -0
- package/dist/modules/skills/index.d.ts.map +1 -1
- package/dist/modules/skills/index.js +1 -0
- package/dist/modules/skills/index.js.map +1 -1
- package/dist/modules/skills/pending-skills.service.d.ts.map +1 -1
- package/dist/modules/skills/pending-skills.service.js +9 -4
- package/dist/modules/skills/pending-skills.service.js.map +1 -1
- package/dist/modules/skills/skill-access-requests.routes.d.ts +38 -0
- package/dist/modules/skills/skill-access-requests.routes.d.ts.map +1 -0
- package/dist/modules/skills/skill-access-requests.routes.js +168 -0
- package/dist/modules/skills/skill-access-requests.routes.js.map +1 -0
- package/dist/modules/skills/skills.contract.d.ts +31 -0
- package/dist/modules/skills/skills.contract.d.ts.map +1 -1
- package/dist/modules/skills/skills.routes.d.ts +28 -3
- package/dist/modules/skills/skills.routes.d.ts.map +1 -1
- package/dist/modules/skills/skills.routes.js +42 -3
- package/dist/modules/skills/skills.routes.js.map +1 -1
- package/dist/modules/skills/skills.service.d.ts +4 -0
- package/dist/modules/skills/skills.service.d.ts.map +1 -1
- package/dist/modules/skills/skills.service.js +83 -22
- package/dist/modules/skills/skills.service.js.map +1 -1
- package/dist/modules/tool-auth/external-api-key.interface.d.ts +18 -1
- package/dist/modules/tool-auth/external-api-key.interface.d.ts.map +1 -1
- package/dist/modules/tool-auth/external-api-key.interface.js +2 -1
- package/dist/modules/tool-auth/external-api-key.interface.js.map +1 -1
- package/dist/modules/tool-auth/external-api-key.service.d.ts +13 -4
- package/dist/modules/tool-auth/external-api-key.service.d.ts.map +1 -1
- package/dist/modules/tool-auth/external-api-key.service.js +26 -9
- package/dist/modules/tool-auth/external-api-key.service.js.map +1 -1
- package/dist/modules/tool-manuals/mcp-json-discovery.d.ts +36 -0
- package/dist/modules/tool-manuals/mcp-json-discovery.d.ts.map +1 -1
- package/dist/modules/tool-manuals/mcp-json-discovery.js +130 -83
- package/dist/modules/tool-manuals/mcp-json-discovery.js.map +1 -1
- package/dist/modules/tool-manuals/mcp-server-edit.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/mcp-server-edit.service.js +10 -4
- package/dist/modules/tool-manuals/mcp-server-edit.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.contract.d.ts +83 -0
- package/dist/modules/tool-manuals/tool-manuals.contract.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts +15 -2
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.js +199 -38
- package/dist/modules/tool-manuals/tool-manuals.service.js.map +1 -1
- package/dist/modules/workflow/git/git.service.d.ts +58 -3
- package/dist/modules/workflow/git/git.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/git.service.js +325 -60
- package/dist/modules/workflow/git/git.service.js.map +1 -1
- package/dist/modules/workflow/git/pull-request.service.d.ts +6 -0
- package/dist/modules/workflow/git/pull-request.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/pull-request.service.js +8 -0
- package/dist/modules/workflow/git/pull-request.service.js.map +1 -1
- package/dist/modules/workflow/workflow.routes.d.ts +2 -1
- package/dist/modules/workflow/workflow.routes.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.routes.js +98 -9
- package/dist/modules/workflow/workflow.routes.js.map +1 -1
- package/dist/modules/workflow/workflow.service.d.ts +133 -9
- package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.service.js +462 -52
- package/dist/modules/workflow/workflow.service.js.map +1 -1
- package/dist/modules/workspace/startup/steps/plugin-manifests.step.d.ts +35 -0
- package/dist/modules/workspace/startup/steps/plugin-manifests.step.d.ts.map +1 -0
- package/dist/modules/workspace/startup/steps/plugin-manifests.step.js +121 -0
- package/dist/modules/workspace/startup/steps/plugin-manifests.step.js.map +1 -0
- package/dist/modules/workspace/startup/steps/seed-tree.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/seed-tree.js +46 -2
- package/dist/modules/workspace/startup/steps/seed-tree.js.map +1 -1
- package/dist/modules/workspace/startup/steps/template-files.step.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/template-files.step.js +112 -25
- package/dist/modules/workspace/startup/steps/template-files.step.js.map +1 -1
- package/dist/modules/workspace/workspace.routes.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.routes.js +11 -14
- package/dist/modules/workspace/workspace.routes.js.map +1 -1
- package/dist/modules/workspace/workspace.service.d.ts +38 -1
- package/dist/modules/workspace/workspace.service.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.service.js +131 -20
- package/dist/modules/workspace/workspace.service.js.map +1 -1
- package/dist/shared/domain-errors.d.ts +20 -0
- package/dist/shared/domain-errors.d.ts.map +1 -1
- package/dist/shared/domain-errors.js +29 -0
- package/dist/shared/domain-errors.js.map +1 -1
- package/dist/shared/fs-errors.d.ts +8 -0
- package/dist/shared/fs-errors.d.ts.map +1 -0
- package/dist/shared/fs-errors.js +11 -0
- package/dist/shared/fs-errors.js.map +1 -0
- package/dist/shared/fs-walk.d.ts +20 -6
- package/dist/shared/fs-walk.d.ts.map +1 -1
- package/dist/shared/fs-walk.js +35 -27
- package/dist/shared/fs-walk.js.map +1 -1
- package/dist/shared/kb-walk.d.ts +52 -0
- package/dist/shared/kb-walk.d.ts.map +1 -0
- package/dist/shared/kb-walk.js +76 -0
- package/dist/shared/kb-walk.js.map +1 -0
- package/dist/shared/path-order.d.ts +18 -0
- package/dist/shared/path-order.d.ts.map +1 -0
- package/dist/shared/path-order.js +35 -0
- package/dist/shared/path-order.js.map +1 -0
- package/dist/shared/token-crypto.d.ts +17 -2
- package/dist/shared/token-crypto.d.ts.map +1 -1
- package/dist/shared/token-crypto.js +25 -8
- package/dist/shared/token-crypto.js.map +1 -1
- package/dist/shared/ttl-cache.d.ts +28 -1
- package/dist/shared/ttl-cache.d.ts.map +1 -1
- package/dist/shared/ttl-cache.js +33 -1
- package/dist/shared/ttl-cache.js.map +1 -1
- package/kb-template/.bevelignore +1 -1
- package/kb-template/AGENTS.md +95 -30
- package/kb-template/Skills/.gitkeep +0 -0
- package/migrations/0005_github_facade.sql +25 -0
- package/migrations/meta/0005_snapshot.json +1717 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +6 -6
- package/src/__tests__/core-config.admin.test.ts +21 -0
- package/src/__tests__/kb-layout-config.test.ts +110 -0
- package/src/core/__tests__/catalog-cache-invalidation.test.ts +146 -0
- package/src/core/catalog-cache-invalidation.ts +92 -0
- package/src/core/create-core-server.ts +126 -7
- package/src/core/create-core-services.ts +173 -41
- package/src/core-config.ts +14 -7
- package/src/modules/access/__tests__/access-control.invalidate-race.test.ts +86 -0
- package/src/modules/access/__tests__/access-control.service.test.ts +19 -3
- package/src/modules/access/__tests__/access-plugin-principals.test.ts +368 -0
- package/src/modules/access/__tests__/groups-admin.service.test.ts +8 -0
- package/src/modules/access/access-control.interface.ts +20 -9
- package/src/modules/access/access-control.service.ts +240 -78
- package/src/modules/access/access.routes.ts +96 -14
- package/src/modules/access-model/__tests__/access-grammar.test.ts +18 -0
- package/src/modules/access-model/__tests__/plugin-token-canonical.test.ts +40 -0
- package/src/modules/access-model/access-grammar.ts +114 -2
- package/src/modules/access-model/group-files.ts +4 -0
- package/src/modules/access-model/kb-read-filter.ts +22 -0
- package/src/modules/access-model/plugin-principals.ts +137 -0
- package/src/modules/connection-probe/__tests__/connection-probe.service.test.ts +685 -0
- package/src/modules/connection-probe/connection-probe.contract.ts +44 -0
- package/src/modules/connection-probe/connection-probe.service.ts +734 -0
- package/src/modules/connection-probe/index.ts +2 -0
- package/src/modules/database/core-schema.ts +54 -0
- package/src/modules/diff/diff.routes.ts +9 -5
- package/src/modules/kb-fs/__tests__/mutex.test.ts +107 -0
- package/src/modules/kb-fs/mutex.ts +50 -5
- package/src/modules/kb-sync/__tests__/kb-sync.routes.test.ts +297 -0
- package/src/modules/kb-sync/__tests__/kb-sync.service.test.ts +295 -0
- package/src/modules/kb-sync/__tests__/sync-auth.test.ts +118 -0
- package/src/modules/kb-sync/__tests__/sync-payload.test.ts +148 -0
- package/src/modules/kb-sync/index.ts +19 -0
- package/src/modules/kb-sync/kb-sync.interface.ts +79 -0
- package/src/modules/kb-sync/kb-sync.routes.ts +197 -0
- package/src/modules/kb-sync/kb-sync.service.ts +201 -0
- package/src/modules/kb-sync/sync-auth.ts +118 -0
- package/src/modules/kb-sync/sync-payload.ts +143 -0
- package/src/modules/marketplace/__tests__/github-facade.test.ts +443 -0
- package/src/modules/marketplace/__tests__/marketplace-git.test.ts +179 -0
- package/src/modules/marketplace/git-http.routes.ts +193 -0
- package/src/modules/marketplace/github-facade/github-facade-admin.routes.ts +78 -0
- package/src/modules/marketplace/github-facade/github-facade-codes.store.ts +145 -0
- package/src/modules/marketplace/github-facade/github-facade-credentials.service.ts +208 -0
- package/src/modules/marketplace/github-facade/github-facade.routes.ts +268 -0
- package/src/modules/marketplace/github-facade/github-facade.service.ts +221 -0
- package/src/modules/marketplace/github-facade/index.ts +25 -0
- package/src/modules/marketplace/index.ts +3 -0
- package/src/modules/marketplace/marketplace-repo.service.ts +337 -0
- package/src/modules/mcp/oauth/bevel-oauth-provider.ts +3 -0
- package/src/modules/mcp/oauth/oauth-consent.routes.ts +24 -2
- package/src/modules/mcp/oauth/oauth-state.ts +15 -3
- package/src/modules/plugins/__tests__/bundle-dialect.e2e.test.ts +163 -0
- package/src/modules/plugins/__tests__/compile-marketplace.test.ts +294 -0
- package/src/modules/plugins/__tests__/plugin-index.service.test.ts +56 -12
- package/src/modules/plugins/__tests__/plugin-links.service.test.ts +287 -0
- package/src/modules/plugins/__tests__/plugin-provision.service.test.ts +205 -5
- package/src/modules/plugins/__tests__/plugin-rename.service.test.ts +394 -0
- package/src/modules/plugins/__tests__/plugins.routes.test.ts +80 -33
- package/src/modules/plugins/compile/compile-marketplace.ts +403 -0
- package/src/modules/plugins/compile/marketplace-compiler.service.ts +150 -0
- package/src/modules/plugins/discovery/__tests__/kb-plugin-source.test.ts +329 -0
- package/src/modules/plugins/discovery/bundle-dialect/bundle.source.ts +140 -0
- package/src/modules/plugins/discovery/bundle-dialect/registry.ts +175 -0
- package/src/modules/plugins/discovery/kb-plugin-source.ts +114 -0
- package/src/modules/plugins/discovery/native.source.ts +122 -0
- package/src/modules/plugins/discovery/plugin-source.ts +99 -0
- package/src/modules/plugins/index.ts +10 -0
- package/src/modules/plugins/plugin-links.service.ts +363 -0
- package/src/modules/plugins/plugin-links.ts +184 -0
- package/src/modules/plugins/plugin-provision.service.ts +160 -54
- package/src/modules/plugins/plugin-rename.service.ts +298 -0
- package/src/modules/plugins/plugins.contract.ts +28 -1
- package/src/modules/plugins/plugins.routes.ts +128 -11
- package/src/modules/plugins/plugins.service.ts +106 -53
- package/src/modules/secrets-vault/__tests__/connect-pending.route.test.ts +12 -0
- package/src/modules/secrets-vault/__tests__/oauth-return-to.route.test.ts +10 -3
- package/src/modules/secrets-vault/__tests__/tool-owner-gate.route.test.ts +26 -0
- package/src/modules/secrets-vault/db-secrets-vault.service.ts +1 -1
- package/src/modules/secrets-vault/secrets-vault.routes.ts +35 -1
- package/src/modules/settings/__tests__/deployment-settings.service.test.ts +57 -0
- package/src/modules/settings/__tests__/setup.routes.sync-status.test.ts +77 -0
- package/src/modules/settings/deployment-settings.service.ts +95 -2
- package/src/modules/settings/setup.routes.ts +24 -0
- package/src/modules/skills/__tests__/skill-access-requests.routes.test.ts +128 -0
- package/src/modules/skills/__tests__/skills.service.test.ts +85 -0
- package/src/modules/skills/index.ts +1 -0
- package/src/modules/skills/pending-skills.service.ts +7 -5
- package/src/modules/skills/skill-access-requests.routes.ts +199 -0
- package/src/modules/skills/skills.contract.ts +32 -0
- package/src/modules/skills/skills.routes.ts +59 -3
- package/src/modules/skills/skills.service.ts +84 -22
- package/src/modules/tool-auth/external-api-key.interface.ts +20 -1
- package/src/modules/tool-auth/external-api-key.service.ts +31 -13
- package/src/modules/tool-manuals/__tests__/mcp-json-discovery.test.ts +35 -1
- package/src/modules/tool-manuals/__tests__/tool-manuals.cli.test.ts +2 -0
- package/src/modules/tool-manuals/__tests__/tool-manuals.health-check.test.ts +104 -0
- package/src/modules/tool-manuals/__tests__/tool-manuals.service.test.ts +56 -0
- package/src/modules/tool-manuals/mcp-json-discovery.ts +154 -76
- package/src/modules/tool-manuals/mcp-server-edit.service.ts +13 -4
- package/src/modules/tool-manuals/tool-manuals.contract.ts +89 -0
- package/src/modules/tool-manuals/tool-manuals.service.ts +210 -37
- package/src/modules/workflow/__tests__/preserve-roles-yaml.test.ts +1 -1
- package/src/modules/workflow/__tests__/workflow.routes.history-read-gate.test.ts +139 -0
- package/src/modules/workflow/__tests__/workflow.service.branch-in-use.test.ts +337 -0
- package/src/modules/workflow/__tests__/workflow.service.commitFileWhileLocked.test.ts +1 -0
- package/src/modules/workflow/__tests__/workflow.service.deleted-branch-sweep.test.ts +7 -1
- package/src/modules/workflow/__tests__/workflow.service.facade.test.ts +97 -10
- package/src/modules/workflow/__tests__/workflow.service.releaseLock.test.ts +119 -2
- package/src/modules/workflow/__tests__/workflow.service.sync.test.ts +437 -0
- package/src/modules/workflow/git/__tests__/git.service.history-guards.test.ts +86 -0
- package/src/modules/workflow/git/__tests__/git.service.postMergePull.test.ts +3 -3
- package/src/modules/workflow/git/__tests__/git.service.pull.test.ts +47 -4
- package/src/modules/workflow/git/__tests__/git.service.syncFromRemote.test.ts +253 -0
- package/src/modules/workflow/git/git.service.ts +354 -63
- package/src/modules/workflow/git/pull-request.service.ts +9 -0
- package/src/modules/workflow/workflow.routes.ts +104 -4
- package/src/modules/workflow/workflow.service.ts +505 -64
- package/src/modules/workspace/__tests__/workspace.routes.read-gate.test.ts +6 -7
- package/src/modules/workspace/__tests__/workspace.service.list-cloned.test.ts +93 -0
- package/src/modules/workspace/__tests__/workspace.service.missing-branch.test.ts +28 -0
- package/src/modules/workspace/__tests__/workspace.service.read-filter.test.ts +42 -12
- package/src/modules/workspace/startup/steps/__tests__/steps.test.ts +219 -4
- package/src/modules/workspace/startup/steps/plugin-manifests.step.ts +129 -0
- package/src/modules/workspace/startup/steps/seed-tree.ts +44 -2
- package/src/modules/workspace/startup/steps/template-files.step.ts +131 -27
- package/src/modules/workspace/workspace.routes.ts +17 -21
- package/src/modules/workspace/workspace.service.ts +128 -19
- package/src/shared/__tests__/filename.test.ts +0 -0
- package/src/shared/__tests__/fs-walk.test.ts +22 -1
- package/src/shared/__tests__/kb-walk.test.ts +107 -0
- package/src/shared/__tests__/path-order.test.ts +24 -0
- package/src/shared/__tests__/token-crypto.test.ts +34 -0
- package/src/shared/__tests__/ttl-cache.test.ts +55 -0
- package/src/shared/domain-errors.ts +29 -0
- package/src/shared/fs-errors.ts +10 -0
- package/src/shared/fs-walk.ts +38 -23
- package/src/shared/kb-walk.ts +95 -0
- package/src/shared/path-order.ts +33 -0
- package/src/shared/token-crypto.ts +28 -10
- package/src/shared/ttl-cache.ts +33 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { WorkspaceService } from '../../workspace/workspace.service.js';
|
|
2
|
+
import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
3
|
+
import type { ISkillService } from '../../skills/skills.contract.js';
|
|
4
|
+
import type { PluginLinkIndex } from '../plugin-links.js';
|
|
5
|
+
import type { PluginSource } from '../discovery/plugin-source.js';
|
|
6
|
+
import { type VirtualTree } from './compile-marketplace.js';
|
|
7
|
+
/** Whose view of the knowledge base to compile. */
|
|
8
|
+
export type CompileAudience = {
|
|
9
|
+
userEmail: string;
|
|
10
|
+
} | {
|
|
11
|
+
everyone: true;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The compiler wired to the live deployment: the default-branch checkout,
|
|
15
|
+
* the released catalog, the link index, and the access resolver as the read
|
|
16
|
+
* verdict. Every sink — the per-user git endpoint, a public mirror, a local
|
|
17
|
+
* export — asks this for a tree and writes it somewhere.
|
|
18
|
+
*
|
|
19
|
+
* Two audiences: a PERSON (their `canRead` per skill, exactly the catalog's
|
|
20
|
+
* filter) or EVERYONE (only what `read: everyone` reaches cleanly — the
|
|
21
|
+
* public subset a shared mirror may carry). Nothing in between: an audience
|
|
22
|
+
* that is "these three people" would need a union of verdicts nobody has
|
|
23
|
+
* asked for yet.
|
|
24
|
+
*/
|
|
25
|
+
export declare class MarketplaceCompilerService {
|
|
26
|
+
private readonly workspaceService;
|
|
27
|
+
private readonly accessControl;
|
|
28
|
+
private readonly skillService;
|
|
29
|
+
private readonly links;
|
|
30
|
+
private readonly kbDirName;
|
|
31
|
+
private readonly marketplace;
|
|
32
|
+
private readonly source;
|
|
33
|
+
constructor(workspaceService: WorkspaceService, accessControl: IAccessControl, skillService: ISkillService, links: PluginLinkIndex, kbDirName: string, marketplace: {
|
|
34
|
+
name: string;
|
|
35
|
+
owner: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
/** The hosted MCP endpoint to ship in the skills plugin (URL only). */
|
|
38
|
+
knowledgeBaseMcp?: {
|
|
39
|
+
name: string;
|
|
40
|
+
url: string;
|
|
41
|
+
};
|
|
42
|
+
}, source?: PluginSource);
|
|
43
|
+
/**
|
|
44
|
+
* The default-branch commit the next compile would read. Throws when git
|
|
45
|
+
* cannot say: the repo service keys freshness on this value, and a stable
|
|
46
|
+
* placeholder would make every later compile look unnecessary — source
|
|
47
|
+
* changes and access revocations would never reach that caller again.
|
|
48
|
+
*/
|
|
49
|
+
sourceCommit(): Promise<string>;
|
|
50
|
+
compileFor(audience: CompileAudience,
|
|
51
|
+
/** The commit to stamp the tree with, when the caller already read it (the freshness check does). */
|
|
52
|
+
knownCommit?: string): Promise<VirtualTree & {
|
|
53
|
+
sourceCommit: string;
|
|
54
|
+
}>;
|
|
55
|
+
private checkout;
|
|
56
|
+
/**
|
|
57
|
+
* One batch verdict per compile, then a lookup. Fail closed both ways: a
|
|
58
|
+
* path the batch skipped is unreadable, and for the everyone audience a
|
|
59
|
+
* skill is public only when the resolver says `read: everyone` applies
|
|
60
|
+
* cleanly (`restricted: false`).
|
|
61
|
+
*/
|
|
62
|
+
private readPredicate;
|
|
63
|
+
}
|
|
64
|
+
/** The default-branch workspace id compiles run against. */
|
|
65
|
+
export declare function compileWorkspaceId(): string;
|
|
66
|
+
//# sourceMappingURL=marketplace-compiler.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplace-compiler.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/plugins/compile/marketplace-compiler.service.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAIhF,mDAAmD;AACnD,MAAM,MAAM,eAAe,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,CAAC;AAEzE;;;;;;;;;;;GAWG;AACH,qBAAa,0BAA0B;IAEnC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAO5B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAZN,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,cAAc,EAC7B,YAAY,EAAE,aAAa,EAC3B,KAAK,EAAE,eAAe,EACtB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE;QAC5B,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,uEAAuE;QACvE,gBAAgB,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC;KAClD,EACgB,MAAM,GAAE,YAAmC;IAG9D;;;;;OAKG;IACG,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IAW/B,UAAU,CACd,QAAQ,EAAE,eAAe;IACzB,qGAAqG;IACrG,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,WAAW,GAAG;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;YAwCpC,QAAQ;IAKtB;;;;;OAKG;YACW,aAAa;CAyB5B;AAED,4DAA4D;AAC5D,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { execFile } from 'node:child_process';
|
|
3
|
+
import { promisify } from 'node:util';
|
|
4
|
+
import { DEFAULT_BRANCH } from '@bevel-software/platform-shared';
|
|
5
|
+
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
6
|
+
import { KbPluginSource } from '../discovery/kb-plugin-source.js';
|
|
7
|
+
import { compileMarketplace } from './compile-marketplace.js';
|
|
8
|
+
const execFileAsync = promisify(execFile);
|
|
9
|
+
/**
|
|
10
|
+
* The compiler wired to the live deployment: the default-branch checkout,
|
|
11
|
+
* the released catalog, the link index, and the access resolver as the read
|
|
12
|
+
* verdict. Every sink — the per-user git endpoint, a public mirror, a local
|
|
13
|
+
* export — asks this for a tree and writes it somewhere.
|
|
14
|
+
*
|
|
15
|
+
* Two audiences: a PERSON (their `canRead` per skill, exactly the catalog's
|
|
16
|
+
* filter) or EVERYONE (only what `read: everyone` reaches cleanly — the
|
|
17
|
+
* public subset a shared mirror may carry). Nothing in between: an audience
|
|
18
|
+
* that is "these three people" would need a union of verdicts nobody has
|
|
19
|
+
* asked for yet.
|
|
20
|
+
*/
|
|
21
|
+
export class MarketplaceCompilerService {
|
|
22
|
+
workspaceService;
|
|
23
|
+
accessControl;
|
|
24
|
+
skillService;
|
|
25
|
+
links;
|
|
26
|
+
kbDirName;
|
|
27
|
+
marketplace;
|
|
28
|
+
source;
|
|
29
|
+
constructor(workspaceService, accessControl, skillService, links, kbDirName, marketplace, source = new KbPluginSource()) {
|
|
30
|
+
this.workspaceService = workspaceService;
|
|
31
|
+
this.accessControl = accessControl;
|
|
32
|
+
this.skillService = skillService;
|
|
33
|
+
this.links = links;
|
|
34
|
+
this.kbDirName = kbDirName;
|
|
35
|
+
this.marketplace = marketplace;
|
|
36
|
+
this.source = source;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The default-branch commit the next compile would read. Throws when git
|
|
40
|
+
* cannot say: the repo service keys freshness on this value, and a stable
|
|
41
|
+
* placeholder would make every later compile look unnecessary — source
|
|
42
|
+
* changes and access revocations would never reach that caller again.
|
|
43
|
+
*/
|
|
44
|
+
async sourceCommit() {
|
|
45
|
+
const { kbRoot } = await this.checkout();
|
|
46
|
+
const { stdout } = await execFileAsync('git', ['-C', kbRoot, 'rev-parse', 'HEAD']);
|
|
47
|
+
const sha = stdout.trim();
|
|
48
|
+
// SHA-1 or SHA-256 object format: any hex object id is a commit.
|
|
49
|
+
if (!/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/.test(sha)) {
|
|
50
|
+
throw new Error(`could not read the default branch's commit (${sha || 'empty'})`);
|
|
51
|
+
}
|
|
52
|
+
return sha;
|
|
53
|
+
}
|
|
54
|
+
async compileFor(audience,
|
|
55
|
+
/** The commit to stamp the tree with, when the caller already read it (the freshness check does). */
|
|
56
|
+
knownCommit) {
|
|
57
|
+
const { wsId, kbRoot } = await this.checkout();
|
|
58
|
+
// Strictness about the commit belongs to the FRESHNESS check (the repo
|
|
59
|
+
// service calls `sourceCommit()` itself and refuses to serve without
|
|
60
|
+
// one). A compile of a checkout git cannot describe still yields a
|
|
61
|
+
// correct tree; only its README and bundle version lose the sha.
|
|
62
|
+
const sourceCommit = knownCommit ?? (await this.sourceCommit().catch(() => 'unknown'));
|
|
63
|
+
// The tree is stamped with the checkout's commit, so every input must be
|
|
64
|
+
// read from that checkout NOW — not from a catalog scanned before the
|
|
65
|
+
// commit landed. The skill catalog, the link index and the access memo
|
|
66
|
+
// are TTL caches that nothing drops on an ordinary write (an MCP
|
|
67
|
+
// `write_files` moves HEAD and invalidates none of them), and the repo
|
|
68
|
+
// service keys freshness on the stamped commit: a tree compiled from a
|
|
69
|
+
// stale catalog under a fresh sha would be "current" until the NEXT
|
|
70
|
+
// commit, with the caller's marketplace frozen on content the knowledge
|
|
71
|
+
// base no longer has. Compiles run once per moved commit per caller, so
|
|
72
|
+
// the rescan is cheap where it matters.
|
|
73
|
+
this.skillService.invalidate();
|
|
74
|
+
this.links.invalidate();
|
|
75
|
+
this.accessControl.invalidate(wsId);
|
|
76
|
+
const skills = await this.skillService.listSkills(undefined);
|
|
77
|
+
const membership = await this.links.membership();
|
|
78
|
+
const { plugins, warnings: discoveryWarnings } = await this.source.discover(kbRoot);
|
|
79
|
+
const readable = await this.readPredicate(wsId, audience, skills.map((s) => `${s.path}/SKILL.md`));
|
|
80
|
+
const tree = await compileMarketplace({
|
|
81
|
+
kbRoot,
|
|
82
|
+
skills,
|
|
83
|
+
plugins,
|
|
84
|
+
membership,
|
|
85
|
+
readable,
|
|
86
|
+
options: { ...this.marketplace, sourceCommit },
|
|
87
|
+
});
|
|
88
|
+
// Discovery's warnings ride with the compile's: a plugin left out for a
|
|
89
|
+
// malformed manifest or an unresolved MCP profile is otherwise an
|
|
90
|
+
// omission nobody can diagnose from the tree alone.
|
|
91
|
+
return { ...tree, warnings: [...discoveryWarnings, ...tree.warnings], sourceCommit };
|
|
92
|
+
}
|
|
93
|
+
// --- internal --------------------------------------------------------------
|
|
94
|
+
async checkout() {
|
|
95
|
+
const wsId = (await this.workspaceService.getOrCreateForBranch(DEFAULT_BRANCH)).id;
|
|
96
|
+
return { wsId, kbRoot: path.join(await this.workspaceService.getWorkspacePath(wsId), this.kbDirName) };
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* One batch verdict per compile, then a lookup. Fail closed both ways: a
|
|
100
|
+
* path the batch skipped is unreadable, and for the everyone audience a
|
|
101
|
+
* skill is public only when the resolver says `read: everyone` applies
|
|
102
|
+
* cleanly (`restricted: false`).
|
|
103
|
+
*/
|
|
104
|
+
async readPredicate(wsId, audience, docPaths) {
|
|
105
|
+
if ('userEmail' in audience) {
|
|
106
|
+
const verdicts = docPaths.length
|
|
107
|
+
? await this.accessControl.canReadBatch(wsId, audience.userEmail, docPaths)
|
|
108
|
+
: new Map();
|
|
109
|
+
return async (p) => verdicts.get(p) === true;
|
|
110
|
+
}
|
|
111
|
+
const cache = new Map();
|
|
112
|
+
return async (p) => {
|
|
113
|
+
const hit = cache.get(p);
|
|
114
|
+
if (hit !== undefined)
|
|
115
|
+
return hit;
|
|
116
|
+
let verdict = false;
|
|
117
|
+
try {
|
|
118
|
+
verdict = !(await this.accessControl.eligibleReaders(wsId, p)).restricted;
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
verdict = false;
|
|
122
|
+
}
|
|
123
|
+
cache.set(p, verdict);
|
|
124
|
+
return verdict;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/** The default-branch workspace id compiles run against. */
|
|
129
|
+
export function compileWorkspaceId() {
|
|
130
|
+
return workspaceIdForBranch(DEFAULT_BRANCH);
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=marketplace-compiler.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplace-compiler.service.js","sourceRoot":"","sources":["../../../../src/modules/plugins/compile/marketplace-compiler.service.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAIjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAGvE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAoB,MAAM,0BAA0B,CAAC;AAEhF,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAK1C;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,0BAA0B;IAElB;IACA;IACA;IACA;IACA;IACA;IAOA;IAbnB,YACmB,gBAAkC,EAClC,aAA6B,EAC7B,YAA2B,EAC3B,KAAsB,EACtB,SAAiB,EACjB,WAMhB,EACgB,SAAuB,IAAI,cAAc,EAAE;QAZ3C,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,kBAAa,GAAb,aAAa,CAAgB;QAC7B,iBAAY,GAAZ,YAAY,CAAe;QAC3B,UAAK,GAAL,KAAK,CAAiB;QACtB,cAAS,GAAT,SAAS,CAAQ;QACjB,gBAAW,GAAX,WAAW,CAM3B;QACgB,WAAM,GAAN,MAAM,CAAqC;IAC3D,CAAC;IAEJ;;;;;OAKG;IACH,KAAK,CAAC,YAAY;QAChB,M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I,CAAC,aAAa,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC;gBAC3E,CAAC,CAAC,IAAI,GAAG,EAAmB,CAAC;YAC/B,OAAO,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;QAC/C,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAmB,CAAC;QACzC,OAAO,KAAK,EAAE,CAAC,EAAE,EAAE;YACjB,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACzB,IAAI,GAAG,KAAK,SAAS;gBAAE,OAAO,GAAG,CAAC;YAClC,IAAI,OAAO,GAAG,KAAK,CAAC;YACpB,IAAI,CAAC;gBACH,OAAO,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;YAC5E,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,GAAG,KAAK,CAAC;YAClB,CAAC;YACD,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACtB,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;CACF;AAED,4DAA4D;AAC5D,MAAM,UAAU,kBAAkB;IAChC,OAAO,oBAAoB,CAAC,cAAc,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { DiscoveredPlugin } from '../plugin-source.js';
|
|
2
|
+
import { type McpRegistry } from './registry.js';
|
|
3
|
+
/**
|
|
4
|
+
* THE DETACHABLE PART — a customer's plugin file format, read as-is:
|
|
5
|
+
*
|
|
6
|
+
* <pluginsRoot>/<scope…>/<plugin>/plugin.bundle.json
|
|
7
|
+
* {
|
|
8
|
+
* "name": "example-plugin", "version": "1.3.1", "description": "…",
|
|
9
|
+
* "mcpProfile": "global",
|
|
10
|
+
* "interface": { "displayName": "Example Plugin", "category": "…" },
|
|
11
|
+
* "sourceSkillRoots": [ "skills/departments/engineering/shared/<cluster>" ]
|
|
12
|
+
* }
|
|
13
|
+
*
|
|
14
|
+
* A bundle is a LIST OF SKILL PATHS plus a pointer into an MCP registry —
|
|
15
|
+
* which is exactly the native model's "a plugin links skills" with different
|
|
16
|
+
* field names. So the reader maps:
|
|
17
|
+
*
|
|
18
|
+
* sourceSkillRoots → linkedRoots (a root is a skill or a folder of skills)
|
|
19
|
+
* mcpProfile → mcpServers (expanded through the registry)
|
|
20
|
+
* name/version/desc → a synthesised manifest
|
|
21
|
+
* interface.displayName → the plugin's display name
|
|
22
|
+
*
|
|
23
|
+
* The walker (`kb-plugin-source.ts`) calls this for every folder holding a
|
|
24
|
+
* bundle file; this reads the file and decides nothing else. READ-ONLY by
|
|
25
|
+
* construction: nothing in this directory writes. A bundle's links are plain
|
|
26
|
+
* references (`linksAreManaged: false`): no principal grant is written or
|
|
27
|
+
* checked, the skills' own scopes decide readability.
|
|
28
|
+
*
|
|
29
|
+
* Deleting the dialect later = this directory, the one `else if` in the
|
|
30
|
+
* walker that calls it, and the walker's registry load.
|
|
31
|
+
*/
|
|
32
|
+
export declare const BUNDLE_FILE = "plugin.bundle.json";
|
|
33
|
+
export declare const DEFAULT_REGISTRY_PATH = "configs/mcp/registry.json";
|
|
34
|
+
/** The registry, when the repository has one; a missing file is null, a broken one warns. */
|
|
35
|
+
export declare function loadRegistry(kbRoot: string, warnings: string[]): Promise<McpRegistry | null>;
|
|
36
|
+
export declare function readBundlePlugin(dir: string, folder: string, relFolder: string, registry: McpRegistry | null, warnings: string[], unreadable: string[]): Promise<DiscoveredPlugin | null>;
|
|
37
|
+
//# sourceMappingURL=bundle.source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.source.d.ts","sourceRoot":"","sources":["../../../../../src/modules/plugins/discovery/bundle-dialect/bundle.source.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAgC,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAChD,eAAO,MAAM,qBAAqB,8BAA8B,CAAC;AAEjE,6FAA6F;AAC7F,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAgBlG;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,WAAW,GAAG,IAAI,EAC5B,QAAQ,EAAE,MAAM,EAAE,EAClB,UAAU,EAAE,MAAM,EAAE,GACnB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CA0ElC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { isPersonalPluginDir, normalizeSkillRoot, pluginManifestName } from '@bevel-software/platform-shared';
|
|
4
|
+
import { isAbsence } from '../../../../shared/fs-errors.js';
|
|
5
|
+
import { expandProfile, parseRegistry } from './registry.js';
|
|
6
|
+
/**
|
|
7
|
+
* THE DETACHABLE PART — a customer's plugin file format, read as-is:
|
|
8
|
+
*
|
|
9
|
+
* <pluginsRoot>/<scope…>/<plugin>/plugin.bundle.json
|
|
10
|
+
* {
|
|
11
|
+
* "name": "example-plugin", "version": "1.3.1", "description": "…",
|
|
12
|
+
* "mcpProfile": "global",
|
|
13
|
+
* "interface": { "displayName": "Example Plugin", "category": "…" },
|
|
14
|
+
* "sourceSkillRoots": [ "skills/departments/engineering/shared/<cluster>" ]
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* A bundle is a LIST OF SKILL PATHS plus a pointer into an MCP registry —
|
|
18
|
+
* which is exactly the native model's "a plugin links skills" with different
|
|
19
|
+
* field names. So the reader maps:
|
|
20
|
+
*
|
|
21
|
+
* sourceSkillRoots → linkedRoots (a root is a skill or a folder of skills)
|
|
22
|
+
* mcpProfile → mcpServers (expanded through the registry)
|
|
23
|
+
* name/version/desc → a synthesised manifest
|
|
24
|
+
* interface.displayName → the plugin's display name
|
|
25
|
+
*
|
|
26
|
+
* The walker (`kb-plugin-source.ts`) calls this for every folder holding a
|
|
27
|
+
* bundle file; this reads the file and decides nothing else. READ-ONLY by
|
|
28
|
+
* construction: nothing in this directory writes. A bundle's links are plain
|
|
29
|
+
* references (`linksAreManaged: false`): no principal grant is written or
|
|
30
|
+
* checked, the skills' own scopes decide readability.
|
|
31
|
+
*
|
|
32
|
+
* Deleting the dialect later = this directory, the one `else if` in the
|
|
33
|
+
* walker that calls it, and the walker's registry load.
|
|
34
|
+
*/
|
|
35
|
+
export const BUNDLE_FILE = 'plugin.bundle.json';
|
|
36
|
+
export const DEFAULT_REGISTRY_PATH = 'configs/mcp/registry.json';
|
|
37
|
+
/** The registry, when the repository has one; a missing file is null, a broken one warns. */
|
|
38
|
+
export async function loadRegistry(kbRoot, warnings) {
|
|
39
|
+
let text;
|
|
40
|
+
try {
|
|
41
|
+
text = await fs.readFile(path.join(kbRoot, DEFAULT_REGISTRY_PATH), 'utf-8');
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
// No registry is a valid state: bundles without a profile are still
|
|
45
|
+
// plugins. A registry that exists but cannot be read is not.
|
|
46
|
+
if (!isAbsence(err)) {
|
|
47
|
+
const code = err?.code;
|
|
48
|
+
warnings.push(`${DEFAULT_REGISTRY_PATH} could not be read (${String(code ?? err)}) — every mcpProfile is unresolved`);
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
const registry = parseRegistry(text);
|
|
53
|
+
warnings.push(...registry.warnings);
|
|
54
|
+
return registry;
|
|
55
|
+
}
|
|
56
|
+
export async function readBundlePlugin(dir, folder, relFolder, registry, warnings, unreadable) {
|
|
57
|
+
// Reading and parsing are two failures with two meanings: a file that
|
|
58
|
+
// cannot be read is a plugin nobody could see (counted, so a writer can
|
|
59
|
+
// refuse); a file that is not a bundle is a plugin that is not there.
|
|
60
|
+
let text;
|
|
61
|
+
try {
|
|
62
|
+
text = await fs.readFile(path.join(dir, BUNDLE_FILE), 'utf-8');
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
if (!isAbsence(err)) {
|
|
66
|
+
warnings.push(`${folder}/${BUNDLE_FILE} could not be read — ${err instanceof Error ? err.message : String(err)}`);
|
|
67
|
+
unreadable.push(`${folder}/${BUNDLE_FILE}`);
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
let bundle;
|
|
72
|
+
try {
|
|
73
|
+
const parsed = JSON.parse(text);
|
|
74
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed))
|
|
75
|
+
throw new Error('not an object');
|
|
76
|
+
bundle = parsed;
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
warnings.push(`${folder}/${BUNDLE_FILE} is not a JSON object — plugin skipped`);
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
const leaf = path.posix.basename(relFolder);
|
|
83
|
+
const name = typeof bundle.name === 'string' && bundle.name.trim() ? bundle.name.trim() : leaf;
|
|
84
|
+
const linkedRoots = [];
|
|
85
|
+
for (const raw of Array.isArray(bundle.sourceSkillRoots) ? bundle.sourceSkillRoots : []) {
|
|
86
|
+
const normalised = normalizeSkillRoot(typeof raw === 'string' ? raw : '');
|
|
87
|
+
if (normalised === null) {
|
|
88
|
+
warnings.push(`${folder}: sourceSkillRoots entry ${JSON.stringify(raw)} is not a folder path — ignored`);
|
|
89
|
+
}
|
|
90
|
+
else if (!linkedRoots.includes(normalised)) {
|
|
91
|
+
linkedRoots.push(normalised);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
let mcpServers = null;
|
|
95
|
+
if (typeof bundle.mcpProfile === 'string' && bundle.mcpProfile.trim()) {
|
|
96
|
+
if (!registry) {
|
|
97
|
+
warnings.push(`${folder}: mcpProfile "${bundle.mcpProfile}" named but no registry could be read`);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const expanded = expandProfile(registry, bundle.mcpProfile.trim());
|
|
101
|
+
warnings.push(...expanded.warnings.map((w) => `${folder}: ${w}`));
|
|
102
|
+
if (Object.keys(expanded.mcpServers).length > 0)
|
|
103
|
+
mcpServers = expanded.mcpServers;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const ui = typeof bundle.interface === 'object' && bundle.interface !== null
|
|
107
|
+
? bundle.interface
|
|
108
|
+
: {};
|
|
109
|
+
const manifest = { name: pluginManifestName(name) };
|
|
110
|
+
if (typeof bundle.version === 'string')
|
|
111
|
+
manifest.version = bundle.version;
|
|
112
|
+
if (typeof bundle.description === 'string')
|
|
113
|
+
manifest.description = bundle.description;
|
|
114
|
+
if (typeof ui.displayName === 'string')
|
|
115
|
+
manifest.displayName = ui.displayName;
|
|
116
|
+
return {
|
|
117
|
+
name,
|
|
118
|
+
// The shared contract (`DiscoveredPlugin.displayName`): the declared
|
|
119
|
+
// display name, else the FOLDER — never the identity.
|
|
120
|
+
displayName: typeof ui.displayName === 'string' && ui.displayName.trim() ? ui.displayName.trim() : leaf,
|
|
121
|
+
folder,
|
|
122
|
+
relFolder,
|
|
123
|
+
// The same rule as the native reader: a reserved personal folder directly
|
|
124
|
+
// under the root is a place, not a plugin, whatever file it carries.
|
|
125
|
+
personal: isPersonalPluginDir(folder),
|
|
126
|
+
exists: true,
|
|
127
|
+
manifest,
|
|
128
|
+
manifestText: null,
|
|
129
|
+
linkedRoots,
|
|
130
|
+
mcpServers,
|
|
131
|
+
mcpJsonText: mcpServers ? JSON.stringify({ mcpServers }) : null,
|
|
132
|
+
linksAreManaged: false,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=bundle.source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.source.js","sourceRoot":"","sources":["../../../../../src/modules/plugins/discovery/bundle-dialect/bundle.source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC9G,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAoB,MAAM,eAAe,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAChD,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAEjE,6FAA6F;AAC7F,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAAc,EAAE,QAAkB;IACnE,IAAI,IAAY,CAAC;IACjB,IAAI,CAAC;QACH,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,qBAAqB,CAAC,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,oEAAoE;QACpE,6DAA6D;QAC7D,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;YACpB,MAAM,IAAI,GAAI,GAAiC,EAAE,IAAI,CAAC;YACtD,QAAQ,CAAC,IAAI,CAAC,GAAG,qBAAqB,uBAAuB,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC,oCAAoC,CAAC,CAAC;QACxH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM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T,0EAA0E;QAC1E,qEAAqE;QACrE,QAAQ,EAAE,mBAAmB,CAAC,MAAM,CAAC;QACrC,MAAM,EAAE,IAAI;QACZ,QAAQ;QACR,YAAY,EAAE,IAAI;QAClB,WAAW;QACX,UAAU;QACV,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;QAC/D,eAAe,EAAE,KAAK;KACvB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The customer's MCP registry — `configs/mcp/registry.json` — and how a
|
|
3
|
+
* bundle's `mcpProfile` expands through it into an `mcpServers` map of the
|
|
4
|
+
* shape `mcp.json` carries.
|
|
5
|
+
*
|
|
6
|
+
* The file holds two lists:
|
|
7
|
+
*
|
|
8
|
+
* servers each with an `id`, a `name`, and the real config — either a
|
|
9
|
+
* stdio launch (`command`, `args`, `env`) or `type: http` + `url`;
|
|
10
|
+
* the config may sit under a `config` key or flat on the entry.
|
|
11
|
+
* profiles each with an `id`, the server ids it selects, and an optional
|
|
12
|
+
* `extends` naming another profile (a chain, never a cycle).
|
|
13
|
+
*
|
|
14
|
+
* Pure: parse once, expand many. Unknown ids and cycles are warnings, never
|
|
15
|
+
* throws — a registry typo must not take every plugin down.
|
|
16
|
+
*/
|
|
17
|
+
import { type PortableHttpEntry, type PortableStdioEntry } from '../../../tool-manuals/mcp-json-discovery.js';
|
|
18
|
+
export interface RegistryServer {
|
|
19
|
+
id: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
/** The server as one `mcp.json` entry — judged, and therefore usable, at parse time. */
|
|
22
|
+
entry: PortableStdioEntry | PortableHttpEntry;
|
|
23
|
+
}
|
|
24
|
+
export interface RegistryProfile {
|
|
25
|
+
id: string;
|
|
26
|
+
servers: string[];
|
|
27
|
+
extends?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface McpRegistry {
|
|
30
|
+
servers: Map<string, RegistryServer>;
|
|
31
|
+
profiles: Map<string, RegistryProfile>;
|
|
32
|
+
warnings: string[];
|
|
33
|
+
}
|
|
34
|
+
export declare function parseRegistry(text: string): McpRegistry;
|
|
35
|
+
/**
|
|
36
|
+
* The `mcpServers` map a profile resolves to, in `mcp.json` terms. Keyed by
|
|
37
|
+
* server id — the namespace vault secrets bind to, so the same registry
|
|
38
|
+
* server in three plugins shares one credential, which is what a registry
|
|
39
|
+
* means.
|
|
40
|
+
*/
|
|
41
|
+
export declare function expandProfile(registry: McpRegistry, profileId: string): {
|
|
42
|
+
mcpServers: Record<string, unknown>;
|
|
43
|
+
warnings: string[];
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../../src/modules/plugins/discovery/bundle-dialect/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,6CAA6C,CAAC;AAErD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,KAAK,EAAE,kBAAkB,GAAG,iBAAiB,CAAC;CAC/C;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACrC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACvC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAgDvD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,WAAW,EACrB,SAAS,EAAE,MAAM,GAChB;IAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CA+B7D"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The customer's MCP registry — `configs/mcp/registry.json` — and how a
|
|
3
|
+
* bundle's `mcpProfile` expands through it into an `mcpServers` map of the
|
|
4
|
+
* shape `mcp.json` carries.
|
|
5
|
+
*
|
|
6
|
+
* The file holds two lists:
|
|
7
|
+
*
|
|
8
|
+
* servers each with an `id`, a `name`, and the real config — either a
|
|
9
|
+
* stdio launch (`command`, `args`, `env`) or `type: http` + `url`;
|
|
10
|
+
* the config may sit under a `config` key or flat on the entry.
|
|
11
|
+
* profiles each with an `id`, the server ids it selects, and an optional
|
|
12
|
+
* `extends` naming another profile (a chain, never a cycle).
|
|
13
|
+
*
|
|
14
|
+
* Pure: parse once, expand many. Unknown ids and cycles are warnings, never
|
|
15
|
+
* throws — a registry typo must not take every plugin down.
|
|
16
|
+
*/
|
|
17
|
+
import { judgeMcpServerEntry, } from '../../../tool-manuals/mcp-json-discovery.js';
|
|
18
|
+
export function parseRegistry(text) {
|
|
19
|
+
const warnings = [];
|
|
20
|
+
const servers = new Map();
|
|
21
|
+
const profiles = new Map();
|
|
22
|
+
let root;
|
|
23
|
+
try {
|
|
24
|
+
root = JSON.parse(text);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return { servers, profiles, warnings: ['registry.json is not valid JSON'] };
|
|
28
|
+
}
|
|
29
|
+
if (!isRecord(root))
|
|
30
|
+
return { servers, profiles, warnings: ['registry.json must be a JSON object'] };
|
|
31
|
+
for (const raw of asArray(root.servers)) {
|
|
32
|
+
if (!isRecord(raw) || typeof raw.id !== 'string' || !raw.id) {
|
|
33
|
+
warnings.push('registry.json: a server without an id was skipped');
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (servers.has(raw.id)) {
|
|
37
|
+
warnings.push(`registry.json: server "${raw.id}" is declared twice — the second declaration is ignored`);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
// Converting IS the validation: a server the registry keeps is one whose
|
|
41
|
+
// entry a client can run — judged by the ONE rule every mcp.json entry
|
|
42
|
+
// meets (name, transport, required fields), after the customer's shape
|
|
43
|
+
// is translated into that of mcp.json.
|
|
44
|
+
const converted = mcpEntryOf(raw.id, isRecord(raw.config) ? raw.config : raw);
|
|
45
|
+
if ('reason' in converted) {
|
|
46
|
+
warnings.push(`registry.json: server "${raw.id}" ${converted.reason} — skipped`);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
servers.set(raw.id, { id: raw.id, name: typeof raw.name === 'string' ? raw.name : undefined, entry: converted.entry });
|
|
50
|
+
}
|
|
51
|
+
for (const raw of asArray(root.profiles)) {
|
|
52
|
+
if (!isRecord(raw) || typeof raw.id !== 'string' || !raw.id) {
|
|
53
|
+
warnings.push('registry.json: a profile without an id was skipped');
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (profiles.has(raw.id)) {
|
|
57
|
+
warnings.push(`registry.json: profile "${raw.id}" is declared twice — the second declaration is ignored`);
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
profiles.set(raw.id, {
|
|
61
|
+
id: raw.id,
|
|
62
|
+
servers: asArray(raw.servers).filter((s) => typeof s === 'string'),
|
|
63
|
+
extends: typeof raw.extends === 'string' ? raw.extends : undefined,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return { servers, profiles, warnings };
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The `mcpServers` map a profile resolves to, in `mcp.json` terms. Keyed by
|
|
70
|
+
* server id — the namespace vault secrets bind to, so the same registry
|
|
71
|
+
* server in three plugins shares one credential, which is what a registry
|
|
72
|
+
* means.
|
|
73
|
+
*/
|
|
74
|
+
export function expandProfile(registry, profileId) {
|
|
75
|
+
const warnings = [];
|
|
76
|
+
const ids = [];
|
|
77
|
+
const seen = new Set();
|
|
78
|
+
let current = profileId;
|
|
79
|
+
while (current !== undefined) {
|
|
80
|
+
if (seen.has(current)) {
|
|
81
|
+
warnings.push(`registry.json: profile "${current}" extends itself through a cycle — chain cut`);
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
seen.add(current);
|
|
85
|
+
const profile = registry.profiles.get(current);
|
|
86
|
+
if (!profile) {
|
|
87
|
+
warnings.push(`registry.json: profile "${current}" does not exist`);
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
// Nearest profile first, so a base profile's servers come after the
|
|
91
|
+
// extending one's; the map below keeps the first occurrence of an id.
|
|
92
|
+
for (const id of profile.servers)
|
|
93
|
+
if (!ids.includes(id))
|
|
94
|
+
ids.push(id);
|
|
95
|
+
current = profile.extends;
|
|
96
|
+
}
|
|
97
|
+
const mcpServers = {};
|
|
98
|
+
for (const id of ids) {
|
|
99
|
+
const server = registry.servers.get(id);
|
|
100
|
+
if (!server) {
|
|
101
|
+
warnings.push(`registry.json: profile "${profileId}" selects unknown server "${id}"`);
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
mcpServers[id] = server.entry;
|
|
105
|
+
}
|
|
106
|
+
return { mcpServers, warnings };
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* A registry config → one `mcp.json` server entry, or why there is none.
|
|
110
|
+
*
|
|
111
|
+
* The registry's OWN knowledge is the customer's shape: a declared `type`
|
|
112
|
+
* names the transport (`http` is their spelling of `streamable-http`), an
|
|
113
|
+
* undeclared one is read off the fields — a `url` means http, else a
|
|
114
|
+
* `command` means stdio — and blank strings are absent. That translation
|
|
115
|
+
* done, whether the entry can work is the shared judgement's call, the same
|
|
116
|
+
* one every `mcp.json` entry meets: a name that can be a server name, a
|
|
117
|
+
* transport the client speaks (no `sse`), the field that transport needs.
|
|
118
|
+
*/
|
|
119
|
+
function mcpEntryOf(id, config) {
|
|
120
|
+
const declared = typeof config.type === 'string' ? config.type.trim().toLowerCase() : undefined;
|
|
121
|
+
const url = nonBlank(config.url);
|
|
122
|
+
const command = nonBlank(config.command);
|
|
123
|
+
const type = declared === undefined ? (url ? 'streamable-http' : command ? 'stdio' : undefined) : declared === 'http' ? 'streamable-http' : declared;
|
|
124
|
+
if (type === undefined)
|
|
125
|
+
return { reason: 'has neither a url nor a command' };
|
|
126
|
+
const candidate = { type };
|
|
127
|
+
if (url)
|
|
128
|
+
candidate.url = url;
|
|
129
|
+
if (command)
|
|
130
|
+
candidate.command = command;
|
|
131
|
+
for (const key of ['args', 'env', 'cwd', 'headers']) {
|
|
132
|
+
if (config[key] !== undefined)
|
|
133
|
+
candidate[key] = config[key];
|
|
134
|
+
}
|
|
135
|
+
const verdict = judgeMcpServerEntry(id, candidate);
|
|
136
|
+
return verdict.ok ? { entry: verdict.entry } : { reason: verdict.reason };
|
|
137
|
+
}
|
|
138
|
+
function nonBlank(v) {
|
|
139
|
+
return typeof v === 'string' && v.trim() ? v : undefined;
|
|
140
|
+
}
|
|
141
|
+
function isRecord(v) {
|
|
142
|
+
return typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
143
|
+
}
|
|
144
|
+
function asArray(v) {
|
|
145
|
+
return Array.isArray(v) ? v : [];
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../../src/modules/plugins/discovery/bundle-dialect/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,mBAAmB,GAGpB,MAAM,6CAA6C,CAAC;AAqBrD,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,OAAO,GAAG,IAAI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,GAAG,mBAAmB,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IACnD,OAAO,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AAC5E,CAAC;AAED,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3D,CAAC;AAED,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,SAAS,OAAO,CAAC,CAAU;IACzB,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Discovery, PluginSource, PluginSourceWalk } from './plugin-source.js';
|
|
2
|
+
import { type KbWalkListener } from '../../../shared/kb-walk.js';
|
|
3
|
+
/**
|
|
4
|
+
* THE plugin source: a LISTENER on the one walk of the checkout
|
|
5
|
+
* (`walkKb`), reading every folder under the plugins root in whichever of
|
|
6
|
+
* the two file shapes it carries.
|
|
7
|
+
*
|
|
8
|
+
* plugin.json → a native plugin (this platform's layout)
|
|
9
|
+
* plugin.bundle.json → a bundle (the customer dialect, read-only)
|
|
10
|
+
*
|
|
11
|
+
* Nothing else is a plugin. A folder's POSITION means nothing: the legacy
|
|
12
|
+
* rule "everything directly under the root is a plugin" is retired by the
|
|
13
|
+
* `plugin-manifests` boot step, which writes the manifest into every such
|
|
14
|
+
* folder once, so discovery never has to guess.
|
|
15
|
+
*
|
|
16
|
+
* A folder that IS a plugin claims everything beneath it (its `skills/` are
|
|
17
|
+
* its own) — the walk still visits what lies beneath, for the other
|
|
18
|
+
* listeners; this one ignores it. When a folder carries both files the
|
|
19
|
+
* manifest wins, so a bundle migrated in place stops being read as a bundle
|
|
20
|
+
* the moment a `plugin.json` lands beside it. Two plugins with one name keep
|
|
21
|
+
* the first by path (the walk's order) and warn about the second — a name is
|
|
22
|
+
* an identity to people and URLs, and two folders answering to it would be
|
|
23
|
+
* two plugins with one key.
|
|
24
|
+
*
|
|
25
|
+
* Holes — a folder under the root that could not be listed, an identity
|
|
26
|
+
* file that could not be read — are counted in `unreadable`: nothing behind
|
|
27
|
+
* them is listed, and a writer refuses while they exist.
|
|
28
|
+
*
|
|
29
|
+
* No setting picks a dialect. Nothing to configure means nothing to document
|
|
30
|
+
* and nothing to remove but the `else if` that reads bundles.
|
|
31
|
+
*/
|
|
32
|
+
export declare class KbPluginSource implements PluginSource {
|
|
33
|
+
readonly dialect = "kb";
|
|
34
|
+
discover(kbRoot: string): Promise<Discovery>;
|
|
35
|
+
walkWith(kbRoot: string, listeners: readonly KbWalkListener[]): Promise<PluginSourceWalk>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=kb-plugin-source.d.ts.map
|