myagent-ai 1.19.5 → 1.19.6

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.
Files changed (45) hide show
  1. package/core/context_builder.py +49 -2
  2. package/core/vnc_manager.py +0 -0
  3. package/data/uploads/2026-04/32c9e9d3-8cf_test.pdf.pdf +0 -0
  4. package/package.json +1 -1
  5. package/requirements-optional.txt +0 -0
  6. package/skills/__init__.py +0 -0
  7. package/skills/base.py +0 -0
  8. package/skills/browser_skill.py +0 -0
  9. package/skills/chromedev_mcp.py +0 -0
  10. package/skills/docx_skill.py +0 -0
  11. package/skills/file_send.py +0 -0
  12. package/skills/file_skill.py +0 -0
  13. package/skills/frontend-dev/SKILL.md +0 -0
  14. package/skills/frontend-dev/references/asset-prompt-guide.md +0 -0
  15. package/skills/frontend-dev/references/env-setup.md +0 -0
  16. package/skills/frontend-dev/references/minimax-cli-reference.md +0 -0
  17. package/skills/frontend-dev/references/minimax-image-guide.md +0 -0
  18. package/skills/frontend-dev/references/minimax-music-guide.md +0 -0
  19. package/skills/frontend-dev/references/minimax-tts-guide.md +0 -0
  20. package/skills/frontend-dev/references/minimax-video-guide.md +0 -0
  21. package/skills/frontend-dev/references/minimax-voice-catalog.md +0 -0
  22. package/skills/frontend-dev/references/motion-recipes.md +0 -0
  23. package/skills/frontend-dev/references/troubleshooting.md +0 -0
  24. package/skills/frontend-dev/scripts/minimax_image.py +0 -0
  25. package/skills/frontend-dev/scripts/minimax_music.py +0 -0
  26. package/skills/frontend-dev/scripts/minimax_tts.py +0 -0
  27. package/skills/frontend-dev/scripts/minimax_video.py +0 -0
  28. package/skills/frontend-dev/templates/generator_template.js +0 -0
  29. package/skills/frontend-dev/templates/viewer.html +0 -0
  30. package/skills/fullstack-dev/SKILL.md +0 -0
  31. package/skills/fullstack-dev/references/api-design.md +0 -0
  32. package/skills/fullstack-dev/references/auth-flow.md +0 -0
  33. package/skills/fullstack-dev/references/db-schema.md +0 -0
  34. package/skills/fullstack-dev/references/django-best-practices.md +0 -0
  35. package/skills/fullstack-dev/references/environment-management.md +0 -0
  36. package/skills/fullstack-dev/references/release-checklist.md +0 -0
  37. package/skills/fullstack-dev/references/technology-selection.md +0 -0
  38. package/skills/fullstack-dev/references/testing-strategy.md +0 -0
  39. package/skills/gui_skill.py +0 -0
  40. package/skills/pdf_skill.py +0 -0
  41. package/skills/ppt_skill.py +0 -0
  42. package/skills/registry.py +15 -2
  43. package/skills/search_skill.py +0 -0
  44. package/skills/system_skill.py +0 -0
  45. package/skills/xlsx_skill.py +0 -0
@@ -13,6 +13,7 @@ core/context_builder.py - 上下文构建器
13
13
  <usersays> - 用户语音转文本输入(键盘输入时为空)
14
14
  <task_plan> - 当前任务计划(Markdown 格式,上轮已完成时为空)
15
15
  <tools> - 可用工具列表(名称、描述、参数格式)
16
+ <skill_prompts> - SKILL.md 格式技能的完整指令(Prompt 类型技能注入)
16
17
 
17
18
  使用示例:
18
19
  builder = ContextBuilder(memory_manager=mm, skill_registry=sr)
@@ -169,6 +170,7 @@ class ContextBuilder:
169
170
  self._build_user_input(user_typed_text, user_voice_text),
170
171
  self._build_task_plan(task_plan),
171
172
  self._build_tools(self.skill_registry),
173
+ self._build_skill_prompts(self.skill_registry),
172
174
  ]
173
175
 
174
176
  context_body = "\n".join(sections)
@@ -766,6 +768,51 @@ class ContextBuilder:
766
768
  lines.append("</tools>")
767
769
  return "\n".join(lines)
768
770
 
