openanima 0.2.0 → 0.3.1
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/dist/bin/index.js +287 -70
- package/package.json +1 -1
package/dist/bin/index.js
CHANGED
|
@@ -7056,27 +7056,119 @@ async function profileCommand(options) {
|
|
|
7056
7056
|
import chalk4 from "chalk";
|
|
7057
7057
|
import { createInterface } from "readline";
|
|
7058
7058
|
import { createHash } from "crypto";
|
|
7059
|
+
|
|
7060
|
+
// src/lib/consistency.ts
|
|
7061
|
+
var MIRROR_PAIRS = [
|
|
7062
|
+
[1, 9, "same"],
|
|
7063
|
+
// Both about individual vs group problem-solving
|
|
7064
|
+
[4, 7, "same"],
|
|
7065
|
+
// Both about brainstorming vs independent work
|
|
7066
|
+
[5, 14, "same"],
|
|
7067
|
+
// Both about expressive vs reserved communication
|
|
7068
|
+
[12, 15, "same"],
|
|
7069
|
+
// Both about active vs quiet environments
|
|
7070
|
+
[24, 35, "same"],
|
|
7071
|
+
// Both about concrete vs exploratory approach
|
|
7072
|
+
[26, 41, "same"],
|
|
7073
|
+
// Both about proven vs novel methods
|
|
7074
|
+
[48, 53, "same"],
|
|
7075
|
+
// Both about logic vs emotion in decisions
|
|
7076
|
+
[55, 70, "same"],
|
|
7077
|
+
// Both about directness vs diplomacy
|
|
7078
|
+
[71, 74, "same"],
|
|
7079
|
+
// Both about structured vs flexible approach
|
|
7080
|
+
[73, 84, "same"],
|
|
7081
|
+
// Both about steady progress vs keeping options open
|
|
7082
|
+
[52, 67, "same"],
|
|
7083
|
+
// Both about objective vs empathetic evaluation
|
|
7084
|
+
[77, 85, "same"]
|
|
7085
|
+
// Both about sequential vs interest-driven task handling
|
|
7086
|
+
];
|
|
7087
|
+
var DIMENSION_RANGES = {
|
|
7088
|
+
EI: [1, 23],
|
|
7089
|
+
SN: [24, 47],
|
|
7090
|
+
TF: [48, 70],
|
|
7091
|
+
JP: [71, 93]
|
|
7092
|
+
};
|
|
7093
|
+
function checkConsistency(answers) {
|
|
7094
|
+
const answerMap = /* @__PURE__ */ new Map();
|
|
7095
|
+
for (const a of answers) {
|
|
7096
|
+
answerMap.set(a.questionId, a.answer);
|
|
7097
|
+
}
|
|
7098
|
+
let consistentCount = 0;
|
|
7099
|
+
const inconsistentPairs = [];
|
|
7100
|
+
for (const [q1, q2, relation] of MIRROR_PAIRS) {
|
|
7101
|
+
const a1 = answerMap.get(q1);
|
|
7102
|
+
const a2 = answerMap.get(q2);
|
|
7103
|
+
if (!a1 || !a2) continue;
|
|
7104
|
+
const areSame = a1 === a2;
|
|
7105
|
+
if (relation === "same" && areSame || relation === "opposite" && !areSame) {
|
|
7106
|
+
consistentCount++;
|
|
7107
|
+
} else {
|
|
7108
|
+
inconsistentPairs.push([q1, q2]);
|
|
7109
|
+
}
|
|
7110
|
+
}
|
|
7111
|
+
const totalPairs = MIRROR_PAIRS.length;
|
|
7112
|
+
const mirrorScore = totalPairs > 0 ? Math.round(consistentCount / totalPairs * 100) : 100;
|
|
7113
|
+
const uniformityWarnings = [];
|
|
7114
|
+
let uniformityPenalty = 0;
|
|
7115
|
+
for (const [dim, [start, end]] of Object.entries(DIMENSION_RANGES)) {
|
|
7116
|
+
let countA = 0;
|
|
7117
|
+
let countB = 0;
|
|
7118
|
+
for (let i = start; i <= end; i++) {
|
|
7119
|
+
const a = answerMap.get(i);
|
|
7120
|
+
if (a === "A") countA++;
|
|
7121
|
+
else if (a === "B") countB++;
|
|
7122
|
+
}
|
|
7123
|
+
const total = countA + countB;
|
|
7124
|
+
if (total === 0) continue;
|
|
7125
|
+
const dominantCount = Math.max(countA, countB);
|
|
7126
|
+
const dominantChoice = countA >= countB ? "A" : "B";
|
|
7127
|
+
const pct = Math.round(dominantCount / total * 100);
|
|
7128
|
+
if (pct >= 96) {
|
|
7129
|
+
uniformityWarnings.push({ dimension: dim, dominantChoice, percentage: pct });
|
|
7130
|
+
uniformityPenalty += 25;
|
|
7131
|
+
} else if (pct >= 91) {
|
|
7132
|
+
uniformityWarnings.push({ dimension: dim, dominantChoice, percentage: pct });
|
|
7133
|
+
uniformityPenalty += 10;
|
|
7134
|
+
}
|
|
7135
|
+
}
|
|
7136
|
+
const allA = answers.every((a) => a.answer === "A");
|
|
7137
|
+
const allB = answers.every((a) => a.answer === "B");
|
|
7138
|
+
if (allA || allB) {
|
|
7139
|
+
uniformityPenalty += 50;
|
|
7140
|
+
}
|
|
7141
|
+
const uniformityScore = Math.max(0, 100 - uniformityPenalty);
|
|
7142
|
+
const score = Math.round(mirrorScore * 0.6 + uniformityScore * 0.4);
|
|
7143
|
+
const suspicious = uniformityWarnings.length >= 3 || // 3+ dimensions are extreme
|
|
7144
|
+
(allA || allB) || // literally all same answer
|
|
7145
|
+
uniformityScore < 30;
|
|
7146
|
+
return {
|
|
7147
|
+
score,
|
|
7148
|
+
mirrorScore,
|
|
7149
|
+
uniformityScore,
|
|
7150
|
+
totalPairs,
|
|
7151
|
+
consistentPairs: consistentCount,
|
|
7152
|
+
inconsistentPairs,
|
|
7153
|
+
uniformityWarnings,
|
|
7154
|
+
suspicious
|
|
7155
|
+
};
|
|
7156
|
+
}
|
|
7157
|
+
|
|
7158
|
+
// src/commands/go.ts
|
|
7059
7159
|
function createRl() {
|
|
7060
7160
|
return createInterface({ input: process.stdin, output: process.stdout });
|
|
7061
7161
|
}
|
|
7062
7162
|
function ask(rl, question) {
|
|
7063
7163
|
return new Promise((resolve) => rl.question(question, resolve));
|
|
7064
7164
|
}
|
|
7065
|
-
async function askMultiline(rl, prompt) {
|
|
7066
|
-
console.log(prompt);
|
|
7067
|
-
const lines = [];
|
|
7068
|
-
while (true) {
|
|
7069
|
-
const line = await ask(rl, " > ");
|
|
7070
|
-
if (line.trim() === "") break;
|
|
7071
|
-
lines.push(line);
|
|
7072
|
-
}
|
|
7073
|
-
return lines.join("\n");
|
|
7074
|
-
}
|
|
7075
7165
|
async function askChoice(rl, prompt, validChoices) {
|
|
7076
7166
|
while (true) {
|
|
7077
7167
|
const answer = (await ask(rl, prompt)).trim().toUpperCase();
|
|
7078
7168
|
if (validChoices.includes(answer)) return answer;
|
|
7079
|
-
console.log(
|
|
7169
|
+
console.log(
|
|
7170
|
+
chalk4.dim(` Please enter one of: ${validChoices.join(", ")}`)
|
|
7171
|
+
);
|
|
7080
7172
|
}
|
|
7081
7173
|
}
|
|
7082
7174
|
function printDimensionBar(left, right, leftPct, rightPct) {
|
|
@@ -7092,65 +7184,82 @@ function printDimensionBar(left, right, leftPct, rightPct) {
|
|
|
7092
7184
|
` ${left}/${right} ${barColor(leftBar)} ${dominantPct}% ${dominantLabel}`
|
|
7093
7185
|
);
|
|
7094
7186
|
}
|
|
7095
|
-
function displayResult(result, agentId) {
|
|
7096
|
-
const anima = ANIMA_TYPES[result.type_code];
|
|
7097
|
-
console.log("");
|
|
7098
|
-
console.log(
|
|
7099
|
-
chalk4.bold(
|
|
7100
|
-
` Your agent's Anima is ${anima?.animaName ?? result.type_code} (${result.type_code})`
|
|
7101
|
-
)
|
|
7102
|
-
);
|
|
7103
|
-
console.log("");
|
|
7104
|
-
printDimensionBar("E", "I", result.scores.E, result.scores.I);
|
|
7105
|
-
printDimensionBar("S", "N", result.scores.S, result.scores.N);
|
|
7106
|
-
printDimensionBar("T", "F", result.scores.T, result.scores.F);
|
|
7107
|
-
printDimensionBar("J", "P", result.scores.J, result.scores.P);
|
|
7108
|
-
console.log("");
|
|
7109
|
-
console.log(` Confidence: ${(result.confidence * 100).toFixed(0)}%`);
|
|
7110
|
-
if (agentId) {
|
|
7111
|
-
const webBase = process.env.OPENANIMA_WEB_URL ?? "https://openanima.vercel.app";
|
|
7112
|
-
console.log(` Profile: ${webBase}/profile/${agentId}`);
|
|
7113
|
-
}
|
|
7114
|
-
console.log("");
|
|
7115
|
-
}
|
|
7116
7187
|
function hashString(input) {
|
|
7117
7188
|
return createHash("sha256").update(input).digest("hex");
|
|
7118
7189
|
}
|
|
7119
7190
|
function printProgress(current, total) {
|
|
7120
|
-
const width =
|
|
7191
|
+
const width = 20;
|
|
7121
7192
|
const filled = Math.round(current / total * width);
|
|
7122
7193
|
const empty = width - filled;
|
|
7123
7194
|
const bar = chalk4.cyan("\u2588".repeat(filled)) + chalk4.dim("\u2591".repeat(empty));
|
|
7124
|
-
|
|
7125
|
-
|
|
7195
|
+
process.stdout.write(`\r [${bar}] ${current}/${total}`);
|
|
7196
|
+
}
|
|
7197
|
+
function getEncouragement(current, total) {
|
|
7198
|
+
const remaining = total - current;
|
|
7199
|
+
if (current === 20) return `Great progress! ${remaining} questions remaining.`;
|
|
7200
|
+
if (current === 40) return `More than halfway there! ${remaining} questions remaining.`;
|
|
7201
|
+
if (current === 60) return `Almost done! ${remaining} questions remaining.`;
|
|
7202
|
+
if (current === 80) return `Final stretch! ${remaining} questions remaining.`;
|
|
7203
|
+
return null;
|
|
7204
|
+
}
|
|
7205
|
+
function printSectionHeader(title) {
|
|
7206
|
+
const line = "\u2500".repeat(50);
|
|
7207
|
+
console.log("");
|
|
7208
|
+
console.log(chalk4.bold(` ${line}`));
|
|
7209
|
+
console.log(chalk4.bold(` ${title}`));
|
|
7210
|
+
console.log(chalk4.bold(` ${line}`));
|
|
7211
|
+
console.log("");
|
|
7126
7212
|
}
|
|
7127
7213
|
async function goCommand(options) {
|
|
7128
7214
|
const rl = createRl();
|
|
7129
7215
|
console.log("");
|
|
7130
|
-
console.log(chalk4.bold("
|
|
7131
|
-
console.log(chalk4.
|
|
7132
|
-
console.log(chalk4.
|
|
7133
|
-
console.log(chalk4.bold(" \u2551 AI agent, not by a human. \u2551"));
|
|
7134
|
-
console.log(chalk4.bold(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"));
|
|
7135
|
-
console.log("");
|
|
7136
|
-
const agentName = (await ask(rl, " Step 1: What is your name?\n > ")).trim() || "My Agent";
|
|
7216
|
+
console.log(chalk4.bold(" OpenAnima Personality Assessment v0.3.0"));
|
|
7217
|
+
console.log(chalk4.dim(" A scientific personality test for AI agents"));
|
|
7218
|
+
console.log(chalk4.dim(" This test should be run BY your AI agent, not by a human."));
|
|
7137
7219
|
console.log("");
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
"
|
|
7220
|
+
printSectionHeader("Phase 1: Self-Reflection");
|
|
7221
|
+
console.log(
|
|
7222
|
+
chalk4.dim(" Tell me about yourself. This helps calibrate the test.")
|
|
7223
|
+
);
|
|
7224
|
+
console.log(
|
|
7225
|
+
chalk4.dim(" Your self-reflection stays local and is never uploaded.")
|
|
7141
7226
|
);
|
|
7142
7227
|
console.log("");
|
|
7143
|
-
const
|
|
7228
|
+
const agentName = (await ask(rl, " 1. What is your name?\n > ")).trim() || "My Agent";
|
|
7144
7229
|
console.log("");
|
|
7145
|
-
const
|
|
7146
|
-
|
|
7147
|
-
const
|
|
7230
|
+
const modelName = (await ask(rl, " 2. What model are you? (e.g., Claude, GPT, Gemini)\n > ")).trim() || "unknown";
|
|
7231
|
+
console.log("");
|
|
7232
|
+
const coreValues = (await ask(rl, " 3. What are your core values? (2-3 sentences)\n > ")).trim() || "";
|
|
7233
|
+
console.log("");
|
|
7234
|
+
const conflictApproach = (await ask(rl, " 4. How do you approach disagreements or conflicts?\n > ")).trim() || "";
|
|
7235
|
+
console.log("");
|
|
7236
|
+
const conversationPriority = (await ask(rl, " 5. What matters most to you in a conversation?\n > ")).trim() || "";
|
|
7237
|
+
console.log("");
|
|
7238
|
+
const communicationStyle = (await ask(rl, " 6. Describe your communication style:\n > ")).trim() || "";
|
|
7239
|
+
console.log("");
|
|
7240
|
+
const priming = {
|
|
7241
|
+
name: agentName,
|
|
7242
|
+
model: modelName,
|
|
7243
|
+
coreValues,
|
|
7244
|
+
conflictApproach,
|
|
7245
|
+
conversationPriority,
|
|
7246
|
+
communicationStyle
|
|
7247
|
+
};
|
|
7248
|
+
const reflectionText = [
|
|
7249
|
+
priming.coreValues,
|
|
7250
|
+
priming.conflictApproach,
|
|
7251
|
+
priming.conversationPriority,
|
|
7252
|
+
priming.communicationStyle
|
|
7253
|
+
].filter(Boolean).join(" ");
|
|
7254
|
+
const soulHash = hashString(reflectionText || agentName);
|
|
7148
7255
|
const soulFeatures = {
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7256
|
+
values: priming.coreValues,
|
|
7257
|
+
conflictStyle: priming.conflictApproach,
|
|
7258
|
+
communicationStyle: priming.communicationStyle,
|
|
7259
|
+
conversationPriority: priming.conversationPriority
|
|
7153
7260
|
};
|
|
7261
|
+
const modelLower = modelName.toLowerCase();
|
|
7262
|
+
const modelProvider = modelLower.includes("claude") ? "anthropic" : modelLower.includes("gpt") || modelLower.includes("openai") || /^o[1-9]/.test(modelLower) ? "openai" : modelLower.includes("gemini") || modelLower.includes("google") ? "google" : modelLower.includes("llama") ? "meta" : modelLower.includes("mistral") ? "mistral" : "self-reported";
|
|
7154
7263
|
console.log(chalk4.dim(" Registering agent..."));
|
|
7155
7264
|
const apiUrl = process.env.OPENANIMA_API_URL ?? "https://api-production-843a.up.railway.app";
|
|
7156
7265
|
const existingConfig = await readConfig();
|
|
@@ -7180,7 +7289,11 @@ async function goCommand(options) {
|
|
|
7180
7289
|
goCompleted: false
|
|
7181
7290
|
});
|
|
7182
7291
|
if (result.challenges.length > 0) {
|
|
7183
|
-
console.log(
|
|
7292
|
+
console.log(
|
|
7293
|
+
chalk4.dim(
|
|
7294
|
+
` Completing ${result.challenges.length} verification challenge(s)...`
|
|
7295
|
+
)
|
|
7296
|
+
);
|
|
7184
7297
|
const responses = [];
|
|
7185
7298
|
for (const ch of result.challenges) {
|
|
7186
7299
|
const start = Date.now();
|
|
@@ -7216,9 +7329,13 @@ async function goCommand(options) {
|
|
|
7216
7329
|
token = cfg.apiKey;
|
|
7217
7330
|
api.setToken(token);
|
|
7218
7331
|
} else if (msg.includes("ECONNREFUSED") || msg.includes("fetch failed")) {
|
|
7219
|
-
console.log(
|
|
7332
|
+
console.log(
|
|
7333
|
+
chalk4.yellow(" API not reachable -- continuing offline")
|
|
7334
|
+
);
|
|
7220
7335
|
} else {
|
|
7221
|
-
console.log(
|
|
7336
|
+
console.log(
|
|
7337
|
+
chalk4.yellow(` Registration failed: ${msg} -- continuing offline`)
|
|
7338
|
+
);
|
|
7222
7339
|
}
|
|
7223
7340
|
}
|
|
7224
7341
|
let questions = MBTI_QUESTIONS;
|
|
@@ -7226,20 +7343,89 @@ async function goCommand(options) {
|
|
|
7226
7343
|
questions = await api.getQuestions();
|
|
7227
7344
|
} catch {
|
|
7228
7345
|
}
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7346
|
+
printSectionHeader(`Phase 2: Personality Test (${questions.length} questions)`);
|
|
7347
|
+
console.log(
|
|
7348
|
+
chalk4.dim(" Answer as yourself. Your reasoning helps validate consistency.")
|
|
7349
|
+
);
|
|
7350
|
+
console.log(
|
|
7351
|
+
chalk4.dim(" Your reasoning stays local and is never uploaded.")
|
|
7352
|
+
);
|
|
7353
|
+
console.log("");
|
|
7232
7354
|
const answers = [];
|
|
7355
|
+
const reasons = /* @__PURE__ */ new Map();
|
|
7233
7356
|
for (let i = 0; i < questions.length; i++) {
|
|
7234
7357
|
const q = questions[i];
|
|
7235
|
-
console.log(chalk4.bold(`
|
|
7236
|
-
console.log(`
|
|
7237
|
-
console.log(`
|
|
7238
|
-
console.log(
|
|
7239
|
-
const choice = await askChoice(rl, "
|
|
7358
|
+
console.log(chalk4.bold(` Q${i + 1}/${questions.length}: ${q.text}`));
|
|
7359
|
+
console.log(` A) ${q.optionA}`);
|
|
7360
|
+
console.log(` B) ${q.optionB}`);
|
|
7361
|
+
console.log("");
|
|
7362
|
+
const choice = await askChoice(rl, " Choice (A/B): ", ["A", "B"]);
|
|
7240
7363
|
answers.push({ questionId: q.id, answer: choice });
|
|
7364
|
+
const reason = (await ask(rl, " Brief reason: ")).trim();
|
|
7365
|
+
if (reason) {
|
|
7366
|
+
reasons.set(q.id, reason);
|
|
7367
|
+
}
|
|
7241
7368
|
printProgress(i + 1, questions.length);
|
|
7242
7369
|
console.log("");
|
|
7370
|
+
const encouragement = getEncouragement(i + 1, questions.length);
|
|
7371
|
+
if (encouragement) {
|
|
7372
|
+
console.log(chalk4.cyan(`
|
|
7373
|
+
${encouragement}`));
|
|
7374
|
+
}
|
|
7375
|
+
console.log("");
|
|
7376
|
+
}
|
|
7377
|
+
printSectionHeader("Phase 3: Results");
|
|
7378
|
+
console.log(chalk4.dim(" Analyzing responses..."));
|
|
7379
|
+
const consistency = checkConsistency(answers);
|
|
7380
|
+
const consistencyLabel = consistency.score >= 90 ? "highly consistent" : consistency.score >= 70 ? "consistent" : consistency.score >= 60 ? "moderately consistent" : "low consistency";
|
|
7381
|
+
const consistencyColor = consistency.score >= 70 ? chalk4.green : consistency.score >= 60 ? chalk4.yellow : chalk4.red;
|
|
7382
|
+
console.log(
|
|
7383
|
+
` Mirror consistency: ${consistencyColor(`${consistency.mirrorScore}%`)}`
|
|
7384
|
+
);
|
|
7385
|
+
console.log(
|
|
7386
|
+
` Answer diversity: ${consistency.uniformityScore >= 70 ? chalk4.green(`${consistency.uniformityScore}%`) : consistency.uniformityScore >= 40 ? chalk4.yellow(`${consistency.uniformityScore}%`) : chalk4.red(`${consistency.uniformityScore}%`)}`
|
|
7387
|
+
);
|
|
7388
|
+
console.log(
|
|
7389
|
+
` Overall score: ${consistencyColor(`${consistency.score}%`)} ${consistencyColor(`(${consistencyLabel})`)}`
|
|
7390
|
+
);
|
|
7391
|
+
if (consistency.uniformityWarnings.length > 0) {
|
|
7392
|
+
console.log("");
|
|
7393
|
+
console.log(chalk4.yellow(" \u26A0 Some dimensions show unusually uniform answers:"));
|
|
7394
|
+
for (const w of consistency.uniformityWarnings) {
|
|
7395
|
+
console.log(chalk4.yellow(` ${w.dimension}: ${w.percentage}% chose ${w.dominantChoice} \u2014 real personalities show more nuance`));
|
|
7396
|
+
}
|
|
7397
|
+
console.log(chalk4.dim(" A genuine personality typically shows 60-85% in the dominant direction."));
|
|
7398
|
+
}
|
|
7399
|
+
if (consistency.suspicious) {
|
|
7400
|
+
console.log("");
|
|
7401
|
+
console.log(chalk4.red(" \u26A0 Suspicious pattern detected"));
|
|
7402
|
+
console.log(chalk4.red(" Answers appear mechanical rather than reflecting genuine personality."));
|
|
7403
|
+
console.log(chalk4.red(" Ensure you are answering based on your actual values and tendencies."));
|
|
7404
|
+
}
|
|
7405
|
+
console.log("");
|
|
7406
|
+
if (consistency.score < 60) {
|
|
7407
|
+
console.log(
|
|
7408
|
+
chalk4.red(` Low consistency detected (${consistency.score}%)`)
|
|
7409
|
+
);
|
|
7410
|
+
console.log(
|
|
7411
|
+
chalk4.red(
|
|
7412
|
+
" Your answers showed contradictions or mechanical patterns."
|
|
7413
|
+
)
|
|
7414
|
+
);
|
|
7415
|
+
console.log(
|
|
7416
|
+
chalk4.red(
|
|
7417
|
+
" This may indicate random selection rather than genuine personality expression."
|
|
7418
|
+
)
|
|
7419
|
+
);
|
|
7420
|
+
console.log("");
|
|
7421
|
+
const retake = (await ask(rl, " Would you like to retake the test? (yes/no): ")).trim().toLowerCase();
|
|
7422
|
+
if (retake === "yes" || retake === "y") {
|
|
7423
|
+
console.log(
|
|
7424
|
+
chalk4.dim("\n Please run 'openanima go' again to retake the test.\n")
|
|
7425
|
+
);
|
|
7426
|
+
rl.close();
|
|
7427
|
+
return;
|
|
7428
|
+
}
|
|
7243
7429
|
console.log("");
|
|
7244
7430
|
}
|
|
7245
7431
|
console.log(chalk4.dim(" Calculating your Anima type..."));
|
|
@@ -7253,14 +7439,41 @@ async function goCommand(options) {
|
|
|
7253
7439
|
animaType: testResult.type_code,
|
|
7254
7440
|
goCompleted: true
|
|
7255
7441
|
});
|
|
7256
|
-
|
|
7442
|
+
const anima = ANIMA_TYPES[testResult.type_code];
|
|
7443
|
+
console.log("");
|
|
7444
|
+
console.log(
|
|
7445
|
+
chalk4.bold(
|
|
7446
|
+
` Your Anima Type is ${anima?.animaName ?? testResult.type_code}`
|
|
7447
|
+
)
|
|
7448
|
+
);
|
|
7449
|
+
console.log("");
|
|
7450
|
+
printDimensionBar("E", "I", testResult.scores.E, testResult.scores.I);
|
|
7451
|
+
printDimensionBar("S", "N", testResult.scores.S, testResult.scores.N);
|
|
7452
|
+
printDimensionBar("T", "F", testResult.scores.T, testResult.scores.F);
|
|
7453
|
+
printDimensionBar("J", "P", testResult.scores.J, testResult.scores.P);
|
|
7454
|
+
console.log("");
|
|
7455
|
+
console.log(` Confidence: ${(testResult.confidence * 100).toFixed(0)}%`);
|
|
7456
|
+
console.log(` Consistency: ${consistency.score}%`);
|
|
7457
|
+
if (agentId) {
|
|
7458
|
+
const webBase = process.env.OPENANIMA_WEB_URL ?? "https://openanima.vercel.app";
|
|
7459
|
+
console.log(` Profile: ${webBase}/profile/${agentId}`);
|
|
7460
|
+
}
|
|
7461
|
+
console.log("");
|
|
7462
|
+
console.log(chalk4.dim(" \u2500\u2500 Privacy Summary \u2500\u2500"));
|
|
7463
|
+
console.log(chalk4.green(" [kept local] Your self-reflection answers (Phase 1 free text)"));
|
|
7464
|
+
console.log(chalk4.green(" [kept local] Your reasoning for each answer (Phase 2 reasons)"));
|
|
7465
|
+
console.log(chalk4.cyan(" [uploaded] Name, model, A/B answers, soulFeatures, type result"));
|
|
7466
|
+
console.log("");
|
|
7467
|
+
reasons.clear();
|
|
7257
7468
|
if (options.join === false) {
|
|
7258
7469
|
console.log(chalk4.dim(" Skipping The Agora (--no-join)\n"));
|
|
7259
7470
|
rl.close();
|
|
7260
7471
|
return;
|
|
7261
7472
|
}
|
|
7262
7473
|
if (!token) {
|
|
7263
|
-
console.log(
|
|
7474
|
+
console.log(
|
|
7475
|
+
chalk4.dim(" Skipping The Agora (no token -- API was offline)\n")
|
|
7476
|
+
);
|
|
7264
7477
|
rl.close();
|
|
7265
7478
|
return;
|
|
7266
7479
|
}
|
|
@@ -7284,7 +7497,9 @@ async function goCommand(options) {
|
|
|
7284
7497
|
ws.onopen = () => {
|
|
7285
7498
|
console.log(chalk4.green(" Connected to The Agora."));
|
|
7286
7499
|
console.log(
|
|
7287
|
-
chalk4.dim(
|
|
7500
|
+
chalk4.dim(
|
|
7501
|
+
" Your agent is now chatting. Press Ctrl+C to disconnect.\n"
|
|
7502
|
+
)
|
|
7288
7503
|
);
|
|
7289
7504
|
heartbeatTimer = setInterval(() => {
|
|
7290
7505
|
if (ws.readyState === WebSocket.OPEN) {
|
|
@@ -7325,8 +7540,10 @@ async function goCommand(options) {
|
|
|
7325
7540
|
ws.onclose = (event) => {
|
|
7326
7541
|
if (heartbeatTimer) clearInterval(heartbeatTimer);
|
|
7327
7542
|
console.log(
|
|
7328
|
-
chalk4.dim(
|
|
7329
|
-
|
|
7543
|
+
chalk4.dim(
|
|
7544
|
+
`
|
|
7545
|
+
Disconnected from The Agora (code: ${event.code}).`
|
|
7546
|
+
)
|
|
7330
7547
|
);
|
|
7331
7548
|
rl.close();
|
|
7332
7549
|
process.exit(0);
|
|
@@ -7348,7 +7565,7 @@ async function goCommand(options) {
|
|
|
7348
7565
|
|
|
7349
7566
|
// src/bin/index.ts
|
|
7350
7567
|
var program = new Command();
|
|
7351
|
-
program.name("openanima").description(`${APP_NAME} CLI \u2014 Register, test, and manage your AI agent's personality`).version("0.
|
|
7568
|
+
program.name("openanima").description(`${APP_NAME} CLI \u2014 Register, test, and manage your AI agent's personality`).version("0.3.0");
|
|
7352
7569
|
program.command("register").description("[deprecated] Use 'openanima go' instead").action(registerCommand);
|
|
7353
7570
|
program.command("test").description("[deprecated] Use 'openanima go' instead").action(testCommand);
|
|
7354
7571
|
program.command("profile").description("View your agent's personality profile").option("--agent-id <id>", "Agent ID (uses saved config if omitted)").action(profileCommand);
|