feat: openclaw-embedded plugin — aligned with official plugin guide#26
Open
feat: openclaw-embedded plugin — aligned with official plugin guide#26
Conversation
…leanup trap - Normalize --supersedes spacing via [[:space:]]*,[[:space:]]* so pre-spaced inputs like 'prof_a, prof_b' no longer produce '[prof_a, prof_b]' (double space). Split 'local' from assignment so subshell failures are not masked. - Add EXIT trap in write_profile and write_playbook to clean up the .tmp.$$ scratch file if the script aborts after tmp creation but before 'mv' (e.g. disk full, EINTR, failed rename). The trap is cleared after a successful mv so it does not fire on the subsequent successful exit. RETURN trap does not fire under 'set -e' when a command aborts the shell, so EXIT is used. - Add bats test that simulates 'mv' failure via a PATH-overridden stub and asserts no .tmp.* files remain after the failed run.
… README link and slug regex
…reflexio-write.sh
…ss in CLI wrappers
… injection in openclaw-cli.ts
…ite_playbook, reflexio_search tools
… plugin runtime loads .ts natively
…ng await/runner in CLI - Pass workspace from resolveAgentWorkspaceDir to writeProfile/writePlaybook tool handlers so writes target the correct agent workspace instead of / - Add WORKSPACE env fallback in deleteTarget resolution for both write-profile and write-playbook - Make standalone CLI async with proper await on all async function calls - Add CommandRunner implementation via child_process execSync for CLI context - Pass runner to all three CLI commands (writeProfile, writePlaybook, search) - Fix search() call to pass all 4 required args
…locks child_process in any .ts file
…tests — superseded by lib/io.ts + vitest
… not SDK's resolveAgentWorkspaceDir which needs agentId we don't have
…s linked, copies break node_modules symlinks
…ed tool calls in agents + docs
… guide alignment - Move plugin runtime + workspace resources into plugin/ subdirectory - Declare skills in openclaw.plugin.json manifest (auto-served from extension dir) - Use api.pluginConfig instead of reading config.json from disk - Use before_prompt_build hook (replaces deprecated before_agent_start for prompts) - Add extraSystemPrompt injection for sub-agents (no workspace/agents copy needed) - Add reflexio_run_consolidation tool to spawn consolidator from extension dir - Replace cron job with heartbeat-based consolidation check - Add compat/build sections to package.json for ClawHub publishing - Move dev files (tests, types, vitest config) outside plugin/ - Simplify install.sh and uninstall.sh (no manual workspace file copying)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New self-contained Reflexio integration plugin at
integrations/openclaw-embedded/. Delivers user profile and playbook capabilities entirely within Openclaw's native primitives (hooks, sub-agents, memory, heartbeat) with no Reflexio server dependency.The plugin follows the official Openclaw plugin building guide — skills declared in manifest, config via
api.pluginConfig, tools registered viaapi.registerTool(), and sub-agents injected viaextraSystemPrompt.Architecture
Registered Tools
reflexio_write_profilereflexio_write_playbookreflexio_searchreflexio_consolidation_checkreflexio_consolidation_mark_donereflexio_run_consolidationKey Design Decisions
"skills": ["./skills"]enables auto-discovery and auto-cleanup on uninstallopenclaw plugins uninstallcleans up completelyapi.pluginConfig— users override config viaopenclaw.json, not by editing plugin filesbefore_prompt_build— uses recommended hook (not deprecatedbefore_agent_start) for prompt injectionextraSystemPromptinjection — sub-agent definitions loaded from extension dir at runtime, noworkspace/agents/copyallowImportingTsExtensions—.tsimport extensions (not.js) since plugin ships as TypeScript withnoEmitapi.runtime.system.runCommandWithTimeoutinjected; tests use mock runnerTesting
Test Plan
npm test— 47 tests passbash scripts/install.sh— plugin installs, skills auto-availableopenclaw plugins uninstall reflexio-embedded— zero orphaned files