mirror of
https://git.openapi.site/https://github.com/desirecore/registry.git
synced 2026-12-05 10:19:03 +08:00
feat(registry): 收录范围限定的 Repomix 和 Excel MCP / List directory-scoped Repomix and Excel MCP (#39)
* feat(registry): 收录需选择数据目录的 Repomix 和 Excel MCP * test(registry): 更新新增两项 MCP 后的目录计数 * Support scoped Agent workdirs for Repomix and Excel MCP
This commit is contained in:
17 files changed
+468
-10
No files matched your search
@@ -8,3 +8,37 @@ export function isAuthoredRegistryEntry(entry) {
|
||||
export function isApplicationEntry(entry) {
|
||||
return ['docker-app', 'native-app', 'artifact', 'web-bundle'].includes(entry?.type)
|
||||
}
|
||||
|
||||
/** Add the scoped MCP connection contract without replacing the published schema fingerprint. */
|
||||
export function withMcpDataDirectory(schema) {
|
||||
const connection = schema?.definitions?.connection
|
||||
if (!connection?.properties) return schema
|
||||
return {
|
||||
...schema,
|
||||
definitions: {
|
||||
...schema.definitions,
|
||||
connection: {
|
||||
...connection,
|
||||
properties: {
|
||||
...connection.properties,
|
||||
workdirStrategy: {
|
||||
enum: ['per-directory', 'excel-allow-dir'],
|
||||
description: 'Opt into confirmed Agent workdirs using independent processes or native Excel allow-dir options.',
|
||||
},
|
||||
requiresDataDirectory: {
|
||||
const: true,
|
||||
description: 'Require explicit user consent for the MCP data folders.',
|
||||
},
|
||||
},
|
||||
allOf: [
|
||||
...(connection.allOf ?? []),
|
||||
{ if: { required: ['workdirStrategy'] }, then: { required: ['requiresDataDirectory'] } },
|
||||
{
|
||||
if: { required: ['requiresDataDirectory'] },
|
||||
then: { properties: { transport: { const: 'stdio' } } },
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import { validateJsonSchema } from './json-schema.mjs'
|
||||
import { findStaticMetrics } from './static-metadata.mjs'
|
||||
import { MCP_PACKAGE_REVIEWER, validateMcpPackageReview } from './automated-mcp-review.mjs'
|
||||
import { validateApplicationContract } from './application-contract.mjs'
|
||||
import { AUTHORED_ENTRY_SCHEMA_FILENAME, isApplicationEntry, isAuthoredRegistryEntry } from './entry-schema.mjs'
|
||||
import { AUTHORED_ENTRY_SCHEMA_FILENAME, isApplicationEntry, isAuthoredRegistryEntry, withMcpDataDirectory } from './entry-schema.mjs'
|
||||
|
||||
export const CATALOG_SIDECAR_FILENAME = 'catalog-metadata.v1.json'
|
||||
|
||||
@@ -255,7 +255,7 @@ export function validateRegistry(repoRoot, options = {}) {
|
||||
if (entry.type === 'external-integration') counts.externalIntegrations += 1
|
||||
const effectiveEntrySchema = isAuthoredRegistryEntry(entry) ? authoredEntrySchema
|
||||
: ['external-integration', 'native-app', 'artifact'].includes(entry.type) ? externalEntrySchema : currentEntrySchema
|
||||
if (effectiveEntrySchema !== null && effectiveEntrySchema !== undefined) diagnostics.push(...schemaDiagnostics(entry, effectiveEntrySchema, manifestRelative))
|
||||
if (effectiveEntrySchema !== null && effectiveEntrySchema !== undefined) diagnostics.push(...schemaDiagnostics(entry, withMcpDataDirectory(effectiveEntrySchema), manifestRelative))
|
||||
for (const message of validateApplicationContract(entry)) diagnostics.push(diagnostic('error', 'application-contract', manifestRelative, '$', message))
|
||||
if (entry.id !== basename(entryDir)) diagnostics.push(diagnostic('error', 'directory-id-mismatch', manifestRelative, '$.id', 'manifest.id 必须与 entries/<id> 目录名一致'))
|
||||
if (seenIds.has(entry.id)) diagnostics.push(diagnostic('error', 'duplicate-id', manifestRelative, '$.id', 'Registry 条目 ID 重复'))
|
||||
|
||||
@@ -208,10 +208,10 @@ test('当前 v4.2 条目保持可读,原生应用与既有 App/Service 具备
|
||||
httpApis: report.counts.httpApis,
|
||||
externalIntegrations: report.counts.externalIntegrations,
|
||||
}, {
|
||||
totalEntries: 28,
|
||||
totalEntries: 30,
|
||||
dockerApps: 8,
|
||||
nativeApps: 3,
|
||||
mcpServices: 11,
|
||||
mcpServices: 13,
|
||||
httpApis: 5,
|
||||
externalIntegrations: 1,
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user