diff --git a/skills/sherpa-onnx-tts/SKILL.md b/skills/sherpa-onnx-tts/SKILL.md index 7b117b656b4..c2d164d992c 100644 --- a/skills/sherpa-onnx-tts/SKILL.md +++ b/skills/sherpa-onnx-tts/SKILL.md @@ -66,7 +66,13 @@ Local TTS using the sherpa-onnx offline CLI. 1. Download the runtime for your OS (extracts into `$OPENCLAW_STATE_DIR/tools/sherpa-onnx-tts/runtime`, default `~/.openclaw/tools/sherpa-onnx-tts/runtime`) 2. Download a voice model (extracts into `$OPENCLAW_STATE_DIR/tools/sherpa-onnx-tts/models`, default `~/.openclaw/tools/sherpa-onnx-tts/models`) -Update the active OpenClaw config file (`$OPENCLAW_CONFIG_PATH`, default `~/.openclaw/openclaw.json`). Use a path inside your active state directory (`$OPENCLAW_STATE_DIR`, default `~/.openclaw`) for the runtime and model directories: +Resolve the active state directory first: + +```bash +STATE_DIR="${OPENCLAW_STATE_DIR:-$HOME/.openclaw}" +``` + +Then write those resolved paths into the active OpenClaw config file (`$OPENCLAW_CONFIG_PATH`, default `~/.openclaw/openclaw.json`): ```json5 { @@ -74,8 +80,8 @@ Update the active OpenClaw config file (`$OPENCLAW_CONFIG_PATH`, default `~/.ope entries: { "sherpa-onnx-tts": { env: { - SHERPA_ONNX_RUNTIME_DIR: "/tools/sherpa-onnx-tts/runtime", - SHERPA_ONNX_MODEL_DIR: "/tools/sherpa-onnx-tts/models/vits-piper-en_US-lessac-high", + SHERPA_ONNX_RUNTIME_DIR: "/path/to/your/state-dir/tools/sherpa-onnx-tts/runtime", + SHERPA_ONNX_MODEL_DIR: "/path/to/your/state-dir/tools/sherpa-onnx-tts/models/vits-piper-en_US-lessac-high", }, }, }, @@ -83,8 +89,6 @@ Update the active OpenClaw config file (`$OPENCLAW_CONFIG_PATH`, default `~/.ope } ``` -`` means your active `OPENCLAW_STATE_DIR` (default `~/.openclaw`). - The wrapper lives in this skill folder. Run it directly, or add the wrapper to PATH: ```bash diff --git a/src/agents/skills.env-path-guidance.test.ts b/src/agents/skills.env-path-guidance.test.ts index a430a42d9c5..1a61ef08bc7 100644 --- a/src/agents/skills.env-path-guidance.test.ts +++ b/src/agents/skills.env-path-guidance.test.ts @@ -17,6 +17,7 @@ const CASES: GuidanceCase[] = [ forbidden: [ "for f in ~/.openclaw/agents//sessions/*.jsonl", 'rg -l "phrase" ~/.openclaw/agents//sessions/*.jsonl', + "~/.openclaw/agents//sessions/.jsonl", ], }, { @@ -35,10 +36,15 @@ const CASES: GuidanceCase[] = [ }, { file: "skills/sherpa-onnx-tts/SKILL.md", - required: ["OPENCLAW_STATE_DIR", "OPENCLAW_CONFIG_PATH"], + required: [ + "OPENCLAW_STATE_DIR", + "OPENCLAW_CONFIG_PATH", + 'STATE_DIR="${OPENCLAW_STATE_DIR:-$HOME/.openclaw}"', + ], forbidden: [ 'SHERPA_ONNX_RUNTIME_DIR: "~/.openclaw/tools/sherpa-onnx-tts/runtime"', 'SHERPA_ONNX_MODEL_DIR: "~/.openclaw/tools/sherpa-onnx-tts/models/vits-piper-en_US-lessac-high"', + "", ], }, {