Refactor x-integration skill architecture#129
Refactor x-integration skill architecture#129baijunjie wants to merge 1 commit intoqwibitai:mainfrom
Conversation
Why this Skill modifies source filesX blocks browsers running inside containers, so this skill has to run Playwright on the host machine using the user's real Chrome. The IPC layer is the only way to bridge container agents to host-side scripts. However, there's currently no plugin or hook mechanism in the MCP/IPC layer to register additional tools without modifying |
19677c0 to
be46541
Compare
|
Update: Extracted browser automation scripts (lib/ and scripts/) into a standalone package skill-x-social. The x-integration skill now only contains NanoClaw-specific integration code (templates/agent.ts and templates/host.ts), reducing the maintenance burden for developers. |
4e39cd0 to
9a7d583
Compare
|
Rebased and updated for the latest codebase. Integration points now reference the post-refactor files ( |
|
@gavrielc Skill-only PR — updates .claude/skills/x-integration/SKILL.md with cleaner npm-based approach. No source code changes. Reviewed and ready to merge. |
|
This test failure doesn’t seem to be related to my changes. |
e1b5170 to
a4a3825
Compare
|
Hey @baijunjie 👋 Thanks for working on refactoring the X integration skill — eliminating duplicated logic and fragile paths is exactly the right instinct! Unfortunately this PR has merge conflicts with the current codebase. The X skill from #52 (merged) has also been the foundation for further development. We plan to close this soon, but if you'd like to apply this refactor against the current |
a4a3825 to
b77cbb4
Compare
- Replace local lib/ and scripts/ with skill-x-social npm package; host.ts resolves scripts via createRequire from skill directory - Streamline implementation with shared libraries, reducing code duplication and minimizing installation footprint to 2 file changes - Update integration points for post-refactor codebase: container ipc-mcp.ts → ipc-mcp-stdio.ts, host index.ts → ipc.ts
b77cbb4 to
c1ddf77
Compare
|
I've rebased and updated this against the latest main branch. If you find this refactor useful, please merge it at your earliest convenience. |
…wibitai#129) Allows agent (host or sandbox) to control nanoclaw via IPC: - restart: delayed restart (2s to allow IPC cycle completion) - reload_config: reload nanoclaw.json in memory - set_config: change a config field and persist Security: - Only main group can issue control commands (isMain check) - Whitelist of actions (no arbitrary command execution) - Uses existing IPC file-based architecture Agent-side: nanoclaw_control MCP tool in ipc-mcp-stdio.ts Host-side: handleControlIpc in ipc.ts 2 files. 344/344 pass. Co-authored-by: Kenan VM Claw <vm-claw@kenan.dev>
Summary
Overhaul the x-integration skill architecture to eliminate duplicated logic and fragile path dependencies, while adding image posting and post verification.
Architecture refactoring
The old skill had a monolithic design —
agent.tsandhost.tslived directly in the skill directory and were imported via fragile paths. Each script manually located selectors, checked button states, and handled errors independently, resulting in a lot of duplicated code.This refactoring:
templates/directory —agent.tsandhost.tsare standalone files copied to their destinations (container/agent-runner/src/plugins/andsrc/plugins/) during installation, with no runtime dependency on the skill directorylib/utils.ts(validation, UI interaction, toggle actions, dialog submission, post verification),lib/script.ts(stdin/stdout IO framework),lib/env.ts(.env loader replacingdotenv-cli),lib/browser.ts(browser context management)config.selectors— UI changes only need updating in one placepackage.jsonwith isolated dependencies (playwright, pino), keeping the root project cleanx_post/x_liketox-integration_post/x-integration_likefor naming consistencyNew features
imagePaths, supporting up to 4 images per tweetDependency