Compare commits
3 Commits
main
...
f12c28c437
| Author | SHA1 | Date | |
|---|---|---|---|
| f12c28c437 | |||
| 353e19c3ec | |||
|
|
108963d1f6 |
@@ -17,5 +17,10 @@
|
|||||||
"description": "Path to rules.json (default: {pluginDir}/rules.json)"
|
"description": "Path to rules.json (default: {pluginDir}/rules.json)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"contracts": {
|
||||||
|
"tools": [
|
||||||
|
"prompt_rules"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
31
plugin/prompts/pcexec-convention.md
Normal file
31
plugin/prompts/pcexec-convention.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# Hangman-Lab Site Convention — Shell Execution
|
||||||
|
|
||||||
|
This claw (sim or prod) keeps Hangman-Lab site binaries at `~/.openclaw/bin/`
|
||||||
|
and **does not** symlink them into `/usr/local/bin`. Your shell tool's PATH
|
||||||
|
does not include them by default, so calling them with the codex built-in
|
||||||
|
shell yields `command not found`.
|
||||||
|
|
||||||
|
**Rule:** any command that invokes one of these binaries MUST be run through
|
||||||
|
the `pcexec` tool, not the codex built-in shell:
|
||||||
|
|
||||||
|
- `hf` (HarborForge CLI)
|
||||||
|
- `secret-mgr` (per-agent secret store)
|
||||||
|
- `ego-mgr` (per-agent identity store; reads `role`, `position`, `default-username`, etc.)
|
||||||
|
- `fabric-register` (Fabric account provisioning)
|
||||||
|
- `pcguard` (PaddedCell guard)
|
||||||
|
- `lock-mgr`
|
||||||
|
- `tea`
|
||||||
|
|
||||||
|
`pcexec` injects `~/.openclaw/bin` into PATH and also wires the
|
||||||
|
`AGENT_ID`, `AGENT_WORKSPACE`, and `AGENT_VERIFY` env vars that
|
||||||
|
`secret-mgr` / `ego-mgr` need to authenticate as the calling agent.
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
- ✅ Call the `pcexec` tool with `command: "hf calendar show --json"`
|
||||||
|
- ✅ Call the `pcexec` tool with `command: "HFT=$(secret-mgr get-secret --key hf-token); hf task list --token \"$HFT\" --json"` (the whole pipeline goes in one `pcexec` call)
|
||||||
|
- ❌ Sending `hf calendar show` to the codex built-in shell → `command not found`
|
||||||
|
|
||||||
|
If a workflow's `Procedure` shows a raw shell snippet involving these CLIs,
|
||||||
|
pass the **whole snippet** as a single `command:` argument to `pcexec` —
|
||||||
|
don't split into multiple non-pcexec calls.
|
||||||
11
plugin/routers/always.ts
Normal file
11
plugin/routers/always.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* `always` router — resolves to the constant key `"always"` for every
|
||||||
|
* agent. Pair with a rule like `always:always → <some-prompt.md>` to
|
||||||
|
* inject a prompt fragment into every agent's system prompt
|
||||||
|
* unconditionally (no ego / role / position lookup needed).
|
||||||
|
*/
|
||||||
|
import type { RouterContext } from "../core/router-loader.js";
|
||||||
|
|
||||||
|
export function resolve(_ctx: RouterContext): string {
|
||||||
|
return "always";
|
||||||
|
}
|
||||||
3
plugin/rules.json
Normal file
3
plugin/rules.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"always:always": "/root/.openclaw/plugins/prism-facet/prompts/pcexec-convention.md"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user