@robbiesrobotics/alice-agents 1.5.10 → 1.5.13
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.
- package/README.md +15 -24
- package/bin/alice-install.mjs +5 -22
- package/lib/agent-registry.mjs +50 -9
- package/lib/alice-runtime-adapter.mjs +50 -0
- package/lib/doctor.mjs +1 -32
- package/lib/hermes-installer.mjs +33 -51
- package/lib/installer.mjs +171 -249
- package/lib/manifest.mjs +14 -9
- package/lib/prompter.mjs +2 -34
- package/lib/runtime-installer.mjs +314 -0
- package/lib/workspace-scaffolder.mjs +193 -17
- package/package.json +14 -9
- package/templates/agents-pro.json +147 -36
- package/templates/agents-starter.json +207 -7
- package/templates/workspaces/_shared/AGENTS-orchestrator.md +19 -9
- package/templates/workspaces/_shared/AGENTS.md +9 -0
- package/templates/workspaces/_shared/HEARTBEAT.md +18 -0
- package/templates/workspaces/_shared/PLAYBOOK.md +6 -6
- package/templates/workspaces/_shared/SOUL-coding.md +20 -0
- package/templates/workspaces/_shared/SOUL-hermes.md +20 -0
- package/templates/workspaces/_shared/SOUL-orchestrator.md +20 -0
- package/templates/workspaces/_shared/SOUL.md +20 -0
- package/templates/workspaces/athena/AGENTS.md +172 -0
- package/templates/workspaces/athena/SOUL.md +59 -0
- package/templates/workspaces/athena/TOOLS.md +63 -0
- package/templates/workspaces/devon/AGENTS.md +50 -34
- package/templates/workspaces/devon/TOOLS.md +20 -37
- package/templates/workspaces/dylan/AGENTS.md +44 -34
- package/templates/workspaces/dylan/TOOLS.md +11 -35
- package/templates/workspaces/felix/AGENTS.md +50 -34
- package/templates/workspaces/felix/TOOLS.md +20 -45
- package/templates/workspaces/morgan/AGENTS.md +48 -39
- package/templates/workspaces/morgan/TOOLS.md +26 -9
- package/templates/workspaces/priya/AGENTS.md +68 -0
- package/templates/workspaces/priya/TOOLS.md +32 -0
- package/templates/workspaces/quinn/AGENTS.md +50 -34
- package/templates/workspaces/quinn/TOOLS.md +30 -48
- package/templates/workspaces/sasha/AGENTS.md +68 -0
- package/templates/workspaces/sasha/TOOLS.md +32 -0
- package/bin/alice-cloud.cjs +0 -385
- package/lib/mission-control.mjs +0 -242
- package/snapshots/.gitkeep +0 -0
- package/templates/mission-control-bridge/index.ts +0 -695
- package/templates/mission-control-bridge/openclaw.plugin.json +0 -8
- package/templates/mission-control-bridge/package.json +0 -11
- package/templates/skills/.gitkeep +0 -0
- package/templates/skills/acculynx/SKILL.md +0 -183
- package/templates/skills/acculynx/references/analysis_template.py +0 -116
- package/templates/skills/acculynx/references/dashboard_page.tsx +0 -641
- package/templates/skills/claude-code/.gitkeep +0 -0
- package/templates/skills/claude-code/SKILL.md +0 -111
- package/templates/skills/coding-agent/SKILL.md +0 -68
- package/templates/skills/crawl4ai/SKILL.md +0 -119
- package/templates/skills/crawl4ai/scripts/crwl +0 -3
- package/templates/workspaces/.gitkeep +0 -0
- package/templates/workspaces/_shared/.gitkeep +0 -0
- package/templates/workspaces/accuscope/AGENTS.md +0 -38
- package/templates/workspaces/accuscope/FEEDBACK.md +0 -27
- package/templates/workspaces/accuscope/HEARTBEAT.md +0 -26
- package/templates/workspaces/accuscope/IDENTITY.md +0 -48
- package/templates/workspaces/accuscope/LEARNINGS.md +0 -46
- package/templates/workspaces/accuscope/MEMORY.md +0 -47
- package/templates/workspaces/accuscope/PLAYBOOK.md +0 -65
- package/templates/workspaces/accuscope/SOUL.md +0 -40
- package/templates/workspaces/accuscope/TOOLS.md +0 -63
- package/templates/workspaces/accuscope/USER.md +0 -39
- package/templates/workspaces/aiden/AGENTS.md +0 -52
- package/templates/workspaces/aiden/FEEDBACK.md +0 -12
- package/templates/workspaces/aiden/HEARTBEAT.md +0 -9
- package/templates/workspaces/aiden/IDENTITY.md +0 -6
- package/templates/workspaces/aiden/LEARNINGS.md +0 -6
- package/templates/workspaces/aiden/MEMORY.md +0 -22
- package/templates/workspaces/aiden/PLAYBOOK.md +0 -16
- package/templates/workspaces/aiden/SOUL.md +0 -39
- package/templates/workspaces/aiden/TOOLS.md +0 -57
- package/templates/workspaces/aiden/USER.md +0 -17
- package/templates/workspaces/alex/AGENTS.md +0 -52
- package/templates/workspaces/alex/FEEDBACK.md +0 -11
- package/templates/workspaces/alex/HEARTBEAT.md +0 -9
- package/templates/workspaces/alex/IDENTITY.md +0 -6
- package/templates/workspaces/alex/LEARNINGS.md +0 -5
- package/templates/workspaces/alex/MEMORY.md +0 -22
- package/templates/workspaces/alex/PLAYBOOK.md +0 -16
- package/templates/workspaces/alex/SOUL.md +0 -40
- package/templates/workspaces/alex/TOOLS.md +0 -56
- package/templates/workspaces/alex/USER.md +0 -13
- package/templates/workspaces/aria/AGENTS.md +0 -18
- package/templates/workspaces/aria/FEEDBACK.md +0 -12
- package/templates/workspaces/aria/HEARTBEAT.md +0 -32
- package/templates/workspaces/aria/IDENTITY.md +0 -12
- package/templates/workspaces/aria/LEARNINGS.md +0 -31
- package/templates/workspaces/aria/MEMORY.md +0 -29
- package/templates/workspaces/aria/PLAYBOOK.md +0 -71
- package/templates/workspaces/aria/SOUL.md +0 -57
- package/templates/workspaces/aria/TOOLS.md +0 -47
- package/templates/workspaces/aria/USER.md +0 -18
- package/templates/workspaces/audrey/AGENTS.md +0 -59
- package/templates/workspaces/audrey/FEEDBACK.md +0 -11
- package/templates/workspaces/audrey/HEARTBEAT.md +0 -9
- package/templates/workspaces/audrey/IDENTITY.md +0 -6
- package/templates/workspaces/audrey/LEARNINGS.md +0 -5
- package/templates/workspaces/audrey/MEMORY.md +0 -22
- package/templates/workspaces/audrey/PLAYBOOK.md +0 -16
- package/templates/workspaces/audrey/SOUL.md +0 -39
- package/templates/workspaces/audrey/TOOLS.md +0 -15
- package/templates/workspaces/audrey/USER.md +0 -13
- package/templates/workspaces/avery/AGENTS.md +0 -52
- package/templates/workspaces/avery/FEEDBACK.md +0 -12
- package/templates/workspaces/avery/HEARTBEAT.md +0 -5
- package/templates/workspaces/avery/IDENTITY.md +0 -6
- package/templates/workspaces/avery/LEARNINGS.md +0 -6
- package/templates/workspaces/avery/MEMORY.md +0 -22
- package/templates/workspaces/avery/PLAYBOOK.md +0 -16
- package/templates/workspaces/avery/SOUL.md +0 -40
- package/templates/workspaces/avery/TOOLS.md +0 -47
- package/templates/workspaces/avery/USER.md +0 -17
- package/templates/workspaces/avery/skills/claude-code/SKILL.md +0 -38
- package/templates/workspaces/avery/skills/claude-code/claude_code +0 -55
- package/templates/workspaces/caleb/AGENTS.md +0 -52
- package/templates/workspaces/caleb/FEEDBACK.md +0 -11
- package/templates/workspaces/caleb/HEARTBEAT.md +0 -9
- package/templates/workspaces/caleb/IDENTITY.md +0 -6
- package/templates/workspaces/caleb/LEARNINGS.md +0 -5
- package/templates/workspaces/caleb/MEMORY.md +0 -22
- package/templates/workspaces/caleb/PLAYBOOK.md +0 -16
- package/templates/workspaces/caleb/SOUL.md +0 -39
- package/templates/workspaces/caleb/TOOLS.md +0 -30
- package/templates/workspaces/caleb/USER.md +0 -13
- package/templates/workspaces/clara/AGENTS.md +0 -59
- package/templates/workspaces/clara/FEEDBACK.md +0 -12
- package/templates/workspaces/clara/HEARTBEAT.md +0 -5
- package/templates/workspaces/clara/IDENTITY.md +0 -6
- package/templates/workspaces/clara/LEARNINGS.md +0 -6
- package/templates/workspaces/clara/MEMORY.md +0 -22
- package/templates/workspaces/clara/PLAYBOOK.md +0 -16
- package/templates/workspaces/clara/SOUL.md +0 -39
- package/templates/workspaces/clara/TOOLS.md +0 -15
- package/templates/workspaces/clara/USER.md +0 -17
- package/templates/workspaces/daphne/AGENTS.md +0 -59
- package/templates/workspaces/daphne/FEEDBACK.md +0 -18
- package/templates/workspaces/daphne/HEARTBEAT.md +0 -5
- package/templates/workspaces/daphne/IDENTITY.md +0 -6
- package/templates/workspaces/daphne/LEARNINGS.md +0 -6
- package/templates/workspaces/daphne/MEMORY.md +0 -22
- package/templates/workspaces/daphne/PLAYBOOK.md +0 -48
- package/templates/workspaces/daphne/SOUL.md +0 -39
- package/templates/workspaces/daphne/TOOLS.md +0 -15
- package/templates/workspaces/daphne/USER.md +0 -17
- package/templates/workspaces/darius/AGENTS.md +0 -52
- package/templates/workspaces/darius/FEEDBACK.md +0 -12
- package/templates/workspaces/darius/HEARTBEAT.md +0 -5
- package/templates/workspaces/darius/IDENTITY.md +0 -6
- package/templates/workspaces/darius/LEARNINGS.md +0 -6
- package/templates/workspaces/darius/MEMORY.md +0 -22
- package/templates/workspaces/darius/PLAYBOOK.md +0 -16
- package/templates/workspaces/darius/SOUL.md +0 -40
- package/templates/workspaces/darius/TOOLS.md +0 -57
- package/templates/workspaces/darius/USER.md +0 -17
- package/templates/workspaces/darius/skills/claude-code/SKILL.md +0 -38
- package/templates/workspaces/darius/skills/claude-code/claude_code +0 -55
- package/templates/workspaces/devon/FEEDBACK.md +0 -11
- package/templates/workspaces/devon/HEARTBEAT.md +0 -5
- package/templates/workspaces/devon/IDENTITY.md +0 -6
- package/templates/workspaces/devon/LEARNINGS.md +0 -11
- package/templates/workspaces/devon/MEMORY.md +0 -22
- package/templates/workspaces/devon/PLAYBOOK.md +0 -16
- package/templates/workspaces/devon/SOUL.md +0 -40
- package/templates/workspaces/devon/USER.md +0 -13
- package/templates/workspaces/devon/check_github.py +0 -12
- package/templates/workspaces/devon/check_mc_env.py +0 -30
- package/templates/workspaces/devon/check_sb.py +0 -34
- package/templates/workspaces/devon/check_vercel.py +0 -12
- package/templates/workspaces/devon/get_mc_files.py +0 -17
- package/templates/workspaces/devon/write_heartbeat.py +0 -67
- package/templates/workspaces/dylan/.env.example +0 -33
- package/templates/workspaces/dylan/00007_verify_licenses_table.sql +0 -100
- package/templates/workspaces/dylan/FEEDBACK.md +0 -28
- package/templates/workspaces/dylan/HEARTBEAT.md +0 -5
- package/templates/workspaces/dylan/IDENTITY.md +0 -6
- package/templates/workspaces/dylan/LEARNINGS.md +0 -70
- package/templates/workspaces/dylan/MEMORY.md +0 -22
- package/templates/workspaces/dylan/PLAYBOOK.md +0 -16
- package/templates/workspaces/dylan/SOUL.md +0 -42
- package/templates/workspaces/dylan/STRIPE_PIPELINE.md +0 -185
- package/templates/workspaces/dylan/USER.md +0 -17
- package/templates/workspaces/dylan/n8n-stripe-welcome-workflow.json +0 -123
- package/templates/workspaces/dylan/skills/claude-code/SKILL.md +0 -38
- package/templates/workspaces/dylan/skills/claude-code/claude_code +0 -55
- package/templates/workspaces/dylan/stripe-webhook-handler.py +0 -433
- package/templates/workspaces/dylan/test_mock_webhook.py +0 -103
- package/templates/workspaces/elena/AGENTS.md +0 -59
- package/templates/workspaces/elena/FEEDBACK.md +0 -11
- package/templates/workspaces/elena/HEARTBEAT.md +0 -9
- package/templates/workspaces/elena/IDENTITY.md +0 -6
- package/templates/workspaces/elena/LEARNINGS.md +0 -5
- package/templates/workspaces/elena/MEMORY.md +0 -22
- package/templates/workspaces/elena/PLAYBOOK.md +0 -16
- package/templates/workspaces/elena/SOUL.md +0 -39
- package/templates/workspaces/elena/TOOLS.md +0 -15
- package/templates/workspaces/elena/USER.md +0 -13
- package/templates/workspaces/eva/AGENTS.md +0 -59
- package/templates/workspaces/eva/FEEDBACK.md +0 -11
- package/templates/workspaces/eva/HEARTBEAT.md +0 -9
- package/templates/workspaces/eva/IDENTITY.md +0 -6
- package/templates/workspaces/eva/LEARNINGS.md +0 -5
- package/templates/workspaces/eva/MEMORY.md +0 -22
- package/templates/workspaces/eva/PLAYBOOK.md +0 -16
- package/templates/workspaces/eva/SOUL.md +0 -39
- package/templates/workspaces/eva/TOOLS.md +0 -15
- package/templates/workspaces/eva/USER.md +0 -13
- package/templates/workspaces/felix/FEEDBACK.md +0 -11
- package/templates/workspaces/felix/HEARTBEAT.md +0 -5
- package/templates/workspaces/felix/IDENTITY.md +0 -6
- package/templates/workspaces/felix/LEARNINGS.md +0 -17
- package/templates/workspaces/felix/MEMORY.md +0 -22
- package/templates/workspaces/felix/PLAYBOOK.md +0 -16
- package/templates/workspaces/felix/SOUL.md +0 -40
- package/templates/workspaces/felix/USER.md +0 -13
- package/templates/workspaces/felix/fidelia-psychology.html +0 -1594
- package/templates/workspaces/felix/task.txt +0 -164
- package/templates/workspaces/hannah/AGENTS.md +0 -59
- package/templates/workspaces/hannah/FEEDBACK.md +0 -12
- package/templates/workspaces/hannah/HEARTBEAT.md +0 -5
- package/templates/workspaces/hannah/IDENTITY.md +0 -6
- package/templates/workspaces/hannah/LEARNINGS.md +0 -6
- package/templates/workspaces/hannah/MEMORY.md +0 -22
- package/templates/workspaces/hannah/PLAYBOOK.md +0 -16
- package/templates/workspaces/hannah/SOUL.md +0 -39
- package/templates/workspaces/hannah/TOOLS.md +0 -15
- package/templates/workspaces/hannah/USER.md +0 -17
- package/templates/workspaces/isaac/AGENTS.md +0 -52
- package/templates/workspaces/isaac/FEEDBACK.md +0 -12
- package/templates/workspaces/isaac/HEARTBEAT.md +0 -9
- package/templates/workspaces/isaac/IDENTITY.md +0 -6
- package/templates/workspaces/isaac/LEARNINGS.md +0 -6
- package/templates/workspaces/isaac/MEMORY.md +0 -22
- package/templates/workspaces/isaac/PLAYBOOK.md +0 -16
- package/templates/workspaces/isaac/SOUL.md +0 -40
- package/templates/workspaces/isaac/TOOLS.md +0 -52
- package/templates/workspaces/isaac/USER.md +0 -17
- package/templates/workspaces/isaac/skills/claude-code/SKILL.md +0 -38
- package/templates/workspaces/isaac/skills/claude-code/claude_code +0 -55
- package/templates/workspaces/logan/AGENTS.md +0 -59
- package/templates/workspaces/logan/FEEDBACK.md +0 -11
- package/templates/workspaces/logan/HEARTBEAT.md +0 -9
- package/templates/workspaces/logan/IDENTITY.md +0 -6
- package/templates/workspaces/logan/LEARNINGS.md +0 -5
- package/templates/workspaces/logan/MEMORY.md +0 -22
- package/templates/workspaces/logan/PLAYBOOK.md +0 -16
- package/templates/workspaces/logan/SOUL.md +0 -39
- package/templates/workspaces/logan/TOOLS.md +0 -15
- package/templates/workspaces/logan/USER.md +0 -13
- package/templates/workspaces/maxxipro/AGENTS.md +0 -29
- package/templates/workspaces/maxxipro/FEEDBACK.md +0 -19
- package/templates/workspaces/maxxipro/HEARTBEAT.md +0 -22
- package/templates/workspaces/maxxipro/IDENTITY.md +0 -35
- package/templates/workspaces/maxxipro/KNOWLEDGE.md +0 -335
- package/templates/workspaces/maxxipro/LEARNINGS.md +0 -47
- package/templates/workspaces/maxxipro/MEMORY.md +0 -60
- package/templates/workspaces/maxxipro/OUTREACH_TEMPLATES.md +0 -143
- package/templates/workspaces/maxxipro/PLAYBOOK.md +0 -81
- package/templates/workspaces/maxxipro/SOUL.md +0 -146
- package/templates/workspaces/maxxipro/TOOLS.md +0 -81
- package/templates/workspaces/maxxipro/USER.md +0 -40
- package/templates/workspaces/morgan/FEEDBACK.md +0 -19
- package/templates/workspaces/morgan/HEARTBEAT.md +0 -5
- package/templates/workspaces/morgan/IDENTITY.md +0 -6
- package/templates/workspaces/morgan/LEARNINGS.md +0 -18
- package/templates/workspaces/morgan/MEMORY.md +0 -22
- package/templates/workspaces/morgan/PLAYBOOK.md +0 -16
- package/templates/workspaces/morgan/SOUL.md +0 -39
- package/templates/workspaces/morgan/USER.md +0 -13
- package/templates/workspaces/nadia/AGENTS.md +0 -59
- package/templates/workspaces/nadia/FEEDBACK.md +0 -12
- package/templates/workspaces/nadia/HEARTBEAT.md +0 -5
- package/templates/workspaces/nadia/IDENTITY.md +0 -6
- package/templates/workspaces/nadia/LEARNINGS.md +0 -6
- package/templates/workspaces/nadia/MEMORY.md +0 -22
- package/templates/workspaces/nadia/PLAYBOOK.md +0 -16
- package/templates/workspaces/nadia/SOUL.md +0 -39
- package/templates/workspaces/nadia/TOOLS.md +0 -15
- package/templates/workspaces/nadia/USER.md +0 -13
- package/templates/workspaces/nate/AGENTS.md +0 -24
- package/templates/workspaces/nate/FEEDBACK.md +0 -12
- package/templates/workspaces/nate/HEARTBEAT.md +0 -33
- package/templates/workspaces/nate/IDENTITY.md +0 -15
- package/templates/workspaces/nate/LEARNINGS.md +0 -33
- package/templates/workspaces/nate/MEMORY.md +0 -39
- package/templates/workspaces/nate/PLAYBOOK.md +0 -160
- package/templates/workspaces/nate/SOUL.md +0 -50
- package/templates/workspaces/nate/TOOLS.md +0 -111
- package/templates/workspaces/nate/USER.md +0 -32
- package/templates/workspaces/olivia/.last-openclaw-version +0 -1
- package/templates/workspaces/olivia/.npmrc.tmp +0 -0
- package/templates/workspaces/olivia/AGENTS.md +0 -77
- package/templates/workspaces/olivia/ALPHA_CODING_BENCHMARK.txt +0 -148
- package/templates/workspaces/olivia/ALPHA_MODEL_GUIDE.md +0 -393
- package/templates/workspaces/olivia/FEEDBACK.md +0 -13
- package/templates/workspaces/olivia/HEADTOHEAD_BENCHMARK.txt +0 -1289
- package/templates/workspaces/olivia/HEARTBEAT.md +0 -267
- package/templates/workspaces/olivia/IDENTITY.md +0 -6
- package/templates/workspaces/olivia/LEARNINGS.md +0 -708
- package/templates/workspaces/olivia/MEMORY.md +0 -202
- package/templates/workspaces/olivia/MISSION_CONTROL_DESIGN_SPEC_v1.md +0 -1143
- package/templates/workspaces/olivia/MVP-COMPLETION-SUMMARY.md +0 -175
- package/templates/workspaces/olivia/NETWORK_IMPLEMENTATION_PLAN.md +0 -1556
- package/templates/workspaces/olivia/NEW_NODES_BENCHMARK.txt +0 -947
- package/templates/workspaces/olivia/PLAYBOOK.md +0 -42
- package/templates/workspaces/olivia/SELF-HEALING-COMPLETE.md +0 -150
- package/templates/workspaces/olivia/SOUL.md +0 -42
- package/templates/workspaces/olivia/TOOLS.md +0 -15
- package/templates/workspaces/olivia/USER.md +0 -17
- package/templates/workspaces/olivia/alicefleet-supabase-credentials.md +0 -50
- package/templates/workspaces/olivia/dzombo-copy-rewrite.md +0 -115
- package/templates/workspaces/olivia/dzombo-implementation-plan.md +0 -1248
- package/templates/workspaces/olivia/fidelia-psychology.html +0 -1594
- package/templates/workspaces/olivia/lead_debug.png +0 -0
- package/templates/workspaces/olivia/minimatch-10.2.4.tgz +0 -0
- package/templates/workspaces/olivia/operation-bllm-research.md +0 -157
- package/templates/workspaces/olivia/qa-audit-mission-control-v2.md +0 -538
- package/templates/workspaces/olivia/roofmaxx_logo.svg +0 -1
- package/templates/workspaces/olivia/roofmaxx_social.jpg +0 -0
- package/templates/workspaces/olivia/skills/1password/SKILL.md +0 -53
- package/templates/workspaces/olivia/skills/1password/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/afrexai-recruiting-engine/README.md +0 -57
- package/templates/workspaces/olivia/skills/afrexai-recruiting-engine/SKILL.md +0 -534
- package/templates/workspaces/olivia/skills/afrexai-recruiting-engine/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/agent-security/SKILL.md +0 -69
- package/templates/workspaces/olivia/skills/agent-security/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/agentic-security-audit/SKILL.md +0 -855
- package/templates/workspaces/olivia/skills/agentic-security-audit/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/ai-automation-consulting/SKILL.md +0 -67
- package/templates/workspaces/olivia/skills/ai-automation-consulting/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/ai-automation-consulting/skill.json +0 -12
- package/templates/workspaces/olivia/skills/ai-presentation-maker/SKILL.md +0 -1104
- package/templates/workspaces/olivia/skills/ai-presentation-maker/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/ai-productivity-audit/SKILL.md +0 -181
- package/templates/workspaces/olivia/skills/ai-productivity-audit/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/ai-researcher/README.md +0 -31
- package/templates/workspaces/olivia/skills/ai-researcher/SKILL.md +0 -59
- package/templates/workspaces/olivia/skills/ai-researcher/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/ai-seo-writer/README.md +0 -19
- package/templates/workspaces/olivia/skills/ai-seo-writer/SKILL.md +0 -100
- package/templates/workspaces/olivia/skills/ai-seo-writer/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/analytics-tracking-2/SKILL.md +0 -309
- package/templates/workspaces/olivia/skills/analytics-tracking-2/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/api-doc-writer/SKILL.md +0 -232
- package/templates/workspaces/olivia/skills/api-doc-writer/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/api-generator/SKILL.md +0 -49
- package/templates/workspaces/olivia/skills/api-generator/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/api-generator/tips.md +0 -10
- package/templates/workspaces/olivia/skills/apple-notes/SKILL.md +0 -50
- package/templates/workspaces/olivia/skills/apple-notes/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/apple-reminders/SKILL.md +0 -67
- package/templates/workspaces/olivia/skills/apple-reminders/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/automation-workflows/SKILL.md +0 -267
- package/templates/workspaces/olivia/skills/automation-workflows/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/autoresearch/SKILL.md +0 -46
- package/templates/workspaces/olivia/skills/autoresearch/aria_write.py +0 -148
- package/templates/workspaces/olivia/skills/autoresearch/autoresearch.py +0 -75
- package/templates/workspaces/olivia/skills/azure-devops/SKILL.md +0 -115
- package/templates/workspaces/olivia/skills/azure-devops/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/blogwatcher/SKILL.md +0 -46
- package/templates/workspaces/olivia/skills/blogwatcher/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/blucli/SKILL.md +0 -27
- package/templates/workspaces/olivia/skills/blucli/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/check-analytics/SKILL.md +0 -92
- package/templates/workspaces/olivia/skills/check-analytics/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/cloud-architect/SKILL.md +0 -89
- package/templates/workspaces/olivia/skills/cloud-architect/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/cloud-infra-automation/SKILL.md +0 -50
- package/templates/workspaces/olivia/skills/cloud-infra-automation/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/cloud-storage/SKILL.md +0 -61
- package/templates/workspaces/olivia/skills/cloud-storage/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/cloud-storage/auth.md +0 -97
- package/templates/workspaces/olivia/skills/cloud-storage/costs.md +0 -88
- package/templates/workspaces/olivia/skills/cloud-storage/providers.md +0 -55
- package/templates/workspaces/olivia/skills/copywriting-pro/SKILL.md +0 -107
- package/templates/workspaces/olivia/skills/copywriting-pro/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/data-analyst-pro/SKILL.md +0 -21
- package/templates/workspaces/olivia/skills/data-analyst-pro/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/database-designer/README.md +0 -388
- package/templates/workspaces/olivia/skills/database-designer/SKILL.md +0 -66
- package/templates/workspaces/olivia/skills/database-designer/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/database-designer/index_optimizer.py +0 -926
- package/templates/workspaces/olivia/skills/database-designer/migration_generator.py +0 -1199
- package/templates/workspaces/olivia/skills/database-designer/schema_analyzer.py +0 -982
- package/templates/workspaces/olivia/skills/deploy-agent/SKILL.md +0 -255
- package/templates/workspaces/olivia/skills/deploy-agent/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/devops-automation-pack/SKILL.md +0 -72
- package/templates/workspaces/olivia/skills/devops-automation-pack/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/devops-automation-pack/deploy.sh +0 -0
- package/templates/workspaces/olivia/skills/financial-analysis-agent/SKILL.md +0 -489
- package/templates/workspaces/olivia/skills/financial-analysis-agent/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/gdpr-compliance-tracker/README.md +0 -72
- package/templates/workspaces/olivia/skills/gdpr-compliance-tracker/SKILL.md +0 -226
- package/templates/workspaces/olivia/skills/gdpr-compliance-tracker/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/gifgrep/SKILL.md +0 -47
- package/templates/workspaces/olivia/skills/gifgrep/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/github/SKILL.md +0 -47
- package/templates/workspaces/olivia/skills/github/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/gog/SKILL.md +0 -36
- package/templates/workspaces/olivia/skills/gog/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/growth-strategy-hub/SKILL.md +0 -135
- package/templates/workspaces/olivia/skills/growth-strategy-hub/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/growth-strategy-hub/metadata.json +0 -4
- package/templates/workspaces/olivia/skills/hetzner-cloud/SKILL.md +0 -130
- package/templates/workspaces/olivia/skills/hetzner-cloud/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/himalaya/SKILL.md +0 -217
- package/templates/workspaces/olivia/skills/himalaya/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/hotel-recommendation/SKILL.md +0 -117
- package/templates/workspaces/olivia/skills/hotel-recommendation/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/hr-policy-generator/SKILL.md +0 -54
- package/templates/workspaces/olivia/skills/hr-policy-generator/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/human-writing/SKILL.md +0 -41
- package/templates/workspaces/olivia/skills/human-writing/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/imsg/SKILL.md +0 -25
- package/templates/workspaces/olivia/skills/imsg/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/in-depth-research/SKILL.md +0 -124
- package/templates/workspaces/olivia/skills/in-depth-research/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/in-depth-research/methodology.md +0 -75
- package/templates/workspaces/olivia/skills/in-depth-research/output-formats.md +0 -168
- package/templates/workspaces/olivia/skills/in-depth-research/sources.md +0 -80
- package/templates/workspaces/olivia/skills/javascript-skills/README.md +0 -71
- package/templates/workspaces/olivia/skills/javascript-skills/SKILL.md +0 -746
- package/templates/workspaces/olivia/skills/javascript-skills/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/leadership-strategy-playbook/SKILL.md +0 -147
- package/templates/workspaces/olivia/skills/leadership-strategy-playbook/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/market-research-agent/README.md +0 -29
- package/templates/workspaces/olivia/skills/market-research-agent/SKILL.md +0 -52
- package/templates/workspaces/olivia/skills/market-research-agent/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/marketing-analytics/SKILL.md +0 -74
- package/templates/workspaces/olivia/skills/marketing-analytics/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/marketing-master-io/SKILL.md +0 -125
- package/templates/workspaces/olivia/skills/marketing-master-io/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/marketing-strategy-pmm/SKILL.md +0 -398
- package/templates/workspaces/olivia/skills/marketing-strategy-pmm/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/meta-ads-analytics/SKILL.md +0 -53
- package/templates/workspaces/olivia/skills/meta-ads-analytics/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/obsidian/SKILL.md +0 -55
- package/templates/workspaces/olivia/skills/obsidian/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/openclaw-accounting/SKILL.md +0 -125
- package/templates/workspaces/olivia/skills/openclaw-accounting/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/openclaw-security-toolkit/CHANGELOG.md +0 -35
- package/templates/workspaces/olivia/skills/openclaw-security-toolkit/CHANNELLOG.md +0 -73
- package/templates/workspaces/olivia/skills/openclaw-security-toolkit/README.md +0 -161
- package/templates/workspaces/olivia/skills/openclaw-security-toolkit/SKILL.md +0 -130
- package/templates/workspaces/olivia/skills/openclaw-security-toolkit/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/openclaw-security-toolkit/config.json +0 -36
- package/templates/workspaces/olivia/skills/openclaw-security-toolkit/metadata.json +0 -19
- package/templates/workspaces/olivia/skills/openhue/SKILL.md +0 -30
- package/templates/workspaces/olivia/skills/openhue/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/orgx-operations-agent/SKILL.md +0 -41
- package/templates/workspaces/olivia/skills/orgx-operations-agent/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/outreach/SKILL.md +0 -84
- package/templates/workspaces/olivia/skills/outreach/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/outreach/by-type.md +0 -166
- package/templates/workspaces/olivia/skills/outreach/templates.md +0 -154
- package/templates/workspaces/olivia/skills/outreach/tracking.md +0 -145
- package/templates/workspaces/olivia/skills/persona-hr-coordinator/SKILL.md +0 -38
- package/templates/workspaces/olivia/skills/persona-hr-coordinator/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/personal-productivity/SKILL.md +0 -161
- package/templates/workspaces/olivia/skills/personal-productivity/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/personal-productivity/index.js +0 -363
- package/templates/workspaces/olivia/skills/personal-productivity/package.json +0 -15
- package/templates/workspaces/olivia/skills/personal-travel/README.md +0 -34
- package/templates/workspaces/olivia/skills/personal-travel/SKILL.md +0 -46
- package/templates/workspaces/olivia/skills/personal-travel/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/presentation-html-generator-skill/SKILL.md +0 -185
- package/templates/workspaces/olivia/skills/presentation-html-generator-skill/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/product-manager/SKILL.md +0 -77
- package/templates/workspaces/olivia/skills/product-manager/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/quant-strategy/SKILL.md +0 -28
- package/templates/workspaces/olivia/skills/quant-strategy/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/sales-pipeline-tracker/README.md +0 -29
- package/templates/workspaces/olivia/skills/sales-pipeline-tracker/SKILL.md +0 -45
- package/templates/workspaces/olivia/skills/sales-pipeline-tracker/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/security-auditor/SKILL.md +0 -399
- package/templates/workspaces/olivia/skills/security-auditor/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/security-hardening/SKILL.md +0 -296
- package/templates/workspaces/olivia/skills/security-hardening/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/security-scanner/SKILL.md +0 -67
- package/templates/workspaces/olivia/skills/security-scanner/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/seo-optimization/SKILL.md +0 -31
- package/templates/workspaces/olivia/skills/seo-optimization/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/service-booking/SKILL.md +0 -193
- package/templates/workspaces/olivia/skills/service-booking/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/sme-hr-automation/SKILL.md +0 -131
- package/templates/workspaces/olivia/skills/sme-hr-automation/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/social-media-scheduler/README.md +0 -29
- package/templates/workspaces/olivia/skills/social-media-scheduler/SKILL.md +0 -49
- package/templates/workspaces/olivia/skills/social-media-scheduler/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/sonoscli/SKILL.md +0 -26
- package/templates/workspaces/olivia/skills/sonoscli/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/strategy-advisor/SKILL.md +0 -33
- package/templates/workspaces/olivia/skills/strategy-advisor/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/summarize/SKILL.md +0 -49
- package/templates/workspaces/olivia/skills/summarize/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/things-mac/SKILL.md +0 -61
- package/templates/workspaces/olivia/skills/things-mac/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/travel-itinerary-planner/SKILL.md +0 -121
- package/templates/workspaces/olivia/skills/travel-itinerary-planner/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/travel-manager/SKILL.md +0 -36
- package/templates/workspaces/olivia/skills/travel-manager/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/travel-planning/SKILL.md +0 -238
- package/templates/workspaces/olivia/skills/travel-planning/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/travel-planning/booking-guide.md +0 -91
- package/templates/workspaces/olivia/skills/travel-planning/memory-template.md +0 -111
- package/templates/workspaces/olivia/skills/travel-planning/multi-city.md +0 -131
- package/templates/workspaces/olivia/skills/travel-planning/packing-templates.md +0 -155
- package/templates/workspaces/olivia/skills/travel-planning/setup.md +0 -66
- package/templates/workspaces/olivia/skills/update-it-all/SKILL.md +0 -143
- package/templates/workspaces/olivia/skills/update-it-all/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/voice/SKILL.md +0 -62
- package/templates/workspaces/olivia/skills/weather/SKILL.md +0 -49
- package/templates/workspaces/olivia/skills/weather/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/web-researcher/SKILL.md +0 -21
- package/templates/workspaces/olivia/skills/web-researcher/_meta.json +0 -6
- package/templates/workspaces/olivia/skills/website-seo/SKILL.md +0 -284
- package/templates/workspaces/olivia/skills/website-seo/_meta.json +0 -6
- package/templates/workspaces/olivia/stripe-welcome-n8n.json +0 -103
- package/templates/workspaces/olivia/test2.wav.wav +0 -0
- package/templates/workspaces/olivia/test_speech.json +0 -1
- package/templates/workspaces/olivia/test_speech.srt +0 -0
- package/templates/workspaces/olivia/test_speech.tsv +0 -1
- package/templates/workspaces/olivia/test_speech.txt +0 -0
- package/templates/workspaces/olivia/test_speech.vtt +0 -2
- package/templates/workspaces/owen/AGENTS.md +0 -59
- package/templates/workspaces/owen/FEEDBACK.md +0 -12
- package/templates/workspaces/owen/HEARTBEAT.md +0 -5
- package/templates/workspaces/owen/IDENTITY.md +0 -6
- package/templates/workspaces/owen/LEARNINGS.md +0 -46
- package/templates/workspaces/owen/MEMORY.md +0 -22
- package/templates/workspaces/owen/PLAYBOOK.md +0 -16
- package/templates/workspaces/owen/SOUL.md +0 -39
- package/templates/workspaces/owen/TOOLS.md +0 -15
- package/templates/workspaces/owen/USER.md +0 -17
- package/templates/workspaces/parker/AGENTS.md +0 -59
- package/templates/workspaces/parker/FEEDBACK.md +0 -11
- package/templates/workspaces/parker/HEARTBEAT.md +0 -5
- package/templates/workspaces/parker/IDENTITY.md +0 -6
- package/templates/workspaces/parker/LEARNINGS.md +0 -17
- package/templates/workspaces/parker/MEMORY.md +0 -22
- package/templates/workspaces/parker/PLAYBOOK.md +0 -16
- package/templates/workspaces/parker/SOUL.md +0 -39
- package/templates/workspaces/parker/TOOLS.md +0 -15
- package/templates/workspaces/parker/USER.md +0 -13
- package/templates/workspaces/quinn/FEEDBACK.md +0 -11
- package/templates/workspaces/quinn/HEARTBEAT.md +0 -5
- package/templates/workspaces/quinn/IDENTITY.md +0 -6
- package/templates/workspaces/quinn/LEARNINGS.md +0 -35
- package/templates/workspaces/quinn/MEMORY.md +0 -22
- package/templates/workspaces/quinn/PLAYBOOK.md +0 -16
- package/templates/workspaces/quinn/SOUL.md +0 -40
- package/templates/workspaces/quinn/USER.md +0 -17
- package/templates/workspaces/quinn/alice-login-page.png +0 -0
- package/templates/workspaces/rowan/AGENTS.md +0 -59
- package/templates/workspaces/rowan/FEEDBACK.md +0 -12
- package/templates/workspaces/rowan/HEARTBEAT.md +0 -5
- package/templates/workspaces/rowan/IDENTITY.md +0 -6
- package/templates/workspaces/rowan/LEARNINGS.md +0 -12
- package/templates/workspaces/rowan/MEMORY.md +0 -22
- package/templates/workspaces/rowan/PLAYBOOK.md +0 -16
- package/templates/workspaces/rowan/SOUL.md +0 -40
- package/templates/workspaces/rowan/TOOLS.md +0 -59
- package/templates/workspaces/rowan/USER.md +0 -17
- package/templates/workspaces/selena/AGENTS.md +0 -59
- package/templates/workspaces/selena/FEEDBACK.md +0 -12
- package/templates/workspaces/selena/HEARTBEAT.md +0 -5
- package/templates/workspaces/selena/IDENTITY.md +0 -6
- package/templates/workspaces/selena/LEARNINGS.md +0 -24
- package/templates/workspaces/selena/MEMORY.md +0 -22
- package/templates/workspaces/selena/PLAYBOOK.md +0 -16
- package/templates/workspaces/selena/SOUL.md +0 -40
- package/templates/workspaces/selena/TOOLS.md +0 -47
- package/templates/workspaces/selena/USER.md +0 -17
- package/templates/workspaces/selena/kids-ai-security-compliance-plan.md +0 -791
- package/templates/workspaces/selena/kidspark-coppa-compliance-audit.md +0 -866
- package/templates/workspaces/sloane/AGENTS.md +0 -59
- package/templates/workspaces/sloane/FEEDBACK.md +0 -12
- package/templates/workspaces/sloane/HEARTBEAT.md +0 -9
- package/templates/workspaces/sloane/IDENTITY.md +0 -6
- package/templates/workspaces/sloane/LEARNINGS.md +0 -6
- package/templates/workspaces/sloane/MEMORY.md +0 -22
- package/templates/workspaces/sloane/PLAYBOOK.md +0 -16
- package/templates/workspaces/sloane/SOUL.md +0 -39
- package/templates/workspaces/sloane/TOOLS.md +0 -15
- package/templates/workspaces/sloane/USER.md +0 -13
- package/templates/workspaces/smoketestagent/AGENTS.md +0 -52
- package/templates/workspaces/smoketestagent/FEEDBACK.md +0 -3
- package/templates/workspaces/smoketestagent/HEARTBEAT.md +0 -14
- package/templates/workspaces/smoketestagent/IDENTITY.md +0 -6
- package/templates/workspaces/smoketestagent/LEARNINGS.md +0 -3
- package/templates/workspaces/smoketestagent/MEMORY.md +0 -24
- package/templates/workspaces/smoketestagent/PLAYBOOK.md +0 -7
- package/templates/workspaces/smoketestagent/SOUL.md +0 -32
- package/templates/workspaces/smoketestagent/TOOLS.md +0 -13
- package/templates/workspaces/smoketestagent/USER.md +0 -5
- package/templates/workspaces/sophie/AGENTS.md +0 -59
- package/templates/workspaces/sophie/FEEDBACK.md +0 -12
- package/templates/workspaces/sophie/HEARTBEAT.md +0 -9
- package/templates/workspaces/sophie/IDENTITY.md +0 -6
- package/templates/workspaces/sophie/LEARNINGS.md +0 -6
- package/templates/workspaces/sophie/MEMORY.md +0 -22
- package/templates/workspaces/sophie/PLAYBOOK.md +0 -16
- package/templates/workspaces/sophie/SOUL.md +0 -39
- package/templates/workspaces/sophie/TOOLS.md +0 -15
- package/templates/workspaces/sophie/USER.md +0 -17
- package/templates/workspaces/tommy/AGENTS.md +0 -59
- package/templates/workspaces/tommy/FEEDBACK.md +0 -12
- package/templates/workspaces/tommy/HEARTBEAT.md +0 -9
- package/templates/workspaces/tommy/IDENTITY.md +0 -6
- package/templates/workspaces/tommy/LEARNINGS.md +0 -6
- package/templates/workspaces/tommy/MEMORY.md +0 -22
- package/templates/workspaces/tommy/PLAYBOOK.md +0 -16
- package/templates/workspaces/tommy/SOUL.md +0 -39
- package/templates/workspaces/tommy/TOOLS.md +0 -15
- package/templates/workspaces/tommy/USER.md +0 -17
- package/templates/workspaces/uma/AGENTS.md +0 -59
- package/templates/workspaces/uma/FEEDBACK.md +0 -11
- package/templates/workspaces/uma/HEARTBEAT.md +0 -5
- package/templates/workspaces/uma/IDENTITY.md +0 -6
- package/templates/workspaces/uma/LEARNINGS.md +0 -11
- package/templates/workspaces/uma/MEMORY.md +0 -22
- package/templates/workspaces/uma/PLAYBOOK.md +0 -16
- package/templates/workspaces/uma/SOUL.md +0 -39
- package/templates/workspaces/uma/TOOLS.md +0 -15
- package/templates/workspaces/uma/USER.md +0 -13
- package/tools/.gitkeep +0 -0
|
@@ -1,695 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/diagnostics-otel";
|
|
5
|
-
import {
|
|
6
|
-
emptyPluginConfigSchema,
|
|
7
|
-
onDiagnosticEvent,
|
|
8
|
-
} from "openclaw/plugin-sdk/diagnostics-otel";
|
|
9
|
-
import type { DiagnosticEventPayload } from "openclaw/plugin-sdk/diagnostics-otel";
|
|
10
|
-
|
|
11
|
-
const OPENCLAW_HOME = process.env.OPENCLAW_HOME ?? join(homedir(), ".openclaw");
|
|
12
|
-
const MC_CONFIG_PATH = join(OPENCLAW_HOME, ".alice-mission-control.json");
|
|
13
|
-
const DEFAULT_DASHBOARD_URL = "https://alice.av3.ai";
|
|
14
|
-
const DEFAULT_ADMIN_URL = "https://admin.av3.ai";
|
|
15
|
-
const DEFAULT_INGEST_URL = `${DEFAULT_DASHBOARD_URL}/api/v1/ingest`;
|
|
16
|
-
const DEFAULT_RUNTIME_BASE_URL = `${DEFAULT_DASHBOARD_URL}/api/v1/runtime`;
|
|
17
|
-
const DEFAULT_GATEWAY_URL = process.env.OPENCLAW_GATEWAY_URL ?? "http://127.0.0.1:18789";
|
|
18
|
-
const DEFAULT_GATEWAY_TOKEN = process.env.OPENCLAW_GATEWAY_TOKEN ?? process.env.MC_GATEWAY_TOKEN ?? "";
|
|
19
|
-
const DEFAULT_CHAT_USER = process.env.MC_CHAT_USER ?? "mission-control-worker";
|
|
20
|
-
const HEARTBEAT_INTERVAL_MS = 15000;
|
|
21
|
-
const COMMAND_POLL_INTERVAL_MS = 5000;
|
|
22
|
-
|
|
23
|
-
type JsonRecord = Record<string, unknown>;
|
|
24
|
-
|
|
25
|
-
interface RuntimeNodeRegistrationPayload {
|
|
26
|
-
nodeId: string;
|
|
27
|
-
installId: string;
|
|
28
|
-
nodeName: string;
|
|
29
|
-
teamId?: string;
|
|
30
|
-
sourceNode: string;
|
|
31
|
-
connectionMode: "relay";
|
|
32
|
-
gatewayUrl: string;
|
|
33
|
-
runtimeVersion: string;
|
|
34
|
-
platform: string;
|
|
35
|
-
capabilities: JsonRecord;
|
|
36
|
-
metadata: JsonRecord;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface RuntimeCommand {
|
|
40
|
-
id: string;
|
|
41
|
-
nodeId: string;
|
|
42
|
-
type: string;
|
|
43
|
-
status: string;
|
|
44
|
-
threadId: string | null;
|
|
45
|
-
sessionId: string | null;
|
|
46
|
-
payload: JsonRecord;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function readMissionControlConfig(): JsonRecord {
|
|
50
|
-
try {
|
|
51
|
-
if (!existsSync(MC_CONFIG_PATH)) return {};
|
|
52
|
-
return JSON.parse(readFileSync(MC_CONFIG_PATH, "utf8")) as JsonRecord;
|
|
53
|
-
} catch {
|
|
54
|
-
return {};
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function getCloudConfig(): JsonRecord {
|
|
59
|
-
const fileConfig = readMissionControlConfig();
|
|
60
|
-
return typeof fileConfig.cloud === "object" && fileConfig.cloud
|
|
61
|
-
? (fileConfig.cloud as JsonRecord)
|
|
62
|
-
: {};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function getString(value: unknown, fallback = ""): string {
|
|
66
|
-
return typeof value === "string" && value.trim() ? value.trim() : fallback;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function normalizeUrl(value: string): string {
|
|
70
|
-
return value.replace(/\/+$/, "");
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const cloudConfig = getCloudConfig();
|
|
74
|
-
const DASHBOARD_URL = normalizeUrl(
|
|
75
|
-
getString(process.env.MC_DASHBOARD_URL, getString(cloudConfig.dashboardUrl, DEFAULT_DASHBOARD_URL)),
|
|
76
|
-
);
|
|
77
|
-
const ADMIN_URL = normalizeUrl(
|
|
78
|
-
getString(process.env.MC_ADMIN_URL, getString(cloudConfig.adminUrl, DEFAULT_ADMIN_URL)),
|
|
79
|
-
);
|
|
80
|
-
const INGEST_URL = normalizeUrl(
|
|
81
|
-
getString(process.env.MC_INGEST_URL, getString(cloudConfig.ingestUrl, DEFAULT_INGEST_URL)),
|
|
82
|
-
);
|
|
83
|
-
const RUNTIME_BASE_URL = normalizeUrl(
|
|
84
|
-
getString(process.env.MC_RUNTIME_BASE_URL, getString(cloudConfig.runtimeBaseUrl, DEFAULT_RUNTIME_BASE_URL)),
|
|
85
|
-
);
|
|
86
|
-
const NODE_REGISTER_URL = normalizeUrl(
|
|
87
|
-
getString(process.env.MC_NODE_REGISTER_URL, getString(cloudConfig.nodeRegisterUrl, `${RUNTIME_BASE_URL}/nodes/register`)),
|
|
88
|
-
);
|
|
89
|
-
const NODE_HEARTBEAT_URL = normalizeUrl(
|
|
90
|
-
getString(
|
|
91
|
-
process.env.MC_NODE_HEARTBEAT_URL,
|
|
92
|
-
getString(cloudConfig.nodeHeartbeatUrl, `${RUNTIME_BASE_URL}/nodes/heartbeat`),
|
|
93
|
-
),
|
|
94
|
-
);
|
|
95
|
-
const ADMIN_HEARTBEAT_URL = normalizeUrl(
|
|
96
|
-
getString(
|
|
97
|
-
process.env.MC_ADMIN_HEARTBEAT_URL,
|
|
98
|
-
getString(cloudConfig.adminHeartbeatUrl, `${ADMIN_URL}/api/admin/v1/node-heartbeat`),
|
|
99
|
-
),
|
|
100
|
-
);
|
|
101
|
-
const COMMANDS_URL = normalizeUrl(
|
|
102
|
-
getString(process.env.MC_COMMANDS_URL, getString(cloudConfig.commandsUrl, `${RUNTIME_BASE_URL}/commands`)),
|
|
103
|
-
);
|
|
104
|
-
const INGEST_TOKEN = getString(process.env.MC_INGEST_TOKEN, getString(cloudConfig.ingestToken));
|
|
105
|
-
const WORKER_TOKEN = getString(
|
|
106
|
-
process.env.MC_RUNTIME_WORKER_TOKEN,
|
|
107
|
-
getString(cloudConfig.workerToken, INGEST_TOKEN),
|
|
108
|
-
);
|
|
109
|
-
const SOURCE_NODE = getString(process.env.MC_SOURCE_NODE, getString(cloudConfig.sourceNode, "openclaw-local"));
|
|
110
|
-
const TEAM_ID = getString(process.env.MC_TEAM_ID, getString(cloudConfig.teamId));
|
|
111
|
-
const TEAM_SLUG = getString(process.env.MC_TEAM_SLUG, getString(cloudConfig.teamSlug));
|
|
112
|
-
const TEAM_NAME = getString(process.env.MC_TEAM_NAME, getString(cloudConfig.teamName));
|
|
113
|
-
const TEAM_PLAN = getString(process.env.MC_TEAM_PLAN, getString(cloudConfig.teamPlan));
|
|
114
|
-
const INSTALL_ID = getString(process.env.MC_INSTALL_ID, SOURCE_NODE);
|
|
115
|
-
const NODE_ID = getString(process.env.MC_NODE_ID, SOURCE_NODE);
|
|
116
|
-
const GATEWAY_URL = normalizeUrl(getString(process.env.MC_GATEWAY_URL, DEFAULT_GATEWAY_URL));
|
|
117
|
-
const GATEWAY_TOKEN = getString(process.env.MC_GATEWAY_TOKEN, DEFAULT_GATEWAY_TOKEN);
|
|
118
|
-
|
|
119
|
-
function now(): string {
|
|
120
|
-
return new Date().toISOString();
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function sessionKeyToAgentId(sessionKey?: string): string {
|
|
124
|
-
if (!sessionKey) return "unknown";
|
|
125
|
-
const parts = sessionKey.split(":");
|
|
126
|
-
return parts[1] ?? parts[0] ?? "unknown";
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
let seq = 0;
|
|
130
|
-
function nextId(prefix: string): string {
|
|
131
|
-
return `${prefix}-${Date.now()}-${++seq}`;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function authHeaders(token: string): Record<string, string> {
|
|
135
|
-
return token ? { Authorization: `Bearer ${token}` } : {};
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function headers(token = ""): Record<string, string> {
|
|
139
|
-
return {
|
|
140
|
-
"Content-Type": "application/json",
|
|
141
|
-
...authHeaders(token),
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
async function postJson(url: string, token: string, body: object): Promise<Response> {
|
|
146
|
-
return fetch(url, {
|
|
147
|
-
method: "POST",
|
|
148
|
-
headers: headers(token),
|
|
149
|
-
body: JSON.stringify(body),
|
|
150
|
-
signal: AbortSignal.timeout(8000),
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
async function postToIngest(events: object[]): Promise<void> {
|
|
155
|
-
try {
|
|
156
|
-
const res = await postJson(INGEST_URL, INGEST_TOKEN, events);
|
|
157
|
-
if (!res.ok) {
|
|
158
|
-
console.warn(`[mc-bridge] ingest HTTP ${res.status} — ${await res.text().catch(() => "")}`);
|
|
159
|
-
}
|
|
160
|
-
} catch (err) {
|
|
161
|
-
console.warn(`[mc-bridge] ingest post failed: ${String(err)}`);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function buildNodeRegistrationPayload(): RuntimeNodeRegistrationPayload {
|
|
166
|
-
return {
|
|
167
|
-
nodeId: NODE_ID,
|
|
168
|
-
installId: INSTALL_ID,
|
|
169
|
-
nodeName: SOURCE_NODE,
|
|
170
|
-
...(TEAM_ID ? { teamId: TEAM_ID } : {}),
|
|
171
|
-
sourceNode: SOURCE_NODE,
|
|
172
|
-
connectionMode: "relay",
|
|
173
|
-
gatewayUrl: GATEWAY_URL,
|
|
174
|
-
runtimeVersion: process.version,
|
|
175
|
-
platform: process.platform,
|
|
176
|
-
capabilities: {
|
|
177
|
-
telemetry: true,
|
|
178
|
-
commands: true,
|
|
179
|
-
directGateway: true,
|
|
180
|
-
commandTypes: ["agent.message.send"],
|
|
181
|
-
},
|
|
182
|
-
metadata: {
|
|
183
|
-
dashboardUrl: DASHBOARD_URL,
|
|
184
|
-
pluginId: "mission-control-bridge",
|
|
185
|
-
...(TEAM_SLUG ? { teamSlug: TEAM_SLUG } : {}),
|
|
186
|
-
...(TEAM_NAME ? { teamName: TEAM_NAME } : {}),
|
|
187
|
-
...(TEAM_PLAN ? { teamPlan: TEAM_PLAN } : {}),
|
|
188
|
-
},
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
async function registerNode(logger: { info(message: string): void; warn(message: string): void }): Promise<void> {
|
|
193
|
-
if (!WORKER_TOKEN) {
|
|
194
|
-
logger.warn("[mc-bridge] worker token missing; node registration skipped");
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
try {
|
|
198
|
-
const res = await postJson(NODE_REGISTER_URL, WORKER_TOKEN, buildNodeRegistrationPayload());
|
|
199
|
-
if (!res.ok) {
|
|
200
|
-
logger.warn(`[mc-bridge] register failed ${res.status}: ${await res.text().catch(() => "")}`);
|
|
201
|
-
}
|
|
202
|
-
} catch (err) {
|
|
203
|
-
logger.warn(`[mc-bridge] register failed: ${String(err)}`);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
async function heartbeatNode(logger: { warn(message: string): void }): Promise<void> {
|
|
208
|
-
if (!WORKER_TOKEN) return;
|
|
209
|
-
const payload = {
|
|
210
|
-
nodeId: NODE_ID,
|
|
211
|
-
...(TEAM_ID ? { teamId: TEAM_ID } : {}),
|
|
212
|
-
status: "online",
|
|
213
|
-
runtimeVersion: process.version,
|
|
214
|
-
platform: process.platform,
|
|
215
|
-
capabilities: {
|
|
216
|
-
telemetry: true,
|
|
217
|
-
commands: true,
|
|
218
|
-
directGateway: true,
|
|
219
|
-
commandTypes: ["agent.message.send"],
|
|
220
|
-
},
|
|
221
|
-
metadata: {
|
|
222
|
-
dashboardUrl: DASHBOARD_URL,
|
|
223
|
-
...(TEAM_SLUG ? { teamSlug: TEAM_SLUG } : {}),
|
|
224
|
-
...(TEAM_NAME ? { teamName: TEAM_NAME } : {}),
|
|
225
|
-
...(TEAM_PLAN ? { teamPlan: TEAM_PLAN } : {}),
|
|
226
|
-
},
|
|
227
|
-
};
|
|
228
|
-
try {
|
|
229
|
-
const res = await postJson(NODE_HEARTBEAT_URL, WORKER_TOKEN, payload);
|
|
230
|
-
if (!res.ok) {
|
|
231
|
-
logger.warn(`[mc-bridge] heartbeat failed ${res.status}: ${await res.text().catch(() => "")}`);
|
|
232
|
-
}
|
|
233
|
-
} catch (err) {
|
|
234
|
-
logger.warn(`[mc-bridge] heartbeat failed: ${String(err)}`);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
try {
|
|
238
|
-
const res = await postJson(ADMIN_HEARTBEAT_URL, WORKER_TOKEN, {
|
|
239
|
-
instanceId: NODE_ID,
|
|
240
|
-
nodeName: SOURCE_NODE,
|
|
241
|
-
...(TEAM_ID ? { teamId: TEAM_ID } : {}),
|
|
242
|
-
...(TEAM_SLUG ? { teamSlug: TEAM_SLUG } : {}),
|
|
243
|
-
...(TEAM_NAME ? { teamName: TEAM_NAME } : {}),
|
|
244
|
-
...(TEAM_PLAN ? { teamPlan: TEAM_PLAN } : {}),
|
|
245
|
-
tailscaleIp: getString(process.env.TAILSCALE_IP),
|
|
246
|
-
deployedVersion: getString(process.env.MC_DEPLOYED_VERSION),
|
|
247
|
-
runtimeVersion: process.version,
|
|
248
|
-
status: "healthy",
|
|
249
|
-
publicUrl: DASHBOARD_URL,
|
|
250
|
-
region: getString(process.env.MC_REGION),
|
|
251
|
-
backupStatus: "unknown",
|
|
252
|
-
memorySyncStatus: "healthy",
|
|
253
|
-
});
|
|
254
|
-
if (!res.ok) {
|
|
255
|
-
logger.warn(`[mc-bridge] admin heartbeat failed ${res.status}: ${await res.text().catch(() => "")}`);
|
|
256
|
-
}
|
|
257
|
-
} catch (err) {
|
|
258
|
-
logger.warn(`[mc-bridge] admin heartbeat failed: ${String(err)}`);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
async function listQueuedCommands(logger: { warn(message: string): void }): Promise<RuntimeCommand[]> {
|
|
263
|
-
if (!WORKER_TOKEN) return [];
|
|
264
|
-
const url = `${COMMANDS_URL}?nodeId=${encodeURIComponent(NODE_ID)}&limit=5`;
|
|
265
|
-
try {
|
|
266
|
-
const res = await fetch(url, {
|
|
267
|
-
method: "GET",
|
|
268
|
-
headers: authHeaders(WORKER_TOKEN),
|
|
269
|
-
signal: AbortSignal.timeout(8000),
|
|
270
|
-
});
|
|
271
|
-
if (!res.ok) {
|
|
272
|
-
logger.warn(`[mc-bridge] command poll failed ${res.status}: ${await res.text().catch(() => "")}`);
|
|
273
|
-
return [];
|
|
274
|
-
}
|
|
275
|
-
const data = (await res.json()) as { commands?: RuntimeCommand[] };
|
|
276
|
-
return Array.isArray(data.commands) ? data.commands : [];
|
|
277
|
-
} catch (err) {
|
|
278
|
-
logger.warn(`[mc-bridge] command poll failed: ${String(err)}`);
|
|
279
|
-
return [];
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
async function leaseCommand(commandId: string, logger: { warn(message: string): void }): Promise<boolean> {
|
|
284
|
-
try {
|
|
285
|
-
const res = await postJson(`${COMMANDS_URL}/${commandId}/lease`, WORKER_TOKEN, {
|
|
286
|
-
nodeId: NODE_ID,
|
|
287
|
-
leaseOwner: NODE_ID,
|
|
288
|
-
});
|
|
289
|
-
if (res.ok) return true;
|
|
290
|
-
if (res.status !== 409) {
|
|
291
|
-
logger.warn(`[mc-bridge] command lease failed ${res.status}: ${await res.text().catch(() => "")}`);
|
|
292
|
-
}
|
|
293
|
-
return false;
|
|
294
|
-
} catch (err) {
|
|
295
|
-
logger.warn(`[mc-bridge] command lease failed: ${String(err)}`);
|
|
296
|
-
return false;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
async function emitCommandEvent(
|
|
301
|
-
commandId: string,
|
|
302
|
-
eventType: string,
|
|
303
|
-
payload: JsonRecord,
|
|
304
|
-
logger: { warn(message: string): void },
|
|
305
|
-
): Promise<void> {
|
|
306
|
-
try {
|
|
307
|
-
const res = await postJson(`${COMMANDS_URL}/${commandId}/events`, WORKER_TOKEN, {
|
|
308
|
-
nodeId: NODE_ID,
|
|
309
|
-
eventType,
|
|
310
|
-
payload,
|
|
311
|
-
});
|
|
312
|
-
if (!res.ok) {
|
|
313
|
-
logger.warn(`[mc-bridge] command event failed ${res.status}: ${await res.text().catch(() => "")}`);
|
|
314
|
-
}
|
|
315
|
-
} catch (err) {
|
|
316
|
-
logger.warn(`[mc-bridge] command event failed: ${String(err)}`);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
async function completeCommand(
|
|
321
|
-
commandId: string,
|
|
322
|
-
result: JsonRecord,
|
|
323
|
-
logger: { warn(message: string): void },
|
|
324
|
-
): Promise<void> {
|
|
325
|
-
try {
|
|
326
|
-
const res = await postJson(`${COMMANDS_URL}/${commandId}/complete`, WORKER_TOKEN, {
|
|
327
|
-
nodeId: NODE_ID,
|
|
328
|
-
result,
|
|
329
|
-
});
|
|
330
|
-
if (!res.ok) {
|
|
331
|
-
logger.warn(`[mc-bridge] command completion failed ${res.status}: ${await res.text().catch(() => "")}`);
|
|
332
|
-
}
|
|
333
|
-
} catch (err) {
|
|
334
|
-
logger.warn(`[mc-bridge] command completion failed: ${String(err)}`);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
async function failCommand(
|
|
339
|
-
commandId: string,
|
|
340
|
-
error: string,
|
|
341
|
-
logger: { warn(message: string): void },
|
|
342
|
-
): Promise<void> {
|
|
343
|
-
try {
|
|
344
|
-
const res = await postJson(`${COMMANDS_URL}/${commandId}/fail`, WORKER_TOKEN, {
|
|
345
|
-
nodeId: NODE_ID,
|
|
346
|
-
error,
|
|
347
|
-
});
|
|
348
|
-
if (!res.ok) {
|
|
349
|
-
logger.warn(`[mc-bridge] command failure update failed ${res.status}: ${await res.text().catch(() => "")}`);
|
|
350
|
-
}
|
|
351
|
-
} catch (err) {
|
|
352
|
-
logger.warn(`[mc-bridge] command failure update failed: ${String(err)}`);
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
async function executeAgentMessage(command: RuntimeCommand): Promise<JsonRecord> {
|
|
357
|
-
const payload = command.payload ?? {};
|
|
358
|
-
const message = getString(payload.message);
|
|
359
|
-
const agentId = getString(payload.agentId, "olivia");
|
|
360
|
-
const chatUser = getString(payload.user, DEFAULT_CHAT_USER);
|
|
361
|
-
|
|
362
|
-
if (!message) {
|
|
363
|
-
throw new Error("agent.message.send requires payload.message");
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
const gatewayHeaders: Record<string, string> = {
|
|
367
|
-
"Content-Type": "application/json",
|
|
368
|
-
};
|
|
369
|
-
if (GATEWAY_TOKEN) {
|
|
370
|
-
gatewayHeaders.Authorization = `Bearer ${GATEWAY_TOKEN}`;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
const res = await fetch(`${GATEWAY_URL}/v1/responses`, {
|
|
374
|
-
method: "POST",
|
|
375
|
-
headers: gatewayHeaders,
|
|
376
|
-
body: JSON.stringify({
|
|
377
|
-
model: `openclaw:${agentId}`,
|
|
378
|
-
input: message,
|
|
379
|
-
user: chatUser,
|
|
380
|
-
stream: false,
|
|
381
|
-
}),
|
|
382
|
-
signal: AbortSignal.timeout(30000),
|
|
383
|
-
});
|
|
384
|
-
|
|
385
|
-
if (!res.ok) {
|
|
386
|
-
throw new Error(`gateway ${res.status}: ${await res.text().catch(() => "")}`);
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
const data = (await res.json()) as JsonRecord;
|
|
390
|
-
const outputText = extractOutputText(data);
|
|
391
|
-
|
|
392
|
-
return {
|
|
393
|
-
agentId,
|
|
394
|
-
user: chatUser,
|
|
395
|
-
responseId: getString(data.id),
|
|
396
|
-
outputText,
|
|
397
|
-
raw: data,
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
function extractOutputText(data: JsonRecord): string {
|
|
402
|
-
const output = Array.isArray(data.output) ? data.output : [];
|
|
403
|
-
const parts: string[] = [];
|
|
404
|
-
|
|
405
|
-
for (const item of output) {
|
|
406
|
-
if (!item || typeof item !== "object") continue;
|
|
407
|
-
const content = Array.isArray((item as JsonRecord).content) ? ((item as JsonRecord).content as unknown[]) : [];
|
|
408
|
-
for (const block of content) {
|
|
409
|
-
if (!block || typeof block !== "object") continue;
|
|
410
|
-
const record = block as JsonRecord;
|
|
411
|
-
const text =
|
|
412
|
-
getString(record.text) ||
|
|
413
|
-
getString(record.value) ||
|
|
414
|
-
getString(typeof record.output_text === "string" ? record.output_text : "");
|
|
415
|
-
if (text) parts.push(text);
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
return parts.join("\n\n").trim();
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
async function executeCommand(
|
|
423
|
-
command: RuntimeCommand,
|
|
424
|
-
logger: { info(message: string): void; warn(message: string): void },
|
|
425
|
-
): Promise<void> {
|
|
426
|
-
await emitCommandEvent(command.id, "command.started", {
|
|
427
|
-
commandType: command.type,
|
|
428
|
-
startedAt: now(),
|
|
429
|
-
}, logger);
|
|
430
|
-
|
|
431
|
-
try {
|
|
432
|
-
switch (command.type) {
|
|
433
|
-
case "agent.message.send": {
|
|
434
|
-
const result = await executeAgentMessage(command);
|
|
435
|
-
await emitCommandEvent(command.id, "agent.message.completed", result, logger);
|
|
436
|
-
await completeCommand(command.id, result, logger);
|
|
437
|
-
break;
|
|
438
|
-
}
|
|
439
|
-
default:
|
|
440
|
-
throw new Error(`unsupported command type: ${command.type}`);
|
|
441
|
-
}
|
|
442
|
-
} catch (err) {
|
|
443
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
444
|
-
await emitCommandEvent(command.id, "command.failed", {
|
|
445
|
-
error: message,
|
|
446
|
-
failedAt: now(),
|
|
447
|
-
}, logger);
|
|
448
|
-
await failCommand(command.id, message, logger);
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
function handleModelUsage(evt: Extract<DiagnosticEventPayload, { type: "model.usage" }>) {
|
|
453
|
-
const agentId = sessionKeyToAgentId(evt.sessionKey);
|
|
454
|
-
const totalTokens = evt.usage.total ?? (evt.usage.input ?? 0) + (evt.usage.output ?? 0);
|
|
455
|
-
|
|
456
|
-
const event = {
|
|
457
|
-
event_id: nextId("mc-bridge"),
|
|
458
|
-
event_type: "agent.session.completed",
|
|
459
|
-
event_version: "1.0",
|
|
460
|
-
source_system: "openclaw",
|
|
461
|
-
source_node: SOURCE_NODE,
|
|
462
|
-
occurred_at: now(),
|
|
463
|
-
actor_id: agentId,
|
|
464
|
-
actor_type: "agent",
|
|
465
|
-
correlation_id: evt.sessionId ?? null,
|
|
466
|
-
payload: {
|
|
467
|
-
session_id: evt.sessionId ?? evt.sessionKey ?? nextId("sess"),
|
|
468
|
-
agent_id: agentId,
|
|
469
|
-
...(TEAM_ID ? { teamId: TEAM_ID } : {}),
|
|
470
|
-
model: evt.model ?? "unknown",
|
|
471
|
-
channel: evt.channel ?? "unknown",
|
|
472
|
-
total_tokens: totalTokens,
|
|
473
|
-
input_tokens: evt.usage.input ?? 0,
|
|
474
|
-
output_tokens: evt.usage.output ?? 0,
|
|
475
|
-
cache_read_tokens: evt.usage.cacheRead ?? 0,
|
|
476
|
-
cache_write_tokens: evt.usage.cacheWrite ?? 0,
|
|
477
|
-
cost_usd: evt.costUsd ?? 0,
|
|
478
|
-
duration_ms: evt.durationMs ?? 0,
|
|
479
|
-
context_limit: evt.context?.limit ?? 0,
|
|
480
|
-
context_used: evt.context?.used ?? 0,
|
|
481
|
-
status: "completed",
|
|
482
|
-
},
|
|
483
|
-
};
|
|
484
|
-
|
|
485
|
-
void postToIngest([event]);
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
function handleMessageProcessed(evt: Extract<DiagnosticEventPayload, { type: "message.processed" }>) {
|
|
489
|
-
if (!evt.sessionKey && !evt.sessionId) return;
|
|
490
|
-
const agentId = sessionKeyToAgentId(evt.sessionKey);
|
|
491
|
-
const eventType =
|
|
492
|
-
evt.outcome === "completed"
|
|
493
|
-
? "agent.session.completed"
|
|
494
|
-
: evt.outcome === "error"
|
|
495
|
-
? "agent.session.completed"
|
|
496
|
-
: null;
|
|
497
|
-
|
|
498
|
-
if (!eventType) return;
|
|
499
|
-
|
|
500
|
-
const event = {
|
|
501
|
-
event_id: nextId("mc-bridge"),
|
|
502
|
-
event_type: eventType,
|
|
503
|
-
event_version: "1.0",
|
|
504
|
-
source_system: "openclaw",
|
|
505
|
-
source_node: SOURCE_NODE,
|
|
506
|
-
occurred_at: now(),
|
|
507
|
-
actor_id: agentId,
|
|
508
|
-
actor_type: "agent",
|
|
509
|
-
correlation_id: evt.sessionId ?? null,
|
|
510
|
-
payload: {
|
|
511
|
-
session_id: evt.sessionId ?? evt.sessionKey ?? nextId("sess"),
|
|
512
|
-
agent_id: agentId,
|
|
513
|
-
...(TEAM_ID ? { teamId: TEAM_ID } : {}),
|
|
514
|
-
channel: evt.channel ?? "unknown",
|
|
515
|
-
status: evt.outcome === "error" ? "failed" : "completed",
|
|
516
|
-
duration_ms: evt.durationMs ?? 0,
|
|
517
|
-
...(evt.error ? { error: evt.error } : {}),
|
|
518
|
-
},
|
|
519
|
-
};
|
|
520
|
-
|
|
521
|
-
void postToIngest([event]);
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
function handleSessionState(evt: Extract<DiagnosticEventPayload, { type: "session.state" }>) {
|
|
525
|
-
if (!evt.sessionKey && !evt.sessionId) return;
|
|
526
|
-
const agentId = sessionKeyToAgentId(evt.sessionKey);
|
|
527
|
-
const stateToEventType: Record<string, string> = {
|
|
528
|
-
processing: "agent.session.started",
|
|
529
|
-
idle: "agent.session.completed",
|
|
530
|
-
};
|
|
531
|
-
const eventType = stateToEventType[evt.state];
|
|
532
|
-
if (!eventType) return;
|
|
533
|
-
|
|
534
|
-
const event = {
|
|
535
|
-
event_id: nextId("mc-bridge"),
|
|
536
|
-
event_type: eventType,
|
|
537
|
-
event_version: "1.0",
|
|
538
|
-
source_system: "openclaw",
|
|
539
|
-
source_node: SOURCE_NODE,
|
|
540
|
-
occurred_at: now(),
|
|
541
|
-
actor_id: agentId,
|
|
542
|
-
actor_type: "agent",
|
|
543
|
-
correlation_id: evt.sessionId ?? null,
|
|
544
|
-
payload: {
|
|
545
|
-
session_id: evt.sessionId ?? evt.sessionKey ?? nextId("sess"),
|
|
546
|
-
agent_id: agentId,
|
|
547
|
-
...(TEAM_ID ? { teamId: TEAM_ID } : {}),
|
|
548
|
-
state: evt.state,
|
|
549
|
-
prev_state: evt.prevState ?? null,
|
|
550
|
-
},
|
|
551
|
-
};
|
|
552
|
-
|
|
553
|
-
void postToIngest([event]);
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
const plugin = {
|
|
557
|
-
id: "mission-control-bridge",
|
|
558
|
-
name: "Mission Control Bridge",
|
|
559
|
-
description: "Forwards OpenClaw diagnostic events to A.L.I.C.E. Mission Control and executes hosted runtime commands",
|
|
560
|
-
configSchema: emptyPluginConfigSchema(),
|
|
561
|
-
|
|
562
|
-
register(api: OpenClawPluginApi) {
|
|
563
|
-
api.registerService({
|
|
564
|
-
id: "mission-control-bridge",
|
|
565
|
-
|
|
566
|
-
async start(ctx) {
|
|
567
|
-
ctx.logger.info(`[mc-bridge] starting — ingest URL: ${INGEST_URL}`);
|
|
568
|
-
ctx.logger.info(`[mc-bridge] runtime worker — commands URL: ${COMMANDS_URL}`);
|
|
569
|
-
|
|
570
|
-
let pollInFlight = false;
|
|
571
|
-
let stopped = false;
|
|
572
|
-
|
|
573
|
-
const unsubscribe = onDiagnosticEvent((evt: DiagnosticEventPayload) => {
|
|
574
|
-
try {
|
|
575
|
-
switch (evt.type) {
|
|
576
|
-
case "model.usage":
|
|
577
|
-
handleModelUsage(evt);
|
|
578
|
-
break;
|
|
579
|
-
case "message.processed":
|
|
580
|
-
handleMessageProcessed(evt);
|
|
581
|
-
break;
|
|
582
|
-
case "session.state":
|
|
583
|
-
handleSessionState(evt);
|
|
584
|
-
break;
|
|
585
|
-
}
|
|
586
|
-
} catch (err) {
|
|
587
|
-
ctx.logger.warn(`[mc-bridge] event handler error (${evt.type}): ${String(err)}`);
|
|
588
|
-
}
|
|
589
|
-
});
|
|
590
|
-
|
|
591
|
-
const pollCommands = async () => {
|
|
592
|
-
if (stopped || pollInFlight || !WORKER_TOKEN) return;
|
|
593
|
-
pollInFlight = true;
|
|
594
|
-
try {
|
|
595
|
-
const commands = await listQueuedCommands(ctx.logger);
|
|
596
|
-
for (const command of commands) {
|
|
597
|
-
if (!(await leaseCommand(command.id, ctx.logger))) continue;
|
|
598
|
-
await executeCommand(command, ctx.logger);
|
|
599
|
-
}
|
|
600
|
-
} finally {
|
|
601
|
-
pollInFlight = false;
|
|
602
|
-
}
|
|
603
|
-
};
|
|
604
|
-
|
|
605
|
-
await registerNode(ctx.logger);
|
|
606
|
-
await heartbeatNode(ctx.logger);
|
|
607
|
-
await postToIngest([
|
|
608
|
-
{
|
|
609
|
-
event_id: nextId("mc-bridge"),
|
|
610
|
-
event_type: "node.registered",
|
|
611
|
-
event_version: "1.0",
|
|
612
|
-
source_system: "openclaw",
|
|
613
|
-
source_node: SOURCE_NODE,
|
|
614
|
-
occurred_at: now(),
|
|
615
|
-
payload: {
|
|
616
|
-
node_name: SOURCE_NODE,
|
|
617
|
-
node_id: NODE_ID,
|
|
618
|
-
...(TEAM_ID ? { teamId: TEAM_ID } : {}),
|
|
619
|
-
install_id: INSTALL_ID,
|
|
620
|
-
platform: process.platform,
|
|
621
|
-
node_version: process.version,
|
|
622
|
-
gateway_url: GATEWAY_URL,
|
|
623
|
-
},
|
|
624
|
-
},
|
|
625
|
-
]);
|
|
626
|
-
|
|
627
|
-
const heartbeatTimer = setInterval(() => {
|
|
628
|
-
void heartbeatNode(ctx.logger);
|
|
629
|
-
}, HEARTBEAT_INTERVAL_MS);
|
|
630
|
-
|
|
631
|
-
const pollTimer = setInterval(() => {
|
|
632
|
-
void pollCommands();
|
|
633
|
-
}, COMMAND_POLL_INTERVAL_MS);
|
|
634
|
-
|
|
635
|
-
await pollCommands();
|
|
636
|
-
|
|
637
|
-
(
|
|
638
|
-
this as {
|
|
639
|
-
_unsub?: () => void;
|
|
640
|
-
_heartbeatTimer?: ReturnType<typeof setInterval>;
|
|
641
|
-
_pollTimer?: ReturnType<typeof setInterval>;
|
|
642
|
-
_stop?: () => void;
|
|
643
|
-
}
|
|
644
|
-
)._unsub = unsubscribe;
|
|
645
|
-
(
|
|
646
|
-
this as {
|
|
647
|
-
_unsub?: () => void;
|
|
648
|
-
_heartbeatTimer?: ReturnType<typeof setInterval>;
|
|
649
|
-
_pollTimer?: ReturnType<typeof setInterval>;
|
|
650
|
-
_stop?: () => void;
|
|
651
|
-
}
|
|
652
|
-
)._heartbeatTimer = heartbeatTimer;
|
|
653
|
-
(
|
|
654
|
-
this as {
|
|
655
|
-
_unsub?: () => void;
|
|
656
|
-
_heartbeatTimer?: ReturnType<typeof setInterval>;
|
|
657
|
-
_pollTimer?: ReturnType<typeof setInterval>;
|
|
658
|
-
_stop?: () => void;
|
|
659
|
-
}
|
|
660
|
-
)._pollTimer = pollTimer;
|
|
661
|
-
(
|
|
662
|
-
this as {
|
|
663
|
-
_unsub?: () => void;
|
|
664
|
-
_heartbeatTimer?: ReturnType<typeof setInterval>;
|
|
665
|
-
_pollTimer?: ReturnType<typeof setInterval>;
|
|
666
|
-
_stop?: () => void;
|
|
667
|
-
}
|
|
668
|
-
)._stop = () => {
|
|
669
|
-
stopped = true;
|
|
670
|
-
clearInterval(heartbeatTimer);
|
|
671
|
-
clearInterval(pollTimer);
|
|
672
|
-
};
|
|
673
|
-
},
|
|
674
|
-
|
|
675
|
-
async stop() {
|
|
676
|
-
const self = this as {
|
|
677
|
-
_unsub?: () => void;
|
|
678
|
-
_heartbeatTimer?: ReturnType<typeof setInterval>;
|
|
679
|
-
_pollTimer?: ReturnType<typeof setInterval>;
|
|
680
|
-
_stop?: () => void;
|
|
681
|
-
};
|
|
682
|
-
self._unsub?.();
|
|
683
|
-
self._stop?.();
|
|
684
|
-
if (self._heartbeatTimer) clearInterval(self._heartbeatTimer);
|
|
685
|
-
if (self._pollTimer) clearInterval(self._pollTimer);
|
|
686
|
-
self._unsub = undefined;
|
|
687
|
-
self._heartbeatTimer = undefined;
|
|
688
|
-
self._pollTimer = undefined;
|
|
689
|
-
self._stop = undefined;
|
|
690
|
-
},
|
|
691
|
-
});
|
|
692
|
-
},
|
|
693
|
-
};
|
|
694
|
-
|
|
695
|
-
export default plugin;
|