Compare commits
No commits in common. "main" and "fix/models-review-feedback" have entirely different histories.
main
...
fix/models
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@shazhou/hermes-harness",
|
"name": "hermes-harness",
|
||||||
"version": "0.1.1",
|
"version": "0.1.0",
|
||||||
"description": "Hermes Agent CLI harness tools",
|
"description": "Hermes Agent CLI harness tools",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
@ -3,9 +3,7 @@ import { homedir } from "os";
|
|||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
import { parse, stringify } from "yaml";
|
import { parse, stringify } from "yaml";
|
||||||
|
|
||||||
const HERMES_HOME = process.env.HERMES_HOME || join(homedir(), ".hermes");
|
const CONFIG_PATH = join(homedir(), ".hermes", "config.yaml");
|
||||||
const CONFIG_PATH = join(HERMES_HOME, "config.yaml");
|
|
||||||
const SOUL_PATH = join(HERMES_HOME, "SOUL.md");
|
|
||||||
|
|
||||||
interface Config {
|
interface Config {
|
||||||
agent?: {
|
agent?: {
|
||||||
@ -53,30 +51,6 @@ function getPreview(value: string | PersonalityDict): string {
|
|||||||
return value.description || (value.system_prompt || "").slice(0, 60) + "...";
|
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 ---
|
// --- Actions ---
|
||||||
|
|
||||||
function list() {
|
function list() {
|
||||||
@ -152,7 +126,6 @@ function switchLocal(name: string) {
|
|||||||
if (!config.agent) config.agent = {};
|
if (!config.agent) config.agent = {};
|
||||||
config.agent.system_prompt = "";
|
config.agent.system_prompt = "";
|
||||||
saveConfig(config);
|
saveConfig(config);
|
||||||
writeSoulMd("");
|
|
||||||
console.log("Personality cleared.");
|
console.log("Personality cleared.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -167,9 +140,7 @@ function switchLocal(name: string) {
|
|||||||
if (!config.agent) config.agent = {};
|
if (!config.agent) config.agent = {};
|
||||||
config.agent.system_prompt = prompt;
|
config.agent.system_prompt = prompt;
|
||||||
saveConfig(config);
|
saveConfig(config);
|
||||||
writeSoulMd(prompt);
|
|
||||||
console.log(`Switched to: ${name}`);
|
console.log(`Switched to: ${name}`);
|
||||||
console.log("SOUL.md updated.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function switchTelegram(name: string) {
|
async function switchTelegram(name: string) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user