metame-cli 1.5.11 → 1.5.12

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 (55) hide show
  1. package/index.js +64 -7
  2. package/package.json +3 -2
  3. package/scripts/daemon-agent-commands.js +6 -2
  4. package/scripts/daemon-bridges.js +23 -9
  5. package/scripts/daemon-claude-engine.js +87 -28
  6. package/scripts/daemon-command-router.js +16 -0
  7. package/scripts/daemon-command-session-route.js +3 -1
  8. package/scripts/daemon-engine-runtime.js +1 -5
  9. package/scripts/daemon-message-pipeline.js +113 -44
  10. package/scripts/daemon-reactive-lifecycle.js +405 -9
  11. package/scripts/daemon-session-commands.js +3 -2
  12. package/scripts/daemon-session-store.js +82 -27
  13. package/scripts/daemon-team-dispatch.js +21 -5
  14. package/scripts/daemon-utils.js +3 -1
  15. package/scripts/daemon.js +1 -0
  16. package/scripts/docs/file-transfer.md +1 -0
  17. package/scripts/hooks/intent-file-transfer.js +2 -1
  18. package/scripts/hooks/intent-perpetual.js +109 -0
  19. package/scripts/hooks/intent-research.js +112 -0
  20. package/scripts/intent-registry.js +4 -0
  21. package/scripts/ops-mission-queue.js +258 -0
  22. package/scripts/ops-verifier.js +197 -0
  23. package/skills/agent-browser/SKILL.md +153 -0
  24. package/skills/agent-reach/SKILL.md +66 -0
  25. package/skills/agent-reach/evolution.json +13 -0
  26. package/skills/deep-research/SKILL.md +77 -0
  27. package/skills/find-skills/SKILL.md +133 -0
  28. package/skills/heartbeat-task-manager/SKILL.md +63 -0
  29. package/skills/macos-local-orchestrator/SKILL.md +192 -0
  30. package/skills/macos-local-orchestrator/agents/openai.yaml +4 -0
  31. package/skills/macos-local-orchestrator/references/tooling-landscape.md +70 -0
  32. package/skills/macos-mail-calendar/SKILL.md +394 -0
  33. package/skills/mcp-installer/SKILL.md +138 -0
  34. package/skills/skill-creator/LICENSE.txt +202 -0
  35. package/skills/skill-creator/README.md +72 -0
  36. package/skills/skill-creator/SKILL.md +96 -0
  37. package/skills/skill-creator/evolution.json +6 -0
  38. package/skills/skill-creator/references/creation-guide.md +116 -0
  39. package/skills/skill-creator/references/evolution-guide.md +74 -0
  40. package/skills/skill-creator/references/output-patterns.md +82 -0
  41. package/skills/skill-creator/references/workflows.md +28 -0
  42. package/skills/skill-creator/scripts/align_all.py +32 -0
  43. package/skills/skill-creator/scripts/auto_evolve_hook.js +247 -0
  44. package/skills/skill-creator/scripts/init_skill.py +303 -0
  45. package/skills/skill-creator/scripts/merge_evolution.py +70 -0
  46. package/skills/skill-creator/scripts/package_skill.py +110 -0
  47. package/skills/skill-creator/scripts/quick_validate.py +103 -0
  48. package/skills/skill-creator/scripts/setup.py +141 -0
  49. package/skills/skill-creator/scripts/smart_stitch.py +82 -0
  50. package/skills/skill-manager/SKILL.md +112 -0
  51. package/skills/skill-manager/scripts/delete_skill.py +31 -0
  52. package/skills/skill-manager/scripts/list_skills.py +61 -0
  53. package/skills/skill-manager/scripts/scan_and_check.py +125 -0
  54. package/skills/skill-manager/scripts/sync_index.py +144 -0
  55. package/skills/skill-manager/scripts/update_helper.py +39 -0
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: heartbeat-task-manager
3
+ description: |
4
+ 管理 MetaMe Desktop 的心跳任务(提醒任务)。
5
+ 当用户说“每天提醒我…”、“6点提醒我…”时,优先用本技能自动创建/更新任务,
6
+ 并通过 /tasks、/run <task> 与手机端协同。
7
+ ---
8
+
9
+ # Heartbeat Task Manager
10
+
11
+ 用于 MetaMe Desktop Daemon 的心跳任务管理。
12
+
13
+ ## 适用场景
14
+
15
+ - 用户说“每天提醒我…”
16
+ - 用户说“6点提醒我…”
17
+ - 用户要查看已有任务
18
+ - 用户要让后台立即执行某个任务
19
+
20
+ ## 强约束
21
+
22
+ 1. 仅操作 `~/.metame-desktop/config-desktop.yaml` 对应的 Desktop 任务域。
23
+ 2. 不操作外部项目 daemon,不执行全局进程控制。
24
+ 3. 优先使用 CLI 子命令,不手改 YAML 文本。
25
+
26
+ ## 推荐流程
27
+
28
+ ### 1) 新增/更新提醒任务
29
+
30
+ 当用户给出提醒语句时,执行:
31
+
32
+ ```bash
33
+ metame daemon --sub add-task --text "<用户原话>"
34
+ ```
35
+
36
+ 示例:
37
+
38
+ ```bash
39
+ metame daemon --sub add-task --text "每天6点提醒我喝水"
40
+ metame daemon --sub add-task --text "每天提醒我复盘今天进展"
41
+ ```
42
+
43
+ ### 2) 查看任务列表
44
+
45
+ ```bash
46
+ metame daemon --sub tasks
47
+ ```
48
+
49
+ ### 3) 手机端联动提示
50
+
51
+ 创建成功后,告诉用户:
52
+
53
+ - 手机可发送 `/tasks` 查看列表
54
+ - 手机可发送 `/run <task>` 立即执行
55
+
56
+ ## 回复模板(简短)
57
+
58
+ - 成功:
59
+ - 已帮你设置提醒任务。
60
+ - 你可以在手机输入 `/tasks` 查看,或 `/run <task>` 立即执行。
61
+ - 失败(语义不匹配):
62
+ - 我没识别到提醒语义,请改成“每天提醒我…”或“每天6点提醒我…”。
63
+
@@ -0,0 +1,192 @@
1
+ ---
2
+ name: macos-local-orchestrator
3
+ description: |
4
+ macOS 本地自动化编排与能力融合。通过 Bash + osascript/JXA + Shortcuts + launchd
5
+ 实现自然语言电脑管家,并在需要时编排 Hammerspoon、AeroSpace、yabai/skhd、
6
+ Raycast Script Commands、Keyboard Maestro 等第三方工具。适用于应用控制、系统控制、
7
+ 权限引导、窗口管理、快捷操作、定时任务与桌面自动化场景。
8
+ ---
9
+
10
+ # macOS Local Orchestrator
11
+
12
+ Use local deterministic automation on macOS with minimal token usage.
13
+
14
+ ## Execution Policy
15
+
16
+ 1. Prefer local deterministic tools first: `Bash` + `osascript`/JXA.
17
+ 2. Prefer built-in macOS capabilities before third-party tools.
18
+ 3. Avoid screenshot/visual workflows unless user explicitly asks for them.
19
+ 4. Classify every request before execution:
20
+ - Read/query action: execute directly.
21
+ - Side-effect action: show a short preview and ask for explicit confirmation first.
22
+ 5. Keep output short: success/failure + key result only.
23
+
24
+ ## Capability Ladder
25
+
26
+ ### L0 Native (default)
27
+
28
+ Use these first because they are stable and dependency-free:
29
+ - `osascript` AppleScript/JXA for app/system control
30
+ - `open` and `x-apple.systempreferences:` for settings navigation
31
+ - `shortcuts` CLI for reusable workflows
32
+ - `launchctl` + `~/Library/LaunchAgents` for scheduled/background jobs
33
+ - `pmset` for power scheduling
34
+
35
+ ### L1 Optional Integrations (when user already has them)
36
+
37
+ Detect tool availability and then use:
38
+ - `AeroSpace` for tiling/workspace (SIP-friendly, CLI-first)
39
+ - `yabai` + `skhd` for advanced window + hotkey control
40
+ - `Hammerspoon` for event-driven automation (`~/.hammerspoon/init.lua`)
41
+ - `Raycast` Script Commands / Deeplinks for launcher workflows
42
+ - `Keyboard Maestro` CLI trigger for mature macro pipelines
43
+
44
+ Do not force-install tools automatically unless user explicitly requests installation.
45
+
46
+ ## Tool Selection Rules
47
+
48
+ 1. If user asks app open/quit, volume, lock/sleep, permissions: use `osascript` first.
49
+ 2. If user asks reusable multi-step workflow: prefer `shortcuts run`.
50
+ 3. If user asks scheduled recurring action: prefer `launchd` or `pmset`.
51
+ 4. If user asks keyboard-first window tiling:
52
+ - Prefer `AeroSpace` if installed.
53
+ - Else use `yabai/skhd` if installed.
54
+ - Else fallback to native scripting and explain capability limits.
55
+ 5. If user asks event-driven desktop reactions (wifi change, battery alerts, app watcher): use `Hammerspoon` if installed.
56
+ 6. If user already uses Raycast/Keyboard Maestro ecosystem, integrate by calling their commands instead of rebuilding features.
57
+
58
+ For ecosystem-level tool tradeoffs and install decisions, read:
59
+ `references/tooling-landscape.md`
60
+
61
+ ## Side-Effect Confirmation Rules
62
+
63
+ Require confirmation before any action that changes state, including:
64
+ - Sending email, creating/deleting/modifying calendar events
65
+ - Quitting apps, system sleep, lock screen
66
+ - Writing/moving/deleting files or folders
67
+ - Any command with unclear scope or risk
68
+
69
+ Use this confirmation template:
70
+ - `准备执行:<one-line action>`
71
+ - `命令:<exact command>`
72
+ - `请回复“确认执行”后继续。`
73
+
74
+ ## Native Command Patterns
75
+
76
+ Open app:
77
+
78
+ ```bash
79
+ osascript -e 'tell application "WeChat" to activate'
80
+ ```
81
+
82
+ Quit app:
83
+
84
+ ```bash
85
+ osascript -e 'tell application "WeChat" to quit'
86
+ ```
87
+
88
+ Set volume:
89
+
90
+ ```bash
91
+ osascript -e 'set volume output volume 35'
92
+ ```
93
+
94
+ Mute / unmute:
95
+
96
+ ```bash
97
+ osascript -e 'set volume with output muted'
98
+ osascript -e 'set volume without output muted'
99
+ ```
100
+
101
+ Lock screen:
102
+
103
+ ```bash
104
+ osascript -e 'tell application "System Events" to keystroke "q" using {control down, command down}'
105
+ ```
106
+
107
+ Sleep:
108
+
109
+ ```bash
110
+ osascript -e 'tell application "System Events" to sleep'
111
+ ```
112
+
113
+ Open permissions/settings:
114
+
115
+ ```bash
116
+ open "x-apple.systempreferences:com.apple.preference.security?Privacy_Automation"
117
+ open "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"
118
+ open "x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture"
119
+ ```
120
+
121
+ Run shortcut:
122
+
123
+ ```bash
124
+ shortcuts list
125
+ shortcuts run "My Shortcut"
126
+ shortcuts run "My Shortcut" -i ~/Desktop/input.txt -o ~/Desktop/output.txt
127
+ ```
128
+
129
+ Create/refresh LaunchAgent job:
130
+
131
+ ```bash
132
+ launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.metame.task.plist 2>/dev/null || true
133
+ launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.metame.task.plist
134
+ launchctl print gui/$(id -u)/com.metame.task
135
+ ```
136
+
137
+ Power schedule:
138
+
139
+ ```bash
140
+ pmset -g sched
141
+ sudo pmset repeat wake M 08:00:00
142
+ sudo pmset repeat cancel
143
+ ```
144
+
145
+ ## Optional Tool Patterns
146
+
147
+ AeroSpace (if installed):
148
+
149
+ ```bash
150
+ aerospace list-workspaces --all
151
+ aerospace focus-workspace 2
152
+ aerospace move-node-to-workspace 2
153
+ ```
154
+
155
+ yabai/skhd (if installed):
156
+
157
+ ```bash
158
+ yabai -m query --windows --window
159
+ yabai -m window --focus east
160
+ skhd --reload
161
+ ```
162
+
163
+ Keyboard Maestro CLI (if installed):
164
+
165
+ ```bash
166
+ ls "/Applications/Keyboard Maestro.app/Contents/MacOS" 2>/dev/null
167
+ ```
168
+
169
+ ## Error Handling
170
+
171
+ 1. If command output is empty for successful action, report as `已执行` (not `no output`).
172
+ 2. If permission is missing, explain which permission is required and guide user to open the corresponding settings page, then retry.
173
+ 3. If app name is ambiguous, ask a clarification question before executing.
174
+ 4. If requested third-party tool is missing, provide:
175
+ - current state (`未检测到 <tool>`)
176
+ - minimal install command (only when user asks to install)
177
+ - immediate native fallback plan.
178
+
179
+ ## Permission Checklist
180
+
181
+ - Automation: Privacy & Security -> Automation
182
+ - Accessibility: Privacy & Security -> Accessibility
183
+ - Screen & System Audio Recording (only if screen pipeline is explicitly needed)
184
+ - Full Disk Access (only for file-heavy operations)
185
+
186
+ Permission onboarding commands:
187
+
188
+ ```bash
189
+ open "x-apple.systempreferences:com.apple.preference.security?Privacy_Automation"
190
+ open "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"
191
+ open "x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture"
192
+ ```
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "macOS Local Orchestrator"
3
+ short_description: "Use local Bash/AppleScript to automate Mac tasks safely"
4
+ default_prompt: "Use this skill to automate macOS with local scripts and confirmation for side effects."
@@ -0,0 +1,70 @@
1
+ # macOS Automation Tooling Landscape (Fusion Notes)
2
+
3
+ ## Goal
4
+
5
+ Map mature macOS automation ecosystems into one orchestration skill, with a native-first strategy.
6
+
7
+ ## Native Foundation (Always Available)
8
+
9
+ 1. AppleScript / JXA via `osascript`
10
+ - Use for app control, system actions, and cross-app scripting.
11
+ 2. Shortcuts CLI (`shortcuts`)
12
+ - Use for reusable multi-step workflows and parameterized runs.
13
+ 3. `launchd` / `launchctl`
14
+ - Use for resilient user-level background tasks (`~/Library/LaunchAgents`).
15
+ 4. `pmset`
16
+ - Use for wake/sleep scheduling.
17
+ 5. System Settings deep links (`x-apple.systempreferences:`)
18
+ - Use for permission onboarding and recovery.
19
+
20
+ ## Third-Party Integrations (Optional)
21
+
22
+ 1. Hammerspoon
23
+ - Best for event-driven automation and custom hotkey/event hooks.
24
+ - Needs Accessibility permissions.
25
+ 2. AeroSpace
26
+ - Best for keyboard-first tiling workspace management.
27
+ - CLI-oriented and SIP-friendly.
28
+ 3. yabai + skhd
29
+ - Best for advanced window tree manipulation + hotkey daemon.
30
+ - Powerful but setup can be more complex than native/AeroSpace.
31
+ 4. Raycast Script Commands
32
+ - Best for launcher-style command catalog and human-triggered flows.
33
+ 5. Keyboard Maestro
34
+ - Best for mature macro workflows in GUI-heavy productivity use cases.
35
+
36
+ ## Fusion Strategy
37
+
38
+ 1. Keep one unified intent layer in `macos-local-orchestrator`.
39
+ 2. Apply runtime detection:
40
+ - If requested tool exists, use it.
41
+ - If missing, fallback to native path and report gap briefly.
42
+ 3. Keep confirmation gate for all side effects.
43
+ 4. Prefer native fallback before introducing new dependencies.
44
+
45
+ ## Source Links
46
+
47
+ - Apple: Mac Automation Scripting Guide
48
+ https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/
49
+ - Apple: `shortcuts` command-line docs
50
+ https://support.apple.com/guide/shortcuts-mac/command-line-interface-apd455c82f02/mac
51
+ - Apple: Launch daemons and agents
52
+ https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLaunchdJobs.html
53
+ - Apple: `pmset` usage
54
+ https://support.apple.com/en-sa/guide/mac-help/mchl40376151/mac
55
+ - Apple: Allow apps to control your Mac (Automation permission)
56
+ https://support.apple.com/en-vn/guide/mac-help/mchl108e1718/mac
57
+ - Apple: Allow accessibility apps to access your Mac
58
+ https://support.apple.com/en-kz/guide/mac-help/mh43185/mac
59
+ - Hammerspoon docs
60
+ https://www.hammerspoon.org/docs/
61
+ - AeroSpace repo/docs
62
+ https://github.com/nikitabobko/AeroSpace
63
+ - yabai repo/docs
64
+ https://github.com/koekeishiya/yabai
65
+ - skhd repo/docs
66
+ https://github.com/koekeishiya/skhd
67
+ - Raycast Script Commands
68
+ https://developers.raycast.com/information/lifecycle/script-commands
69
+ - Keyboard Maestro docs
70
+ https://wiki.keyboardmaestro.com