282 lines
8.0 KiB
JSON
282 lines
8.0 KiB
JSON
{
|
|
"schemaVersion": 1,
|
|
"pluginId": "makelore.data-service",
|
|
"contractVersion": 1,
|
|
"scope": "project",
|
|
"adapterId": "data-service",
|
|
"requiresBackend": true,
|
|
"display": {
|
|
"name": "开发数据服务",
|
|
"description": "为当前项目提供受控的开发期 JSON 数据存储。"
|
|
},
|
|
"skills": [
|
|
{
|
|
"id": "data-service",
|
|
"entry": "../skills/data-service/SKILL.md",
|
|
"grants": [
|
|
"data-service.control",
|
|
"data-service.documents"
|
|
]
|
|
}
|
|
],
|
|
"tools": [
|
|
{
|
|
"name": "data_service_configure",
|
|
"label": "Data Service configure",
|
|
"description": "Configure collections for the active project.",
|
|
"capabilityId": "data-service.control",
|
|
"operation": "configure",
|
|
"roles": ["parent"],
|
|
"mutation": "write",
|
|
"projectWriteLease": true,
|
|
"permissions": ["project.data.configure"],
|
|
"inputSchema": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["collections"],
|
|
"properties": {
|
|
"collections": {
|
|
"type": "array",
|
|
"maxItems": 20,
|
|
"items": {
|
|
"type": "string",
|
|
"pattern": "^[a-z][a-z0-9_-]{0,47}$"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "data_service_inspect",
|
|
"label": "Data Service inspect",
|
|
"description": "Inspect the active project data instance.",
|
|
"capabilityId": "data-service.control",
|
|
"operation": "inspect",
|
|
"roles": ["parent"],
|
|
"mutation": "read",
|
|
"projectWriteLease": false,
|
|
"permissions": ["project.data.read"],
|
|
"inputSchema": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {}
|
|
}
|
|
},
|
|
{
|
|
"name": "data_service_list_projects",
|
|
"label": "Data Service list projects",
|
|
"description": "List the authenticated projects with Data Service instances.",
|
|
"capabilityId": "data-service.control",
|
|
"operation": "list_projects",
|
|
"roles": ["parent"],
|
|
"mutation": "read",
|
|
"projectWriteLease": false,
|
|
"permissions": ["project.data.read"],
|
|
"inputSchema": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {}
|
|
}
|
|
},
|
|
{
|
|
"name": "data_service_get_document",
|
|
"label": "Data Service get document",
|
|
"description": "Read a document from the active project.",
|
|
"capabilityId": "data-service.documents",
|
|
"operation": "get_document",
|
|
"roles": ["parent"],
|
|
"mutation": "read",
|
|
"projectWriteLease": false,
|
|
"permissions": ["project.data.read"],
|
|
"inputSchema": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["collection", "document_id"],
|
|
"properties": {
|
|
"collection": {
|
|
"type": "string",
|
|
"pattern": "^[a-z][a-z0-9_-]{0,47}$"
|
|
},
|
|
"document_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9._~-]{1,128}$"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "data_service_list_documents",
|
|
"label": "Data Service list documents",
|
|
"description": "List documents from a collection in the active project.",
|
|
"capabilityId": "data-service.documents",
|
|
"operation": "list_documents",
|
|
"roles": ["parent"],
|
|
"mutation": "read",
|
|
"projectWriteLease": false,
|
|
"permissions": ["project.data.read"],
|
|
"inputSchema": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["collection"],
|
|
"properties": {
|
|
"collection": {
|
|
"type": "string",
|
|
"pattern": "^[a-z][a-z0-9_-]{0,47}$"
|
|
},
|
|
"limit": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 100
|
|
},
|
|
"cursor": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"maxLength": 1024
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "data_service_put_document",
|
|
"label": "Data Service put document",
|
|
"description": "Create or replace a document in the active project.",
|
|
"capabilityId": "data-service.documents",
|
|
"operation": "put_document",
|
|
"roles": ["parent"],
|
|
"mutation": "write",
|
|
"projectWriteLease": true,
|
|
"permissions": ["project.data.write"],
|
|
"inputSchema": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["collection", "document_id", "data"],
|
|
"properties": {
|
|
"collection": {
|
|
"type": "string",
|
|
"pattern": "^[a-z][a-z0-9_-]{0,47}$"
|
|
},
|
|
"document_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9._~-]{1,128}$"
|
|
},
|
|
"data": {
|
|
"type": "object"
|
|
},
|
|
"if_revision": {
|
|
"type": "integer",
|
|
"minimum": 1
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "data_service_delete_document",
|
|
"label": "Data Service delete document",
|
|
"description": "Delete a document after explicit confirmation.",
|
|
"capabilityId": "data-service.documents",
|
|
"operation": "delete_document",
|
|
"roles": ["parent"],
|
|
"mutation": "destructive",
|
|
"projectWriteLease": true,
|
|
"permissions": ["project.data.write"],
|
|
"inputSchema": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["collection", "document_id", "confirmed"],
|
|
"properties": {
|
|
"collection": {
|
|
"type": "string",
|
|
"pattern": "^[a-z][a-z0-9_-]{0,47}$"
|
|
},
|
|
"document_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9._~-]{1,128}$"
|
|
},
|
|
"if_revision": {
|
|
"type": "integer",
|
|
"minimum": 1
|
|
},
|
|
"confirmed": {
|
|
"type": "boolean",
|
|
"const": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "data_service_remove_collection",
|
|
"label": "Data Service remove collection",
|
|
"description": "Remove a collection after explicit confirmation.",
|
|
"capabilityId": "data-service.control",
|
|
"operation": "remove_collection",
|
|
"roles": ["parent"],
|
|
"mutation": "destructive",
|
|
"projectWriteLease": true,
|
|
"permissions": ["project.data.admin"],
|
|
"inputSchema": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["collection", "confirmed"],
|
|
"properties": {
|
|
"collection": {
|
|
"type": "string",
|
|
"pattern": "^[a-z][a-z0-9_-]{0,47}$"
|
|
},
|
|
"confirmed": {
|
|
"type": "boolean",
|
|
"const": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "data_service_reset",
|
|
"label": "Data Service reset",
|
|
"description": "Reset all active project data after explicit confirmation.",
|
|
"capabilityId": "data-service.control",
|
|
"operation": "reset",
|
|
"roles": ["parent"],
|
|
"mutation": "destructive",
|
|
"projectWriteLease": true,
|
|
"permissions": ["project.data.admin"],
|
|
"inputSchema": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["confirmed"],
|
|
"properties": {
|
|
"confirmed": {
|
|
"type": "boolean",
|
|
"const": true
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "data_service_remove_project",
|
|
"label": "Data Service remove project",
|
|
"description": "Remove the active project data instance after explicit confirmation.",
|
|
"capabilityId": "data-service.control",
|
|
"operation": "remove_project",
|
|
"roles": ["parent"],
|
|
"mutation": "destructive",
|
|
"projectWriteLease": true,
|
|
"permissions": ["project.data.admin"],
|
|
"inputSchema": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["confirmed"],
|
|
"properties": {
|
|
"confirmed": {
|
|
"type": "boolean",
|
|
"const": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"surfaces": {
|
|
"projectSettings": "data-service",
|
|
"previewRuntime": "data-service-v1"
|
|
}
|
|
}
|