feat(agents): Phase 7-10 hook system, plugins, skills, orchestration
Phase 7: Built-in Hooks (audit_log, dangerous_confirmation, security_scan)
Phase 8: Plugin system (PluginManager, PluginSandbox, PluginManifest)
Phase 9: Skills registry (SkillRegistry, local/plugin/MCP loaders)
Phase 10: TeamLeader, RemoteTransport, BackgroundTaskManager
2026-04-04 22:56:27 +08:00
|
|
|
|
"""Skill 元数据定义 - Phase 9.1"""
|
|
|
|
|
|
|
|
|
|
|
|
from dataclasses import dataclass, field
|
|
|
|
|
|
from typing import Any
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
|
|
class SkillMetadata:
|
|
|
|
|
|
"""Skill 元数据"""
|
|
|
|
|
|
|
2026-04-05 10:56:21 +08:00
|
|
|
|
id: str = "" # Skill ID
|
|
|
|
|
|
name: str = "" # Skill 名称
|
|
|
|
|
|
description: str = "" # 描述
|
feat(agents): Phase 7-10 hook system, plugins, skills, orchestration
Phase 7: Built-in Hooks (audit_log, dangerous_confirmation, security_scan)
Phase 8: Plugin system (PluginManager, PluginSandbox, PluginManifest)
Phase 9: Skills registry (SkillRegistry, local/plugin/MCP loaders)
Phase 10: TeamLeader, RemoteTransport, BackgroundTaskManager
2026-04-04 22:56:27 +08:00
|
|
|
|
version: str = "1.0.0" # 版本
|
|
|
|
|
|
author: str = "" # 作者
|
|
|
|
|
|
tags: list[str] = field(default_factory=list) # 标签
|
|
|
|
|
|
triggers: list[str] = field(default_factory=list) # 触发关键词
|
|
|
|
|
|
content: str = "" # Skill 内容(markdown)
|
|
|
|
|
|
source: str = "local" # 来源:local, plugin, mcp, bundled
|
|
|
|
|
|
source_id: str = "" # 来源 ID
|
|
|
|
|
|
enabled: bool = True # 是否启用
|
2026-04-05 10:56:21 +08:00
|
|
|
|
tools: list[str] = field(default_factory=list) # 关联的工具
|
feat(agents): Phase 7-10 hook system, plugins, skills, orchestration
Phase 7: Built-in Hooks (audit_log, dangerous_confirmation, security_scan)
Phase 8: Plugin system (PluginManager, PluginSandbox, PluginManifest)
Phase 9: Skills registry (SkillRegistry, local/plugin/MCP loaders)
Phase 10: TeamLeader, RemoteTransport, BackgroundTaskManager
2026-04-04 22:56:27 +08:00
|
|
|
|
|
|
|
|
|
|
def to_dict(self) -> dict[str, Any]:
|
|
|
|
|
|
return {
|
2026-04-05 10:56:21 +08:00
|
|
|
|
"id": self.id,
|
feat(agents): Phase 7-10 hook system, plugins, skills, orchestration
Phase 7: Built-in Hooks (audit_log, dangerous_confirmation, security_scan)
Phase 8: Plugin system (PluginManager, PluginSandbox, PluginManifest)
Phase 9: Skills registry (SkillRegistry, local/plugin/MCP loaders)
Phase 10: TeamLeader, RemoteTransport, BackgroundTaskManager
2026-04-04 22:56:27 +08:00
|
|
|
|
"name": self.name,
|
|
|
|
|
|
"description": self.description,
|
|
|
|
|
|
"version": self.version,
|
|
|
|
|
|
"author": self.author,
|
|
|
|
|
|
"tags": self.tags,
|
|
|
|
|
|
"triggers": self.triggers,
|
|
|
|
|
|
"content": self.content,
|
|
|
|
|
|
"source": self.source,
|
|
|
|
|
|
"source_id": self.source_id,
|
|
|
|
|
|
"enabled": self.enabled,
|
2026-04-05 10:56:21 +08:00
|
|
|
|
"tools": self.tools,
|
feat(agents): Phase 7-10 hook system, plugins, skills, orchestration
Phase 7: Built-in Hooks (audit_log, dangerous_confirmation, security_scan)
Phase 8: Plugin system (PluginManager, PluginSandbox, PluginManifest)
Phase 9: Skills registry (SkillRegistry, local/plugin/MCP loaders)
Phase 10: TeamLeader, RemoteTransport, BackgroundTaskManager
2026-04-04 22:56:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
|
def from_dict(cls, data: dict[str, Any]) -> "SkillMetadata":
|
|
|
|
|
|
return cls(**data)
|