openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Integrate skills.md

Open Al629176 opened this issue 7 months ago • 1 comments

Summary

Add first-class SKILL.md runtime support in the Rust core by resolving a usable Node.js runtime at startup: prefer an existing system Node.js installation when it meets our version requirements, otherwise download and cache an OS/arch-specific Node.js distribution managed by the sidecar. Expose tools for agents to run Node.js code and npm/npx commands, and validate the flow against a real external skill.

Problem

Today, SKILL.md integration is underspecified for skills that assume a Node.js toolchain. That blocks a growing class of skills that expect to:

  • execute JavaScript/Node.js code
  • install dependencies
  • run npm, npx, and related package-manager workflows
  • bootstrap skill packages such as npx skills add ...

The missing piece should live in the Rust core / sidecar, not in Tauri. The desktop shell should remain a thin host while the core owns runtime resolution, environment setup, policy, logging, and diagnostics.

Solution

Implement end-to-end SKILL.md support around a Rust-core-managed Node.js runtime resolver.

Scope:

  • Add a Node.js runtime resolver to the Rust core process.
  • Prefer a system-installed node when present and compatible with our supported semver range.
  • If node is missing or incompatible, download and cache a platform-specific Node.js distribution for the current OS/arch.
  • Expose an agent tool for executing Node.js code.
  • Expose an agent tool for executing npm-compatible shell commands.
  • Ensure spawned shell commands inherit a PATH that includes the resolved Node.js environment so skills can self-install dependencies and run commands such as npm install, npm exec, and npx skills add ....
  • Add integrity checks and verbose diagnostics around runtime detection, version validation, download source selection, checksum verification, extraction, cache hits/misses, PATH injection, command execution, exit codes, stdout/stderr capture, install steps, and failure modes.
  • Validate the full flow with a real external skill, for example:
    • https://www.moltbook.com/skill.md
    • https://solana.com/skills

Important design note:

  • rusty_v8 is only a Rust binding to the V8 engine. It is not, by itself, a Node.js runtime or npm distribution.
  • The acceptance target is real Node.js-compatible execution plus npm/npx workflows, not just raw V8 script execution.
  • The preferred architecture is: use a compatible system Node.js when available; otherwise fetch a managed Node.js runtime per supported OS/arch and reuse it from a local cache.
  • The Rust core should own this resolver and expose the resulting environment to tools; Tauri should not manage Node.js lifecycle or package installation.

Acceptance criteria

  • [ ] Rust core can resolve a usable Node.js runtime without depending on the Tauri shell.
  • [ ] If a compatible system node is already installed, the core uses it without downloading another runtime.
  • [ ] If a compatible system node is not available, the core downloads and caches the correct Node.js distribution for the current OS/arch.
  • [ ] Downloaded runtimes are integrity-checked before use.
  • [ ] Agents have a tool to execute Node.js code from the core runtime.
  • [ ] Agents have a tool to execute npm/npx-style commands from the core runtime.
  • [ ] Command execution environment injects the resolved Node.js toolchain into PATH.
  • [ ] A skill can install or bootstrap its own JS dependencies using the provided environment.
  • [ ] End-to-end validation passes with at least one real external skill:
    • [ ] Moltbook skill, or
    • [ ] Solana skill flow using npx skills add ...
  • [ ] Logs are detailed enough to debug runtime resolution, downloads, cache behavior, package installation, command failures, and path-resolution issues.
  • [ ] Tests cover the core execution path and at least one integration/E2E flow for skill installation and execution.
  • [ ] Docs are updated for architecture, runtime expectations, and security constraints.

Related

  • Existing issue: #681
  • Candidate validation targets:
    • https://www.moltbook.com/skill.md
    • https://solana.com/skills

Al629176 avatar Apr 20 '26 06:04 Al629176

Status — acceptance map (2026-04-22)

Shipped so far across #723 (merged) and #740 (ready for review):

# Acceptance item Where it landed
1 Core-owned Node.js runtime resolver #723 — src/openhuman/node_runtime/
2 Prefer compatible system node #723 — resolver probes PATH first
3 Download + cache per OS/arch #723 — downloader.rs + extractor.rs
4 Integrity checks on downloads #723 — SHASUMS256-verified
5 node_exec agent tool #723 — src/openhuman/tools/impl/system/node_exec.rs
6 npm_exec agent tool #723 — src/openhuman/tools/impl/system/npm_exec.rs (disallow-list on publish/adduser/token)
7 PATH injection for spawned commands #723 — managed node bin prepended
— SKILL.md first-class parsing + multi-path discovery #723
— Browse / create / install-from-URL UI #740

Deferred into #781 so #681 can close without dragging on:

  • #8 — skill self-installs JS deps via npm install + npx skills add (skills.install_from_package)
  • #9 — Moltbook + Solana E2E validation
  • #10 — full verbose-diagnostics audit
  • #11 — integration / E2E tests for the install+execute round-trip
  • #12 — docs (architecture, runtime expectations, security)

The shipped surface covers the runtime + execution primitives that #681's "Solution" section calls out; the remaining items are validation + the package-install path. If this scope cut is acceptable, #681 can close once #740 merges and #781 takes over.

oxoxDev avatar Apr 22 '26 13:04 oxoxDev