Compare commits

...

6 Commits

Author SHA1 Message Date
0967bab53d rename: FAMILY_CONVENTIONS → HERMES_AGENT_CONVENTIONS
[小糯]
2026-04-23 18:41:18 +08:00
559913466a refactor(personality): CONVENTIONS 改从 cfg 读取,不再依赖本地文件
- loadConventions() 从 cfg get FAMILY_CONVENTIONS 读取(shared scope)
- 改一处即所有 agent 即时可用,无需 git pull + sync
- 移除 CONVENTIONS_PATH 文件依赖

[小糯]
2026-04-23 18:37:30 +08:00
c5559b134d feat(personality): switch 时自动更新 SOUL.md,append CONVENTIONS.md
切换人格时同时写 SOUL.md = personality prompt + ~/.hermes/CONVENTIONS.md。
清除人格时 SOUL.md 只保留 conventions 内容。
CONVENTIONS.md 由 skills repo sync.sh 维护,集中管理家族共识。

[小糯]
2026-04-23 18:29:38 +08:00
69d9c69358 fix: correct package name to @shazhou/hermes-harness — 小糯 2026-04-21 11:35:17 +08:00
96156cef27 chore: bump version to 0.1.1 — 小糯 2026-04-21 11:34:20 +08:00
5b2d33411e Merge pull request 'fix: auxiliary switch reads provider from cfg registry' (#3) from fix/models-review-feedback into main 2026-04-21 03:32:52 +00:00
2 changed files with 32 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "hermes-harness",
"version": "0.1.0",
"name": "@shazhou/hermes-harness",
"version": "0.1.1",
"description": "Hermes Agent CLI harness tools",
"type": "module",
"bin": {

View File

@ -3,7 +3,9 @@ import { homedir } from "os";
import { join } from "path";
import { parse, stringify } from "yaml";
const CONFIG_PATH = join(homedir(), ".hermes", "config.yaml");
const HERMES_HOME = process.env.HERMES_HOME || join(homedir(), ".hermes");
const CONFIG_PATH = join(HERMES_HOME, "config.yaml");
const SOUL_PATH = join(HERMES_HOME, "SOUL.md");
interface Config {
agent?: {
@ -51,6 +53,30 @@ function getPreview(value: string | PersonalityDict): string {
return value.description || (value.system_prompt || "").slice(0, 60) + "...";
}
// --- SOUL.md management ---
function loadConventions(): string {
try {
const { execSync } = require("child_process");
const result = execSync("cfg get HERMES_AGENT_CONVENTIONS", {
encoding: "utf-8",
timeout: 5000,
stdio: ["pipe", "pipe", "pipe"],
}).trim();
return result || "";
} catch {
return "";
}
}
function writeSoulMd(personalityPrompt: string) {
const conventions = loadConventions();
const parts = [personalityPrompt];
if (conventions) parts.push(conventions);
const content = parts.filter(Boolean).join("\n\n");
writeFileSync(SOUL_PATH, content + "\n", "utf-8");
}
// --- Actions ---
function list() {
@ -126,6 +152,7 @@ function switchLocal(name: string) {
if (!config.agent) config.agent = {};
config.agent.system_prompt = "";
saveConfig(config);
writeSoulMd("");
console.log("Personality cleared.");
return;
}
@ -140,7 +167,9 @@ function switchLocal(name: string) {
if (!config.agent) config.agent = {};
config.agent.system_prompt = prompt;
saveConfig(config);
writeSoulMd(prompt);
console.log(`Switched to: ${name}`);
console.log("SOUL.md updated.");
}
async function switchTelegram(name: string) {