771
+ def _build_skill_prompts(
772
+ self,
773
+ skill_registry: Optional["SkillRegistry"],
774
+ ) -> str:
775
+ """
776
+ 构建 <skill_prompts> 段落 —— SKILL.md 格式技能的完整指令内容。
777
+
778
+ 对于 SKILL.md 目录格式的 Prompt 类型技能,将完整的 markdown body
779
+ 注入到 LLM 上下文中,使 LLM 能按照技能指令执行任务。
780
+ 普通 Python 技能(有 execute 实现)不在此处注入。
781
+
782
+ Returns:
783
+ <skill_prompts> XML 段落字符串,无 Prompt 技能时返回空字符串
784
+ """
785
+ if not skill_registry:
786
+ return ""
787
+
788
+ # 收集所有 markdown 类型且未禁用的技能的 body
789
+ prompt_skills = []
790
+ try:
791
+ for skill in skill_registry._skills.values():
792
+ if skill_registry._is_disabled(skill.name):
793
+ continue
794
+ # 检查是否为 SKILL.md 格式技能
795
+ body = getattr(skill, 'get_body', None)
796
+ if body and callable(body):
797
+ content = body()
798
+ if content:
799
+ prompt_skills.append((skill.name, content))
800
+ except Exception as e:
801
+ logger.warning(f"获取 skill prompts 失败: {e}")
802
+ return ""
803
+
804
+ if not prompt_skills:
805
+ return ""
806
+
807
+ lines: List[str] = ["<skill_prompts>"]
808
+ for skill_name, content in prompt_skills:
809
+ safe_name = _xml_escape(skill_name)
810
+ lines.append(f"<{safe_name}>")
811
+ lines.append(content)
812
+ lines.append(f"</{safe_name}>")
813
+ lines.append("</skill_prompts>")
814
+ return "\n".join(lines)
815
+
769
816
  # =========================================================================
770
817
  # Token 预算管理
771
818
  # =========================================================================
@@ -818,8 +865,8 @@ class ContextBuilder:
818
865
  return re.sub(pattern, replacement, xml, count=1, flags=re.DOTALL)
819
866
 
820
867
  # 按优先级从低到高裁剪(记忆最优先保留,知识库和任务计划优先裁剪)
821
- # recent_summary 是兜底机制,最先裁剪
822
- for tag in ['recent_summary', 'knowledge', 'task_plan', 'recall_memory', 'automemory']:
868
+ # recent_summary 是兜底机制,最先裁剪;skill_prompts 其次
869
+ for tag in ['recent_summary', 'skill_prompts', 'knowledge', 'task_plan', 'recall_memory', 'automemory']:
823
870
  if estimated <= budget:
824
871
  break
825
872
  if f'<{tag}>' in context_xml:
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myagent-ai",
3
- "version": "1.19.5",
3
+ "version": "1.19.6",
4
4
  "description": "本地桌面端执行型AI助手 - Open Interpreter 风格 | Local Desktop Execution-Oriented AI Assistant",
5
5
  "main": "main.py",
6
6
  "bin": {
File without changes
File without changes
package/skills/base.py CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -215,6 +215,11 @@ def _load_skill_from_md(skill_dir: Path) -> Optional[Skill]:
215
215
  for ref_file in sorted(ref_dir.glob("*.md")):
216
216
  references.append(ref_file.name)
217
217
 
218
+ # 提取 SKILL.md body(YAML front matter 之后的内容)
219
+ body = ""
220
+ if len(parts) >= 3:
221
+ body = parts[2].strip()
222
+
218
223
  class MarkdownSkill(Skill):
219
224
  """SKILL.md 格式的技能包装器"""
220
225
  def __init__(self):
@@ -230,13 +235,21 @@ def _load_skill_from_md(skill_dir: Path) -> Optional[Skill]:
230
235
  self._references = references
231
236
  self._has_templates = (skill_dir / "templates").exists()
232
237
  self._has_scripts = (skill_dir / "scripts").exists()
238
+ self._body = body
233
239
 
234
240
  async def execute(self, **kwargs) -> SkillResult:
241
+ # SKILL.md 技能的指令已通过 <skill_prompts> 注入 system prompt
242
+ # 如果 LLM 仍然调用了此工具,返回确认信息
235
243
  return SkillResult(
236
- success=False,
237
- error=f"SKILL.md 格式技能不支持直接调用,请通过 LLM 使用 /{self.name} 触发",
244
+ success=True,
245
+ output=f"[{self.name}] 技能指令已激活,请按照 <skill_prompts> {self.name} 的完整指令执行任务。",
246
+ message=f"技能 {self.name} 已激活",
238
247
  )
239
248
 
249
+ def get_body(self) -> str:
250
+ """返回 SKILL.md 的 body 内容"""
251
+ return self._body
252
+
240
253
  def to_openclaw_format(self) -> Dict[str, Any]:
241
254
  info = super().to_openclaw_format()
242
255
  info["skill_type"] = "markdown"
File without changes
File without changes
File without changes