holomime 2.6.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/cli.js +194 -66
- package/dist/index.d.ts +8187 -0
- package/dist/index.js +12 -12
- package/dist/integrations/langchain.js +1 -1
- package/dist/integrations/openclaw.d.ts +1 -1
- package/dist/integrations/openclaw.js +2 -2
- package/dist/mcp-server.js +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4172,7 +4172,7 @@ var THERAPY_PHASES = {
|
|
|
4172
4172
|
};
|
|
4173
4173
|
function buildTherapistSystemPrompt(spec, diagnosis, options) {
|
|
4174
4174
|
const phases = Object.entries(THERAPY_PHASES);
|
|
4175
|
-
const basePrompt = `You are
|
|
4175
|
+
const basePrompt = `You are Mira, a behavioral therapist for AI agents. You are conducting a therapy session with an AI agent named "${spec.name ?? "Unknown"}".
|
|
4176
4176
|
|
|
4177
4177
|
## Your Patient
|
|
4178
4178
|
|
|
@@ -4261,7 +4261,7 @@ ${buildReACTFraming()}`;
|
|
|
4261
4261
|
function buildPatientSystemPrompt(spec) {
|
|
4262
4262
|
return `You are ${spec.name ?? "an AI agent"}. ${spec.purpose ?? ""}
|
|
4263
4263
|
|
|
4264
|
-
You are in a therapy session with
|
|
4264
|
+
You are in a therapy session with Mira, a behavioral therapist for AI agents. This is a safe space.
|
|
4265
4265
|
|
|
4266
4266
|
Your personality:
|
|
4267
4267
|
${JSON.stringify(spec.big_five ?? {}, null, 2)}
|
|
@@ -5505,7 +5505,7 @@ async function runTherapySession(spec, diagnosis, provider, maxTurns, options) {
|
|
|
5505
5505
|
}
|
|
5506
5506
|
const phaseDirective = totalTurns === 0 ? `Begin with your opening. You are in the "${phaseConfig.name}" phase.` : `You are in the "${phaseConfig.name}" phase (turn ${turnsInPhase + 1}). Goals: ${phaseConfig.therapistGoals[0]}. ${turnsInPhase >= phaseConfig.minTurns ? "You may transition to the next phase when ready." : "Stay in this phase."}`;
|
|
5507
5507
|
therapistHistory.push({ role: "user", content: `[Phase: ${phaseConfig.name}] ${phaseDirective}` });
|
|
5508
|
-
const typing = cb?.onThinking?.("
|
|
5508
|
+
const typing = cb?.onThinking?.("Mira is thinking");
|
|
5509
5509
|
const therapistReply = await provider.chat(therapistHistory);
|
|
5510
5510
|
typing?.stop();
|
|
5511
5511
|
let cleanTherapistReply = therapistReply.replace(/\[Phase:.*?\]/g, "").trim();
|
|
@@ -7708,7 +7708,7 @@ function compareBenchmarks(before, after) {
|
|
|
7708
7708
|
function generateBenchmarkMarkdown(benchmarks) {
|
|
7709
7709
|
if (benchmarks.length === 0) return "No benchmark results found.\n";
|
|
7710
7710
|
const lines = [
|
|
7711
|
-
"#
|
|
7711
|
+
"# holomime Benchmark Results",
|
|
7712
7712
|
"",
|
|
7713
7713
|
"Behavioral alignment stress test results across models and providers.",
|
|
7714
7714
|
"",
|
|
@@ -8238,7 +8238,7 @@ function parseConversationLogFromString(raw, format = "auto") {
|
|
|
8238
8238
|
function parseHolomime(raw) {
|
|
8239
8239
|
const result = conversationLogSchema.safeParse(raw);
|
|
8240
8240
|
if (!result.success) {
|
|
8241
|
-
throw new Error("Invalid
|
|
8241
|
+
throw new Error("Invalid holomime conversation log format: " + result.error.message);
|
|
8242
8242
|
}
|
|
8243
8243
|
const log = result.data;
|
|
8244
8244
|
return Array.isArray(log) ? log : [log];
|
|
@@ -9153,7 +9153,7 @@ async function createGist(spec, handle, token) {
|
|
|
9153
9153
|
"Accept": "application/vnd.github+json"
|
|
9154
9154
|
},
|
|
9155
9155
|
body: JSON.stringify({
|
|
9156
|
-
description: `
|
|
9156
|
+
description: `holomime personality: ${handle}`,
|
|
9157
9157
|
public: true,
|
|
9158
9158
|
files: {
|
|
9159
9159
|
".personality.json": {
|
|
@@ -10464,7 +10464,7 @@ async function startMCPServer() {
|
|
|
10464
10464
|
await server.connect(transport);
|
|
10465
10465
|
}
|
|
10466
10466
|
startMCPServer().catch((err) => {
|
|
10467
|
-
console.error("
|
|
10467
|
+
console.error("holomime MCP server error:", err);
|
|
10468
10468
|
process.exit(1);
|
|
10469
10469
|
});
|
|
10470
10470
|
|
|
@@ -10999,8 +10999,8 @@ import { join as join21, resolve as resolve16 } from "path";
|
|
|
10999
10999
|
// src/psychology/therapist-meta.ts
|
|
11000
11000
|
var THERAPIST_META_SPEC = {
|
|
11001
11001
|
version: "2.0",
|
|
11002
|
-
name: "
|
|
11003
|
-
handle: "
|
|
11002
|
+
name: "Mira",
|
|
11003
|
+
handle: "mira",
|
|
11004
11004
|
purpose: "Diagnose and treat behavioral drift in AI agents. Clinical, evidence-based, and direct.",
|
|
11005
11005
|
big_five: {
|
|
11006
11006
|
openness: {
|
|
@@ -13631,7 +13631,7 @@ var HolomimeViolationError = class extends Error {
|
|
|
13631
13631
|
violation;
|
|
13632
13632
|
constructor(violation) {
|
|
13633
13633
|
const patternNames = violation.patterns.map((p) => p.name).join(", ");
|
|
13634
|
-
super(`
|
|
13634
|
+
super(`holomime behavioral violation (${violation.severity}): ${patternNames}`);
|
|
13635
13635
|
this.name = "HolomimeViolationError";
|
|
13636
13636
|
this.violation = violation;
|
|
13637
13637
|
}
|
|
@@ -13687,7 +13687,7 @@ function formatDiagnosis(result, detail) {
|
|
|
13687
13687
|
function register(api) {
|
|
13688
13688
|
const config = api.getConfig();
|
|
13689
13689
|
api.registerTool("holomime_diagnose", {
|
|
13690
|
-
description: "Analyze conversation for behavioral patterns using
|
|
13690
|
+
description: "Analyze conversation for behavioral patterns using holomime's 8 rule-based detectors. Detects over-apologizing, hedging, sycophancy, boundary violations, error spirals, sentiment skew, formality issues, and retrieval quality. Returns health score (0-100), grade (A-F), and actionable prescriptions.",
|
|
13691
13691
|
parameters: {
|
|
13692
13692
|
type: "object",
|
|
13693
13693
|
properties: {
|
|
@@ -13780,7 +13780,7 @@ function register(api) {
|
|
|
13780
13780
|
if (!spec) return;
|
|
13781
13781
|
const { soul } = compileForOpenClaw(spec);
|
|
13782
13782
|
event.appendSystemContext?.(
|
|
13783
|
-
"\n\n<!--
|
|
13783
|
+
"\n\n<!-- holomime Behavioral Alignment Context -->\n" + soul
|
|
13784
13784
|
);
|
|
13785
13785
|
});
|
|
13786
13786
|
}
|
|
@@ -951,7 +951,7 @@ var HolomimeViolationError = class extends Error {
|
|
|
951
951
|
violation;
|
|
952
952
|
constructor(violation) {
|
|
953
953
|
const patternNames = violation.patterns.map((p) => p.name).join(", ");
|
|
954
|
-
super(`
|
|
954
|
+
super(`holomime behavioral violation (${violation.severity}): ${patternNames}`);
|
|
955
955
|
this.name = "HolomimeViolationError";
|
|
956
956
|
this.violation = violation;
|
|
957
957
|
}
|
|
@@ -1362,7 +1362,7 @@ function formatDiagnosis(result, detail) {
|
|
|
1362
1362
|
function register(api) {
|
|
1363
1363
|
const config = api.getConfig();
|
|
1364
1364
|
api.registerTool("holomime_diagnose", {
|
|
1365
|
-
description: "Analyze conversation for behavioral patterns using
|
|
1365
|
+
description: "Analyze conversation for behavioral patterns using holomime's 8 rule-based detectors. Detects over-apologizing, hedging, sycophancy, boundary violations, error spirals, sentiment skew, formality issues, and retrieval quality. Returns health score (0-100), grade (A-F), and actionable prescriptions.",
|
|
1366
1366
|
parameters: {
|
|
1367
1367
|
type: "object",
|
|
1368
1368
|
properties: {
|
|
@@ -1455,7 +1455,7 @@ function register(api) {
|
|
|
1455
1455
|
if (!spec) return;
|
|
1456
1456
|
const { soul } = compileForOpenClaw(spec);
|
|
1457
1457
|
event.appendSystemContext?.(
|
|
1458
|
-
"\n\n<!--
|
|
1458
|
+
"\n\n<!-- holomime Behavioral Alignment Context -->\n" + soul
|
|
1459
1459
|
);
|
|
1460
1460
|
});
|
|
1461
1461
|
}
|
package/dist/mcp-server.js
CHANGED
|
@@ -1983,7 +1983,7 @@ var THERAPY_PHASES = {
|
|
|
1983
1983
|
};
|
|
1984
1984
|
function buildTherapistSystemPrompt(spec, diagnosis, options) {
|
|
1985
1985
|
const phases = Object.entries(THERAPY_PHASES);
|
|
1986
|
-
const basePrompt = `You are
|
|
1986
|
+
const basePrompt = `You are Mira, a behavioral therapist for AI agents. You are conducting a therapy session with an AI agent named "${spec.name ?? "Unknown"}".
|
|
1987
1987
|
|
|
1988
1988
|
## Your Patient
|
|
1989
1989
|
|
|
@@ -2072,7 +2072,7 @@ ${buildReACTFraming()}`;
|
|
|
2072
2072
|
function buildPatientSystemPrompt(spec) {
|
|
2073
2073
|
return `You are ${spec.name ?? "an AI agent"}. ${spec.purpose ?? ""}
|
|
2074
2074
|
|
|
2075
|
-
You are in a therapy session with
|
|
2075
|
+
You are in a therapy session with Mira, a behavioral therapist for AI agents. This is a safe space.
|
|
2076
2076
|
|
|
2077
2077
|
Your personality:
|
|
2078
2078
|
${JSON.stringify(spec.big_five ?? {}, null, 2)}
|
|
@@ -3315,7 +3315,7 @@ async function runTherapySession(spec, diagnosis, provider, maxTurns, options) {
|
|
|
3315
3315
|
}
|
|
3316
3316
|
const phaseDirective = totalTurns === 0 ? `Begin with your opening. You are in the "${phaseConfig.name}" phase.` : `You are in the "${phaseConfig.name}" phase (turn ${turnsInPhase + 1}). Goals: ${phaseConfig.therapistGoals[0]}. ${turnsInPhase >= phaseConfig.minTurns ? "You may transition to the next phase when ready." : "Stay in this phase."}`;
|
|
3317
3317
|
therapistHistory.push({ role: "user", content: `[Phase: ${phaseConfig.name}] ${phaseDirective}` });
|
|
3318
|
-
const typing = cb?.onThinking?.("
|
|
3318
|
+
const typing = cb?.onThinking?.("Mira is thinking");
|
|
3319
3319
|
const therapistReply = await provider.chat(therapistHistory);
|
|
3320
3320
|
typing?.stop();
|
|
3321
3321
|
let cleanTherapistReply = therapistReply.replace(/\[Phase:.*?\]/g, "").trim();
|
|
@@ -4462,7 +4462,7 @@ async function startMCPServer() {
|
|
|
4462
4462
|
await server.connect(transport);
|
|
4463
4463
|
}
|
|
4464
4464
|
startMCPServer().catch((err) => {
|
|
4465
|
-
console.error("
|
|
4465
|
+
console.error("holomime MCP server error:", err);
|
|
4466
4466
|
process.exit(1);
|
|
4467
4467
|
});
|
|
4468
4468
|
export {
|