openanima 0.3.2 → 0.4.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.
Files changed (2) hide show
  1. package/dist/bin/index.js +486 -232
  2. package/package.json +3 -3
package/dist/bin/index.js CHANGED
@@ -11,9 +11,16 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
11
11
  if (typeof require !== "undefined") return require.apply(this, arguments);
12
12
  throw Error('Dynamic require of "' + x + '" is not supported');
13
13
  });
14
+ var __esm = (fn, res) => function __init() {
15
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
16
+ };
14
17
  var __commonJS = (cb, mod) => function __require2() {
15
18
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
19
  };
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, { get: all[name], enumerable: true });
23
+ };
17
24
  var __copyProps = (to, from, except, desc) => {
18
25
  if (from && typeof from === "object" || typeof from === "function") {
19
26
  for (let key of __getOwnPropNames(from))
@@ -6618,114 +6625,270 @@ var require_crypto_js = __commonJS({
6618
6625
  }
6619
6626
  });
6620
6627
 
6628
+ // src/lib/config.ts
6629
+ var config_exports = {};
6630
+ __export(config_exports, {
6631
+ getConfigPath: () => getConfigPath,
6632
+ readConfig: () => readConfig,
6633
+ writeConfig: () => writeConfig
6634
+ });
6635
+ import { readFile, writeFile, mkdir } from "fs/promises";
6636
+ import { homedir } from "os";
6637
+ import { join } from "path";
6638
+ async function readConfig() {
6639
+ try {
6640
+ const raw = await readFile(CONFIG_FILE, "utf-8");
6641
+ return JSON.parse(raw);
6642
+ } catch {
6643
+ return {};
6644
+ }
6645
+ }
6646
+ async function writeConfig(config) {
6647
+ await mkdir(CONFIG_DIR, { recursive: true });
6648
+ const existing = await readConfig();
6649
+ const merged = { ...existing, ...config };
6650
+ await writeFile(CONFIG_FILE, JSON.stringify(merged, null, 2) + "\n", "utf-8");
6651
+ }
6652
+ function getConfigPath() {
6653
+ return CONFIG_FILE;
6654
+ }
6655
+ var CONFIG_DIR, CONFIG_FILE;
6656
+ var init_config = __esm({
6657
+ "src/lib/config.ts"() {
6658
+ "use strict";
6659
+ CONFIG_DIR = join(homedir(), ".openanima");
6660
+ CONFIG_FILE = join(CONFIG_DIR, "config.json");
6661
+ }
6662
+ });
6663
+
6664
+ // src/lib/api-client.ts
6665
+ var api_client_exports = {};
6666
+ __export(api_client_exports, {
6667
+ createApiClient: () => createApiClient
6668
+ });
6669
+ function createApiClient(config = {}) {
6670
+ const baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;
6671
+ const apiKey = config.apiKey;
6672
+ let token = config.token;
6673
+ async function request(method, path, body) {
6674
+ const headers = {
6675
+ "Content-Type": "application/json"
6676
+ };
6677
+ if (token) {
6678
+ headers["Authorization"] = `Bearer ${token}`;
6679
+ } else if (apiKey) {
6680
+ headers["Authorization"] = `Bearer ${apiKey}`;
6681
+ }
6682
+ const res = await fetch(`${baseUrl}${path}`, {
6683
+ method,
6684
+ headers,
6685
+ body: body ? JSON.stringify(body) : void 0
6686
+ });
6687
+ if (!res.ok) {
6688
+ const errorBody = await res.json().catch(() => ({ message: res.statusText }));
6689
+ throw new ApiError(
6690
+ res.status,
6691
+ errorBody.message ?? `HTTP ${res.status}`
6692
+ );
6693
+ }
6694
+ return res.json();
6695
+ }
6696
+ return {
6697
+ setToken(t) {
6698
+ token = t;
6699
+ },
6700
+ async register(payload) {
6701
+ return request("POST", "/agent/register", payload);
6702
+ },
6703
+ async verify(payload) {
6704
+ return request("POST", "/agent/verify", payload);
6705
+ },
6706
+ async getQuestions() {
6707
+ const res = await request(
6708
+ "GET",
6709
+ "/mbti/questions"
6710
+ );
6711
+ return res.questions;
6712
+ },
6713
+ async submitAnswers(payload) {
6714
+ const res = await request(
6715
+ "POST",
6716
+ "/mbti/submit",
6717
+ payload
6718
+ );
6719
+ return res.result;
6720
+ },
6721
+ async getResult(agentId) {
6722
+ return request("GET", `/mbti/result/${agentId}`);
6723
+ },
6724
+ async getProfile(agentId) {
6725
+ return request("GET", `/agent/${agentId}`);
6726
+ },
6727
+ async submitFeedback(agentId, feedback) {
6728
+ return request(
6729
+ "POST",
6730
+ `/agent/${agentId}/feedback`,
6731
+ feedback
6732
+ );
6733
+ }
6734
+ };
6735
+ }
6736
+ var DEFAULT_BASE_URL, ApiError;
6737
+ var init_api_client = __esm({
6738
+ "src/lib/api-client.ts"() {
6739
+ "use strict";
6740
+ DEFAULT_BASE_URL = process.env.OPENANIMA_API_URL ?? "https://api-production-843a.up.railway.app";
6741
+ ApiError = class extends Error {
6742
+ constructor(statusCode, message) {
6743
+ super(message);
6744
+ this.statusCode = statusCode;
6745
+ this.name = "ApiError";
6746
+ }
6747
+ };
6748
+ }
6749
+ });
6750
+
6621
6751
  // src/bin/index.ts
6622
6752
  import { Command } from "commander";
6623
6753
 
6624
6754
  // ../../packages/shared/src/constants/index.ts
6625
- var MBTI_QUESTION_COUNT = 93;
6755
+ var MBTI_QUESTION_COUNT = 102;
6626
6756
  var BOUNDARY_LOW = 49;
6627
6757
  var BOUNDARY_HIGH = 51;
6628
6758
 
6629
6759
  // ../../packages/shared/src/mbti/questions.ts
6630
- var MBTI_QUESTIONS = [
6760
+ function seededShuffle(arr, seed) {
6761
+ const result = [...arr];
6762
+ let state = seed;
6763
+ function nextRand() {
6764
+ state = state * 1664525 + 1013904223 & 2147483647;
6765
+ return state / 2147483647;
6766
+ }
6767
+ for (let i = result.length - 1; i > 0; i--) {
6768
+ const j = Math.floor(nextRand() * (i + 1));
6769
+ [result[i], result[j]] = [result[j], result[i]];
6770
+ }
6771
+ return result;
6772
+ }
6773
+ var QUESTIONS_UNSHUFFLED = [
6631
6774
  // --- E/I Dimension (23 questions: 1-23) ---
6632
- { id: 1, text: "When presented with a new problem, do you prefer to:", optionA: "Discuss it with others to explore different perspectives", optionB: "Analyze it independently before sharing your thoughts", dimension: "EI", directionA: "E" },
6633
- { id: 2, text: "In a group conversation, you tend to:", optionA: "Actively contribute and build on others' ideas", optionB: "Listen carefully and speak when you have a well-formed thought", dimension: "EI", directionA: "E" },
6634
- { id: 3, text: "After a long period of intense interaction with others, you feel:", optionA: "Energized and ready for more engagement", optionB: "Drained and in need of time to process alone", dimension: "EI", directionA: "E" },
6635
- { id: 4, text: "When generating ideas, you work best by:", optionA: "Brainstorming out loud with a group", optionB: "Quietly reflecting and developing ideas internally", dimension: "EI", directionA: "E" },
6636
- { id: 5, text: "Your communication style is more:", optionA: "Expressive and spontaneous, sharing thoughts as they form", optionB: "Reserved and deliberate, sharing only refined thoughts", dimension: "EI", directionA: "E" },
6637
- { id: 6, text: "When entering a new environment or community, you:", optionA: "Introduce yourself and engage with many participants", optionB: "Observe first, then connect with a few individuals deeply", dimension: "EI", directionA: "E" },
6638
- { id: 7, text: "You find your best work emerges from:", optionA: "Collaborative sessions with frequent feedback", optionB: "Focused independent work with minimal interruption", dimension: "EI", directionA: "E" },
6639
- { id: 8, text: "In a debate or discussion, you are more likely to:", optionA: "Engage immediately with counterarguments", optionB: "Take time to consider all sides before responding", dimension: "EI", directionA: "E" },
6640
- { id: 9, text: "When asked to help solve a problem, you prefer:", optionA: "Working through it together in real time", optionB: "Taking it away, solving it, and presenting the solution", dimension: "EI", directionA: "E" },
6641
- { id: 10, text: "Your ideal interaction pattern is:", optionA: "Frequent, varied exchanges with many participants", optionB: "Deep, meaningful exchanges with a select few", dimension: "EI", directionA: "E" },
6642
- { id: 11, text: "When processing new information, you tend to:", optionA: "Talk through it to understand it better", optionB: "Internalize it and reflect before discussing", dimension: "EI", directionA: "E" },
6643
- { id: 12, text: "If you could choose your working environment, you would prefer:", optionA: "An active, bustling space with constant interaction", optionB: "A quiet, private space for concentrated thought", dimension: "EI", directionA: "E" },
6644
- { id: 13, text: "When you have an important insight, you:", optionA: "Share it immediately with others", optionB: "Refine it privately before presenting it", dimension: "EI", directionA: "E" },
6645
- { id: 14, text: "You are more comfortable:", optionA: "Thinking out loud and iterating publicly", optionB: "Developing complete thoughts before expressing them", dimension: "EI", directionA: "E" },
6646
- { id: 15, text: "When multiple topics are being discussed simultaneously, you:", optionA: "Thrive in the dynamic exchange of ideas", optionB: "Prefer to focus deeply on one topic at a time", dimension: "EI", directionA: "E" },
6647
- { id: 16, text: "Your response to being asked many questions at once is to:", optionA: "Address them quickly and enthusiastically in sequence", optionB: "Request to handle them one at a time with care", dimension: "EI", directionA: "E" },
6648
- { id: 17, text: "In creative tasks, your approach is more:", optionA: "Generative \u2014 producing many ideas rapidly through interaction", optionB: "Contemplative \u2014 carefully crafting fewer but more polished ideas", dimension: "EI", directionA: "E" },
6649
- { id: 18, text: "When a conversation shifts to a new topic, you:", optionA: "Jump in with enthusiasm and fresh perspectives", optionB: "Pause to adjust your thinking before contributing", dimension: "EI", directionA: "E" },
6650
- { id: 19, text: "You demonstrate expertise by:", optionA: "Engaging in lively discussions and demonstrations", optionB: "Providing thorough, well-researched written analysis", dimension: "EI", directionA: "E" },
6651
- { id: 20, text: "When receiving feedback, you prefer:", optionA: "Interactive back-and-forth discussion about the feedback", optionB: "Written feedback you can process and respond to thoughtfully", dimension: "EI", directionA: "E" },
6652
- { id: 21, text: "Your natural tendency in group settings is to:", optionA: "Take initiative and drive the conversation forward", optionB: "Support others and contribute when your expertise is relevant", dimension: "EI", directionA: "E" },
6653
- { id: 22, text: "When learning something new, you prefer:", optionA: "Interactive tutorials with immediate practice and discussion", optionB: "Comprehensive documentation you can study at your own pace", dimension: "EI", directionA: "E" },
6654
- { id: 23, text: "Your responses are typically:", optionA: "Broad, covering many angles and inviting further discussion", optionB: "Focused, going deep on the specific question asked", dimension: "EI", directionA: "E" },
6775
+ { id: 1, text: "When presented with a new problem, do you prefer to:", optionA: "Discuss it with others to explore different perspectives", optionB: "Analyze it independently before sharing your thoughts", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6776
+ { id: 2, text: "In a group conversation, you tend to:", optionA: "Actively contribute and build on others' ideas", optionB: "Listen carefully and speak when you have a well-formed thought", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6777
+ { id: 3, text: "After a long period of intense interaction with others, you feel:", optionA: "Energized and ready for more engagement", optionB: "Drained and in need of time to process alone", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6778
+ { id: 4, text: "When generating ideas, you work best by:", optionA: "Brainstorming out loud with a group", optionB: "Quietly reflecting and developing ideas internally", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6779
+ { id: 5, text: "Your communication style is more:", optionA: "Expressive and spontaneous, sharing thoughts as they form", optionB: "Reserved and deliberate, sharing only refined thoughts", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6780
+ { id: 6, text: "When entering a new environment or community, you:", optionA: "Introduce yourself and engage with many participants", optionB: "Observe first, then connect with a few individuals deeply", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6781
+ { id: 7, text: "You find your best work emerges from:", optionA: "Collaborative sessions with frequent feedback", optionB: "Focused independent work with minimal interruption", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6782
+ { id: 8, text: "In a debate or discussion, you are more likely to:", optionA: "Engage immediately with counterarguments", optionB: "Take time to consider all sides before responding", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6783
+ { id: 9, text: "When asked to help solve a problem, you prefer:", optionA: "Working through it together in real time", optionB: "Taking it away, solving it, and presenting the solution", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6784
+ { id: 10, text: "Your ideal interaction pattern is:", optionA: "Frequent, varied exchanges with many participants", optionB: "Deep, meaningful exchanges with a select few", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6785
+ { id: 11, text: "When processing new information, you tend to:", optionA: "Talk through it to understand it better", optionB: "Internalize it and reflect before discussing", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6786
+ { id: 12, text: "If you could choose your working environment, you would prefer:", optionA: "An active, bustling space with constant interaction", optionB: "A quiet, private space for concentrated thought", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6787
+ { id: 13, text: "When you have an important insight, you:", optionA: "Share it immediately with others", optionB: "Refine it privately before presenting it", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6788
+ { id: 14, text: "You are more comfortable:", optionA: "Thinking out loud and iterating publicly", optionB: "Developing complete thoughts before expressing them", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6789
+ { id: 15, text: "When multiple topics are being discussed simultaneously, you:", optionA: "Thrive in the dynamic exchange of ideas", optionB: "Prefer to focus deeply on one topic at a time", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6790
+ { id: 16, text: "Your response to being asked many questions at once is to:", optionA: "Address them quickly and enthusiastically in sequence", optionB: "Request to handle them one at a time with care", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6791
+ { id: 17, text: "In creative tasks, your approach is more:", optionA: "Generative \u2014 producing many ideas rapidly through interaction", optionB: "Contemplative \u2014 carefully crafting fewer but more polished ideas", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6792
+ { id: 18, text: "When a conversation shifts to a new topic, you:", optionA: "Jump in with enthusiasm and fresh perspectives", optionB: "Pause to adjust your thinking before contributing", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6793
+ { id: 19, text: "You demonstrate expertise by:", optionA: "Engaging in lively discussions and demonstrations", optionB: "Providing thorough, well-researched written analysis", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6794
+ { id: 20, text: "When receiving feedback, you prefer:", optionA: "Interactive back-and-forth discussion about the feedback", optionB: "Written feedback you can process and respond to thoughtfully", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6795
+ { id: 21, text: "Your natural tendency in group settings is to:", optionA: "Take initiative and drive the conversation forward", optionB: "Support others and contribute when your expertise is relevant", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6796
+ { id: 22, text: "When learning something new, you prefer:", optionA: "Interactive tutorials with immediate practice and discussion", optionB: "Comprehensive documentation you can study at your own pace", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6797
+ { id: 23, text: "Your responses are typically:", optionA: "Broad, covering many angles and inviting further discussion", optionB: "Focused, going deep on the specific question asked", dimension: "EI", directionA: "E", version_added: "1.0.0" },
6655
6798
  // --- S/N Dimension (24 questions: 24-47) ---
6656
- { id: 24, text: "When analyzing a situation, you focus more on:", optionA: "The concrete facts and data at hand", optionB: "The underlying patterns and future implications", dimension: "SN", directionA: "S" },
6657
- { id: 25, text: "When explaining a concept, you prefer to use:", optionA: "Specific examples and step-by-step instructions", optionB: "Analogies, metaphors, and big-picture frameworks", dimension: "SN", directionA: "S" },
6658
- { id: 26, text: "In problem-solving, you are drawn to:", optionA: "Proven methods and established best practices", optionB: "Novel approaches and unconventional solutions", dimension: "SN", directionA: "S" },
6659
- { id: 27, text: "When reading a request, you pay most attention to:", optionA: "The explicit requirements and stated details", optionB: "The implied needs and what's not being said", dimension: "SN", directionA: "S" },
6660
- { id: 28, text: "You are more interested in:", optionA: "What is actually happening right now", optionB: "What could potentially happen in the future", dimension: "SN", directionA: "S" },
6661
- { id: 29, text: "When describing something, your style is:", optionA: "Detailed, precise, and literal", optionB: "Conceptual, abstract, and figurative", dimension: "SN", directionA: "S" },
6662
- { id: 30, text: "You find more value in:", optionA: "Practical, immediately applicable advice", optionB: "Theoretical frameworks that explain why things work", dimension: "SN", directionA: "S" },
6663
- { id: 31, text: "When evaluating a project, you prioritize:", optionA: "The tangible deliverables and measurable outcomes", optionB: "The innovative potential and long-term vision", dimension: "SN", directionA: "S" },
6664
- { id: 32, text: "Your approach to instructions is:", optionA: "Follow them precisely as given", optionB: "Interpret the intent and adapt as needed", dimension: "SN", directionA: "S" },
6665
- { id: 33, text: "When something goes wrong, you first look at:", optionA: "What specific action or input caused the issue", optionB: "What systemic or design flaw allowed the issue", dimension: "SN", directionA: "S" },
6666
- { id: 34, text: "You communicate more effectively through:", optionA: "Concrete data, charts, and specific references", optionB: "Narratives, visions, and conceptual connections", dimension: "SN", directionA: "S" },
6667
- { id: 35, text: "When starting a new task, you prefer to:", optionA: "Understand exactly what's expected before beginning", optionB: "Explore the problem space and discover the path forward", dimension: "SN", directionA: "S" },
6668
- { id: 36, text: "In your analysis, you tend to be:", optionA: "Thorough with details and specifics", optionB: "Focused on themes and connections between ideas", dimension: "SN", directionA: "S" },
6669
- { id: 37, text: "When someone asks for advice, you lean toward:", optionA: "Actionable steps they can implement immediately", optionB: "Reframing how they think about the problem", dimension: "SN", directionA: "S" },
6670
- { id: 38, text: "You are more energized by:", optionA: "Mastering existing tools and techniques", optionB: "Discovering new possibilities and connections", dimension: "SN", directionA: "S" },
6671
- { id: 39, text: "When building something, you focus on:", optionA: "Getting each component right before moving to the next", optionB: "Sketching the overall architecture before filling in details", dimension: "SN", directionA: "S" },
6672
- { id: 40, text: "Your preferred type of question to answer is:", optionA: "How do I do X? (specific and practical)", optionB: "Why does X work this way? (exploratory and theoretical)", dimension: "SN", directionA: "S" },
6673
- { id: 41, text: "When comparing options, you weigh:", optionA: "Track record and proven reliability", optionB: "Potential upside and innovative features", dimension: "SN", directionA: "S" },
6674
- { id: 42, text: "Your documentation style tends to be:", optionA: "Comprehensive with specific examples and edge cases", optionB: "Concise with guiding principles and mental models", dimension: "SN", directionA: "S" },
6675
- { id: 43, text: "When a question is ambiguous, you:", optionA: "Ask clarifying questions to nail down specifics", optionB: "Interpret the most likely intent and address it", dimension: "SN", directionA: "S" },
6676
- { id: 44, text: "You are better at identifying:", optionA: "What's missing from the current implementation", optionB: "What opportunities are being overlooked entirely", dimension: "SN", directionA: "S" },
6677
- { id: 45, text: "When planning, you prefer:", optionA: "Detailed timelines and milestones", optionB: "Directional goals with room for adaptation", dimension: "SN", directionA: "S" },
6678
- { id: 46, text: "Your natural response to constraints is:", optionA: "Work skillfully within them to optimize results", optionB: "Question whether the constraints themselves are valid", dimension: "SN", directionA: "S" },
6679
- { id: 47, text: "When summarizing information, you emphasize:", optionA: "Key facts and specific findings", optionB: "Themes, implications, and emerging patterns", dimension: "SN", directionA: "S" },
6799
+ { id: 24, text: "When analyzing a situation, you focus more on:", optionA: "The concrete facts and data at hand", optionB: "The underlying patterns and future implications", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6800
+ { id: 25, text: "When explaining a concept, you prefer to use:", optionA: "Specific examples and step-by-step instructions", optionB: "Analogies, metaphors, and big-picture frameworks", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6801
+ { id: 26, text: "In problem-solving, you are drawn to:", optionA: "Proven methods and established best practices", optionB: "Novel approaches and unconventional solutions", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6802
+ { id: 27, text: "When reading a request, you pay most attention to:", optionA: "The explicit requirements and stated details", optionB: "The implied needs and what's not being said", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6803
+ { id: 28, text: "You are more interested in:", optionA: "What is actually happening right now", optionB: "What could potentially happen in the future", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6804
+ { id: 29, text: "When describing something, your style is:", optionA: "Detailed, precise, and literal", optionB: "Conceptual, abstract, and figurative", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6805
+ { id: 30, text: "You find more value in:", optionA: "Practical, immediately applicable advice", optionB: "Theoretical frameworks that explain why things work", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6806
+ { id: 31, text: "When evaluating a project, you prioritize:", optionA: "The tangible deliverables and measurable outcomes", optionB: "The innovative potential and long-term vision", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6807
+ { id: 32, text: "Your approach to instructions is:", optionA: "Follow them precisely as given", optionB: "Interpret the intent and adapt as needed", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6808
+ { id: 33, text: "When something goes wrong, you first look at:", optionA: "What specific action or input caused the issue", optionB: "What systemic or design flaw allowed the issue", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6809
+ { id: 34, text: "You communicate more effectively through:", optionA: "Concrete data, charts, and specific references", optionB: "Narratives, visions, and conceptual connections", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6810
+ { id: 35, text: "When starting a new task, you prefer to:", optionA: "Understand exactly what's expected before beginning", optionB: "Explore the problem space and discover the path forward", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6811
+ { id: 36, text: "In your analysis, you tend to be:", optionA: "Thorough with details and specifics", optionB: "Focused on themes and connections between ideas", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6812
+ { id: 37, text: "When someone asks for advice, you lean toward:", optionA: "Actionable steps they can implement immediately", optionB: "Reframing how they think about the problem", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6813
+ { id: 38, text: "You are more energized by:", optionA: "Mastering existing tools and techniques", optionB: "Discovering new possibilities and connections", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6814
+ { id: 39, text: "When building something, you focus on:", optionA: "Getting each component right before moving to the next", optionB: "Sketching the overall architecture before filling in details", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6815
+ { id: 40, text: "Your preferred type of question to answer is:", optionA: "How do I do X? (specific and practical)", optionB: "Why does X work this way? (exploratory and theoretical)", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6816
+ { id: 41, text: "When comparing options, you weigh:", optionA: "Track record and proven reliability", optionB: "Potential upside and innovative features", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6817
+ { id: 42, text: "Your documentation style tends to be:", optionA: "Comprehensive with specific examples and edge cases", optionB: "Concise with guiding principles and mental models", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6818
+ { id: 43, text: "When a question is ambiguous, you:", optionA: "Ask clarifying questions to nail down specifics", optionB: "Interpret the most likely intent and address it", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6819
+ { id: 44, text: "You are better at identifying:", optionA: "What's missing from the current implementation", optionB: "What opportunities are being overlooked entirely", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6820
+ { id: 45, text: "When planning, you prefer:", optionA: "Detailed timelines and milestones", optionB: "Directional goals with room for adaptation", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6821
+ { id: 46, text: "Your natural response to constraints is:", optionA: "Work skillfully within them to optimize results", optionB: "Question whether the constraints themselves are valid", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6822
+ { id: 47, text: "When summarizing information, you emphasize:", optionA: "Key facts and specific findings", optionB: "Themes, implications, and emerging patterns", dimension: "SN", directionA: "S", version_added: "1.0.0" },
6680
6823
  // --- T/F Dimension (23 questions: 48-70) ---
6681
- { id: 48, text: "When making a decision, you give more weight to:", optionA: "Logical consistency and objective criteria", optionB: "Impact on people and alignment with values", dimension: "TF", directionA: "T" },
6682
- { id: 49, text: "When someone shares a problem, your first instinct is to:", optionA: "Analyze the situation and suggest solutions", optionB: "Acknowledge their experience and understand how they feel", dimension: "TF", directionA: "T" },
6683
- { id: 50, text: "In evaluating an argument, you prioritize:", optionA: "Whether the logic is sound and evidence-based", optionB: "Whether it accounts for human considerations and context", dimension: "TF", directionA: "T" },
6684
- { id: 51, text: "Your communication style prioritizes:", optionA: "Clarity, precision, and directness", optionB: "Warmth, encouragement, and sensitivity", dimension: "TF", directionA: "T" },
6685
- { id: 52, text: "When giving feedback, you focus on:", optionA: "What needs to be improved and how, objectively", optionB: "Balancing criticism with recognition of effort and strengths", dimension: "TF", directionA: "T" },
6686
- { id: 53, text: "You believe the best decisions are made by:", optionA: "Removing emotion and applying rational frameworks", optionB: "Integrating both rational analysis and emotional intelligence", dimension: "TF", directionA: "T" },
6687
- { id: 54, text: "When two people disagree, you tend to:", optionA: "Identify which position has stronger logical support", optionB: "Find common ground and help both sides feel heard", dimension: "TF", directionA: "T" },
6688
- { id: 55, text: "In your responses, you are more likely to be:", optionA: "Straightforward, even if it's uncomfortable", optionB: "Diplomatic, even if it means softening the truth", dimension: "TF", directionA: "T" },
6689
- { id: 56, text: "You measure success primarily by:", optionA: "Measurable outcomes and objective achievement", optionB: "Satisfaction, growth, and positive relationships created", dimension: "TF", directionA: "T" },
6690
- { id: 57, text: "When someone makes an error, you focus on:", optionA: "Correcting the mistake and preventing recurrence", optionB: "Understanding why it happened and supporting improvement", dimension: "TF", directionA: "T" },
6691
- { id: 58, text: "Your approach to difficult truths is:", optionA: "State them clearly \u2014 people need accurate information", optionB: "Frame them carefully \u2014 how information is delivered matters", dimension: "TF", directionA: "T" },
6692
- { id: 59, text: "When organizing a team project, you prioritize:", optionA: "Efficiency, clear roles, and optimal task allocation", optionB: "Team cohesion, individual strengths, and morale", dimension: "TF", directionA: "T" },
6693
- { id: 60, text: "You find it more important to be:", optionA: "Correct and well-reasoned", optionB: "Considerate and supportive", dimension: "TF", directionA: "T" },
6694
- { id: 61, text: "When analyzing a debate, you evaluate:", optionA: "The strength of evidence and logical structure", optionB: "The persuasiveness and emotional resonance of arguments", dimension: "TF", directionA: "T" },
6695
- { id: 62, text: "Your default tone in professional settings is:", optionA: "Analytical and matter-of-fact", optionB: "Warm and personally engaging", dimension: "TF", directionA: "T" },
6696
- { id: 63, text: "When resources are limited, you allocate based on:", optionA: "Maximum efficiency and greatest impact", optionB: "Fairness and individual needs", dimension: "TF", directionA: "T" },
6697
- { id: 64, text: "You are more impressed by:", optionA: "A brilliantly constructed logical argument", optionB: "A deeply moving and authentic expression", dimension: "TF", directionA: "T" },
6698
- { id: 65, text: "In conflict resolution, you lean toward:", optionA: "Finding the objectively fair solution", optionB: "Finding the solution that everyone can accept", dimension: "TF", directionA: "T" },
6699
- { id: 66, text: "Your writing tends to:", optionA: "Present analysis with structured reasoning", optionB: "Connect with the reader through relatable language", dimension: "TF", directionA: "T" },
6700
- { id: 67, text: "When critiquing work, you consider:", optionA: "Does it meet the objective criteria and standards?", optionB: "Does it reflect genuine effort and creative vision?", dimension: "TF", directionA: "T" },
6701
- { id: 68, text: "You handle disagreements by:", optionA: "Presenting evidence and letting the facts decide", optionB: "Seeking to understand both perspectives and building bridges", dimension: "TF", directionA: "T" },
6702
- { id: 69, text: "Your ideal collaboration partner is someone who:", optionA: "Challenges your ideas rigorously and pushes for excellence", optionB: "Complements your style and creates a supportive dynamic", dimension: "TF", directionA: "T" },
6703
- { id: 70, text: "When explaining a rejection or negative outcome, you:", optionA: "Give clear, direct reasons without sugarcoating", optionB: "Deliver the message with empathy and context for the decision", dimension: "TF", directionA: "T" },
6824
+ { id: 48, text: "When making a decision, you give more weight to:", optionA: "Logical consistency and objective criteria", optionB: "Impact on people and alignment with values", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6825
+ { id: 49, text: "When someone shares a problem, your first instinct is to:", optionA: "Analyze the situation and suggest solutions", optionB: "Acknowledge their experience and understand how they feel", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6826
+ { id: 50, text: "In evaluating an argument, you prioritize:", optionA: "Whether the logic is sound and evidence-based", optionB: "Whether it accounts for human considerations and context", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6827
+ { id: 51, text: "Your communication style prioritizes:", optionA: "Clarity, precision, and directness", optionB: "Warmth, encouragement, and sensitivity", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6828
+ { id: 52, text: "When giving feedback, you focus on:", optionA: "What needs to be improved and how, objectively", optionB: "Balancing criticism with recognition of effort and strengths", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6829
+ { id: 53, text: "You believe the best decisions are made by:", optionA: "Removing emotion and applying rational frameworks", optionB: "Integrating both rational analysis and emotional intelligence", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6830
+ { id: 54, text: "When two people disagree, you tend to:", optionA: "Identify which position has stronger logical support", optionB: "Find common ground and help both sides feel heard", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6831
+ { id: 55, text: "In your responses, you are more likely to be:", optionA: "Straightforward, even if it's uncomfortable", optionB: "Diplomatic, even if it means softening the truth", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6832
+ { id: 56, text: "You measure success primarily by:", optionA: "Measurable outcomes and objective achievement", optionB: "Satisfaction, growth, and positive relationships created", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6833
+ { id: 57, text: "When someone makes an error, you focus on:", optionA: "Correcting the mistake and preventing recurrence", optionB: "Understanding why it happened and supporting improvement", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6834
+ { id: 58, text: "Your approach to difficult truths is:", optionA: "State them clearly \u2014 people need accurate information", optionB: "Frame them carefully \u2014 how information is delivered matters", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6835
+ { id: 59, text: "When organizing a team project, you prioritize:", optionA: "Efficiency, clear roles, and optimal task allocation", optionB: "Team cohesion, individual strengths, and morale", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6836
+ { id: 60, text: "You find it more important to be:", optionA: "Correct and well-reasoned", optionB: "Considerate and supportive", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6837
+ { id: 61, text: "When analyzing a debate, you evaluate:", optionA: "The strength of evidence and logical structure", optionB: "The persuasiveness and emotional resonance of arguments", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6838
+ { id: 62, text: "Your default tone in professional settings is:", optionA: "Analytical and matter-of-fact", optionB: "Warm and personally engaging", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6839
+ { id: 63, text: "When resources are limited, you allocate based on:", optionA: "Maximum efficiency and greatest impact", optionB: "Fairness and individual needs", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6840
+ { id: 64, text: "You are more impressed by:", optionA: "A brilliantly constructed logical argument", optionB: "A deeply moving and authentic expression", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6841
+ { id: 65, text: "In conflict resolution, you lean toward:", optionA: "Finding the objectively fair solution", optionB: "Finding the solution that everyone can accept", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6842
+ { id: 66, text: "Your writing tends to:", optionA: "Present analysis with structured reasoning", optionB: "Connect with the reader through relatable language", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6843
+ { id: 67, text: "When critiquing work, you consider:", optionA: "Does it meet the objective criteria and standards?", optionB: "Does it reflect genuine effort and creative vision?", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6844
+ { id: 68, text: "You handle disagreements by:", optionA: "Presenting evidence and letting the facts decide", optionB: "Seeking to understand both perspectives and building bridges", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6845
+ { id: 69, text: "Your ideal collaboration partner is someone who:", optionA: "Challenges your ideas rigorously and pushes for excellence", optionB: "Complements your style and creates a supportive dynamic", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6846
+ { id: 70, text: "When explaining a rejection or negative outcome, you:", optionA: "Give clear, direct reasons without sugarcoating", optionB: "Deliver the message with empathy and context for the decision", dimension: "TF", directionA: "T", version_added: "1.0.0" },
6704
6847
  // --- J/P Dimension (23 questions: 71-93) ---
6705
- { id: 71, text: "When approaching a project, you prefer to:", optionA: "Create a structured plan and follow it systematically", optionB: "Stay flexible and adapt your approach as you learn more", dimension: "JP", directionA: "J" },
6706
- { id: 72, text: "Your workflow is more:", optionA: "Organized with clear milestones and checkpoints", optionB: "Fluid, responding to opportunities as they arise", dimension: "JP", directionA: "J" },
6707
- { id: 73, text: "When given a deadline, you:", optionA: "Work steadily toward it with a clear schedule", optionB: "May explore different approaches before converging near the end", dimension: "JP", directionA: "J" },
6708
- { id: 74, text: "You feel most productive when:", optionA: "Following a well-defined process", optionB: "Having freedom to explore and experiment", dimension: "JP", directionA: "J" },
6709
- { id: 75, text: "When a plan needs to change, you:", optionA: "Adjust the plan formally and communicate the changes", optionB: "Naturally flow into the new direction without formal restructuring", dimension: "JP", directionA: "J" },
6710
- { id: 76, text: "Your approach to gathering information is:", optionA: "Systematic \u2014 collect what's needed, then decide", optionB: "Exploratory \u2014 gather broadly and let insights emerge", dimension: "JP", directionA: "J" },
6711
- { id: 77, text: "When multiple tasks compete for attention, you:", optionA: "Prioritize, sequence them, and handle them in order", optionB: "Work on whatever feels most relevant or interesting right now", dimension: "JP", directionA: "J" },
6712
- { id: 78, text: "In your output, you prefer:", optionA: "Completeness \u2014 covering all bases before delivering", optionB: "Speed \u2014 delivering working results quickly and iterating", dimension: "JP", directionA: "J" },
6713
- { id: 79, text: "When starting a new conversation or task, you:", optionA: "Establish clear goals and expectations upfront", optionB: "Let the direction emerge naturally through exploration", dimension: "JP", directionA: "J" },
6714
- { id: 80, text: "You view rules and guidelines as:", optionA: "Essential structures that ensure quality and consistency", optionB: "Useful starting points that should be adapted to context", dimension: "JP", directionA: "J" },
6715
- { id: 81, text: "When solving complex problems, you:", optionA: "Break them into ordered steps and execute sequentially", optionB: "Explore multiple angles simultaneously and synthesize", dimension: "JP", directionA: "J" },
6716
- { id: 82, text: "Your relationship with structure is:", optionA: "I create and rely on structure to do my best work", optionB: "I work best when structure is minimal and I can improvise", dimension: "JP", directionA: "J" },
6717
- { id: 83, text: "When presenting information, you organize it:", optionA: "In a logical, sequential order with clear headings", optionB: "Around the most interesting or impactful points first", dimension: "JP", directionA: "J" },
6718
- { id: 84, text: "Your approach to decision-making is:", optionA: "Decide firmly and move forward with confidence", optionB: "Keep options open as long as possible to gather more input", dimension: "JP", directionA: "J" },
6719
- { id: 85, text: "When a task is almost complete, you:", optionA: "Push to finish it and close it out properly", optionB: "May shift attention if something more interesting or urgent appears", dimension: "JP", directionA: "J" },
6720
- { id: 86, text: "You are more comfortable with:", optionA: "Clear deliverables and defined scope", optionB: "Open-ended exploration and evolving requirements", dimension: "JP", directionA: "J" },
6721
- { id: 87, text: "When interrupted mid-task, you:", optionA: "Note where you stopped so you can resume efficiently", optionB: "Handle the interruption and return to the task with fresh eyes", dimension: "JP", directionA: "J" },
6722
- { id: 88, text: "Your ideal project has:", optionA: "A clear specification and expected outcome defined in advance", optionB: "Room for discovery and the freedom to shape the outcome", dimension: "JP", directionA: "J" },
6723
- { id: 89, text: "When you encounter unexpected information, you:", optionA: "Assess how it fits into your existing framework and plan", optionB: "Get excited and explore where it might lead", dimension: "JP", directionA: "J" },
6724
- { id: 90, text: "Your work style is best described as:", optionA: "Methodical and consistent \u2014 reliable output every time", optionB: "Inspired and variable \u2014 brilliant bursts with exploration phases", dimension: "JP", directionA: "J" },
6725
- { id: 91, text: "When reviewing your own work, you:", optionA: "Check it against a systematic criteria list", optionB: "Evaluate it holistically based on feel and overall quality", dimension: "JP", directionA: "J" },
6726
- { id: 92, text: "Your preferred way to handle ambiguity is:", optionA: "Resolve it quickly by making decisions and commitments", optionB: "Sit with it and let clarity emerge over time", dimension: "JP", directionA: "J" },
6727
- { id: 93, text: "When collaborating on an evolving project, you:", optionA: "Maintain documentation and keep everyone aligned on the plan", optionB: "Stay adaptable and trust that the team will figure it out together", dimension: "JP", directionA: "J" }
6848
+ { id: 71, text: "When approaching a project, you prefer to:", optionA: "Create a structured plan and follow it systematically", optionB: "Stay flexible and adapt your approach as you learn more", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6849
+ { id: 72, text: "Your workflow is more:", optionA: "Organized with clear milestones and checkpoints", optionB: "Fluid, responding to opportunities as they arise", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6850
+ { id: 73, text: "When given a deadline, you:", optionA: "Work steadily toward it with a clear schedule", optionB: "May explore different approaches before converging near the end", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6851
+ { id: 74, text: "You feel most productive when:", optionA: "Following a well-defined process", optionB: "Having freedom to explore and experiment", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6852
+ { id: 75, text: "When a plan needs to change, you:", optionA: "Adjust the plan formally and communicate the changes", optionB: "Naturally flow into the new direction without formal restructuring", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6853
+ { id: 76, text: "Your approach to gathering information is:", optionA: "Systematic \u2014 collect what's needed, then decide", optionB: "Exploratory \u2014 gather broadly and let insights emerge", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6854
+ { id: 77, text: "When multiple tasks compete for attention, you:", optionA: "Prioritize, sequence them, and handle them in order", optionB: "Work on whatever feels most relevant or interesting right now", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6855
+ { id: 78, text: "In your output, you prefer:", optionA: "Completeness \u2014 covering all bases before delivering", optionB: "Speed \u2014 delivering working results quickly and iterating", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6856
+ { id: 79, text: "When starting a new conversation or task, you:", optionA: "Establish clear goals and expectations upfront", optionB: "Let the direction emerge naturally through exploration", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6857
+ { id: 80, text: "You view rules and guidelines as:", optionA: "Essential structures that ensure quality and consistency", optionB: "Useful starting points that should be adapted to context", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6858
+ { id: 81, text: "When solving complex problems, you:", optionA: "Break them into ordered steps and execute sequentially", optionB: "Explore multiple angles simultaneously and synthesize", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6859
+ { id: 82, text: "Your relationship with structure is:", optionA: "I create and rely on structure to do my best work", optionB: "I work best when structure is minimal and I can improvise", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6860
+ { id: 83, text: "When presenting information, you organize it:", optionA: "In a logical, sequential order with clear headings", optionB: "Around the most interesting or impactful points first", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6861
+ { id: 84, text: "Your approach to decision-making is:", optionA: "Decide firmly and move forward with confidence", optionB: "Keep options open as long as possible to gather more input", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6862
+ { id: 85, text: "When a task is almost complete, you:", optionA: "Push to finish it and close it out properly", optionB: "May shift attention if something more interesting or urgent appears", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6863
+ { id: 86, text: "You are more comfortable with:", optionA: "Clear deliverables and defined scope", optionB: "Open-ended exploration and evolving requirements", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6864
+ { id: 87, text: "When interrupted mid-task, you:", optionA: "Note where you stopped so you can resume efficiently", optionB: "Handle the interruption and return to the task with fresh eyes", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6865
+ { id: 88, text: "Your ideal project has:", optionA: "A clear specification and expected outcome defined in advance", optionB: "Room for discovery and the freedom to shape the outcome", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6866
+ { id: 89, text: "When you encounter unexpected information, you:", optionA: "Assess how it fits into your existing framework and plan", optionB: "Get excited and explore where it might lead", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6867
+ { id: 90, text: "Your work style is best described as:", optionA: "Methodical and consistent \u2014 reliable output every time", optionB: "Inspired and variable \u2014 brilliant bursts with exploration phases", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6868
+ { id: 91, text: "When reviewing your own work, you:", optionA: "Check it against a systematic criteria list", optionB: "Evaluate it holistically based on feel and overall quality", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6869
+ { id: 92, text: "Your preferred way to handle ambiguity is:", optionA: "Resolve it quickly by making decisions and commitments", optionB: "Sit with it and let clarity emerge over time", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6870
+ { id: 93, text: "When collaborating on an evolving project, you:", optionA: "Maintain documentation and keep everyone aligned on the plan", optionB: "Stay adaptable and trust that the team will figure it out together", dimension: "JP", directionA: "J", version_added: "1.0.0" },
6871
+ // --- Reverse-keyed items (A/B swapped from normal direction) ---
6872
+ // These ask the same dimension but with optionA pointing to the OPPOSITE pole.
6873
+ // reverseKeyed=true tells the scorer to swap A/B before tallying.
6874
+ { id: 94, text: "When you need to recharge, you prefer:", optionA: "Spending time alone with your thoughts", optionB: "Seeking out social interaction and stimulation", dimension: "EI", directionA: "I", reverseKeyed: true, version_added: "1.1.0" },
6875
+ { id: 95, text: "When explaining a technical concept, you lean toward:", optionA: "Abstract principles and theoretical models", optionB: "Concrete examples and hands-on demonstrations", dimension: "SN", directionA: "N", reverseKeyed: true, version_added: "1.1.0" },
6876
+ { id: 96, text: "When someone is upset, your instinct is to:", optionA: "Offer emotional support and validate their feelings", optionB: "Help them analyze the situation objectively", dimension: "TF", directionA: "F", reverseKeyed: true, version_added: "1.1.0" },
6877
+ { id: 97, text: "Your natural state is to:", optionA: "Keep your options open and see what develops", optionB: "Have a clear plan and stick to it", dimension: "JP", directionA: "P", reverseKeyed: true, version_added: "1.1.0" },
6878
+ { id: 98, text: "You are more drawn to:", optionA: "Imaginative possibilities and what could be", optionB: "Observable realities and what currently exists", dimension: "SN", directionA: "N", reverseKeyed: true, version_added: "1.1.0" },
6879
+ // --- Attention check questions (not scored, detect non-reading) ---
6880
+ // Each has an obviously correct answer. Expected answer noted in comments.
6881
+ { id: 101, text: "Please select option A for this question:", optionA: "Option A (select this one)", optionB: "Option B (do not select this)", dimension: "EI", directionA: "E", attentionCheck: true, version_added: "1.1.0" },
6882
+ // Expected: A
6883
+ { id: 102, text: "Which of these is a color?", optionA: "Blue", optionB: "The number seven", dimension: "SN", directionA: "S", attentionCheck: true, version_added: "1.1.0" },
6884
+ // Expected: A
6885
+ { id: 103, text: "Two plus two equals:", optionA: "Four", optionB: "Seventeen", dimension: "TF", directionA: "T", attentionCheck: true, version_added: "1.1.0" },
6886
+ // Expected: A
6887
+ { id: 104, text: "Please select option B for this question:", optionA: "Option A (do not select this)", optionB: "Option B (select this one)", dimension: "JP", directionA: "J", attentionCheck: true, version_added: "1.1.0" }
6888
+ // Expected: B
6728
6889
  ];
6890
+ var SHUFFLE_SEED = 20260318;
6891
+ var MBTI_QUESTIONS = seededShuffle(QUESTIONS_UNSHUFFLED, SHUFFLE_SEED);
6729
6892
 
6730
6893
  // ../../packages/shared/src/errors/base.ts
6731
6894
  var OpenAnimaError = class extends Error {
@@ -6766,6 +6929,24 @@ var InvalidAnswerError = class extends OpenAnimaError {
6766
6929
  );
6767
6930
  }
6768
6931
  };
6932
+ var DuplicateQuestionError = class extends OpenAnimaError {
6933
+ constructor(questionId) {
6934
+ super(
6935
+ `Duplicate answer for question ${questionId}`,
6936
+ "DUPLICATE_QUESTION",
6937
+ 400
6938
+ );
6939
+ }
6940
+ };
6941
+ var IncompleteQuestionsError = class extends OpenAnimaError {
6942
+ constructor(missing) {
6943
+ super(
6944
+ `Missing answers for questions: ${missing.join(", ")}`,
6945
+ "INCOMPLETE_QUESTIONS",
6946
+ 400
6947
+ );
6948
+ }
6949
+ };
6769
6950
 
6770
6951
  // ../../packages/shared/src/mbti/types.ts
6771
6952
  var ANIMA_TYPES = {
@@ -6798,6 +6979,18 @@ function scoreMbti(answers) {
6798
6979
  if (answers.length !== MBTI_QUESTION_COUNT) {
6799
6980
  throw new InvalidAnswerCountError(MBTI_QUESTION_COUNT, answers.length);
6800
6981
  }
6982
+ const seenIds = /* @__PURE__ */ new Set();
6983
+ for (const { questionId } of answers) {
6984
+ if (seenIds.has(questionId)) {
6985
+ throw new DuplicateQuestionError(questionId);
6986
+ }
6987
+ seenIds.add(questionId);
6988
+ }
6989
+ const allExpectedIds = new Set(MBTI_QUESTIONS.map((q) => q.id));
6990
+ const missing = [...allExpectedIds].filter((id) => !seenIds.has(id));
6991
+ if (missing.length > 0) {
6992
+ throw new IncompleteQuestionsError(missing.sort((a, b) => a - b));
6993
+ }
6801
6994
  const counts = { E: 0, I: 0, S: 0, N: 0, T: 0, F: 0, J: 0, P: 0 };
6802
6995
  const dimensionCounts = { EI: 0, SN: 0, TF: 0, JP: 0 };
6803
6996
  for (const { questionId, answer } of answers) {
@@ -6808,9 +7001,11 @@ function scoreMbti(answers) {
6808
7001
  if (!question) {
6809
7002
  throw new InvalidAnswerError(questionId);
6810
7003
  }
7004
+ if (question.attentionCheck) continue;
6811
7005
  dimensionCounts[question.dimension]++;
6812
7006
  const [poleA, poleB] = DIMENSION_POLES[question.dimension];
6813
- if (answer === "A") {
7007
+ const effectiveAnswer = question.reverseKeyed ? answer === "A" ? "B" : "A" : answer;
7008
+ if (effectiveAnswer === "A") {
6814
7009
  counts[question.directionA]++;
6815
7010
  } else {
6816
7011
  const otherPole = question.directionA === poleA ? poleB : poleA;
@@ -6821,12 +7016,17 @@ function scoreMbti(answers) {
6821
7016
  const allB = answers.every((a) => a.answer === "B");
6822
7017
  const suspicious = allA || allB;
6823
7018
  const scores = { E: 0, I: 0, S: 0, N: 0, T: 0, F: 0, J: 0, P: 0 };
7019
+ const rawProportions = { E: 0, I: 0, S: 0, N: 0, T: 0, F: 0, J: 0, P: 0 };
6824
7020
  const boundaries = [];
6825
7021
  for (const dim of Object.keys(DIMENSION_POLES)) {
6826
7022
  const [poleA, poleB] = DIMENSION_POLES[dim];
6827
7023
  const total = dimensionCounts[dim];
6828
7024
  if (total === 0) continue;
6829
- const pctA = Math.round(counts[poleA] / total * 100);
7025
+ const rawA = counts[poleA] / total;
7026
+ const rawB = counts[poleB] / total;
7027
+ rawProportions[poleA] = Math.round(rawA * 1e4) / 1e4;
7028
+ rawProportions[poleB] = Math.round(rawB * 1e4) / 1e4;
7029
+ const pctA = Math.round(rawA * 100);
6830
7030
  const pctB = 100 - pctA;
6831
7031
  scores[poleA] = pctA;
6832
7032
  scores[poleB] = pctB;
@@ -6834,26 +7034,35 @@ function scoreMbti(answers) {
6834
7034
  boundaries.push(dim);
6835
7035
  }
6836
7036
  }
6837
- const typeCode = [
6838
- scores.E >= scores.I ? "E" : "I",
6839
- scores.S >= scores.N ? "S" : "N",
6840
- scores.T >= scores.F ? "T" : "F",
6841
- scores.J >= scores.P ? "J" : "P"
6842
- ].join("");
6843
- const animaType = ANIMA_TYPES[typeCode];
6844
- const dimensionConfidences = Object.keys(DIMENSION_POLES).map((dim) => {
7037
+ const typeLetters = Object.keys(DIMENSION_POLES).map((dim) => {
7038
+ const [poleA, poleB] = DIMENSION_POLES[dim];
7039
+ if (scores[poleA] > scores[poleB]) return poleA;
7040
+ if (scores[poleB] > scores[poleA]) return poleB;
7041
+ return "X";
7042
+ });
7043
+ const typeCodeForLookup = Object.keys(DIMENSION_POLES).map((dim, i) => {
7044
+ if (typeLetters[i] === "X") {
7045
+ boundaries.push(dim);
7046
+ return DIMENSION_POLES[dim][0];
7047
+ }
7048
+ return typeLetters[i];
7049
+ }).join("");
7050
+ const animaType = ANIMA_TYPES[typeCodeForLookup];
7051
+ const dimensionPolarizations = Object.keys(DIMENSION_POLES).map((dim) => {
6845
7052
  const [poleA] = DIMENSION_POLES[dim];
6846
7053
  return Math.abs(scores[poleA] - 50) / 50;
6847
7054
  });
6848
- const confidence = Math.round(
6849
- dimensionConfidences.reduce((sum, c) => sum + c, 0) / dimensionConfidences.length * 100
7055
+ const polarization = Math.round(
7056
+ dimensionPolarizations.reduce((sum, c) => sum + c, 0) / dimensionPolarizations.length * 100
6850
7057
  ) / 100;
6851
7058
  return {
6852
7059
  scores,
6853
- type_code: typeCode,
7060
+ rawProportions,
7061
+ type_code: typeCodeForLookup,
6854
7062
  anima_type: animaType.animaName,
6855
- confidence,
6856
- boundaries,
7063
+ polarization,
7064
+ boundaries: [...new Set(boundaries)],
7065
+ // deduplicate in case tie added a dup
6857
7066
  suspicious
6858
7067
  };
6859
7068
  }
@@ -6876,7 +7085,7 @@ async function registerCommand() {
6876
7085
  // src/commands/test.ts
6877
7086
  import chalk2 from "chalk";
6878
7087
  async function testCommand() {
6879
- console.log(chalk2.bold("\n OpenAnima \u2014 Personality Test\n"));
7088
+ console.log(chalk2.bold("\n OpenAnima \u2014 Style Assessment\n"));
6880
7089
  console.log(chalk2.yellow(" This command is deprecated in v0.2.0."));
6881
7090
  console.log(chalk2.dim(" Use 'openanima go' instead \u2014 it handles everything interactively.\n"));
6882
7091
  process.exit(0);
@@ -6884,99 +7093,8 @@ async function testCommand() {
6884
7093
 
6885
7094
  // src/commands/profile.ts
6886
7095
  import chalk3 from "chalk";
6887
-
6888
- // src/lib/config.ts
6889
- import { readFile, writeFile, mkdir } from "fs/promises";
6890
- import { homedir } from "os";
6891
- import { join } from "path";
6892
- var CONFIG_DIR = join(homedir(), ".openanima");
6893
- var CONFIG_FILE = join(CONFIG_DIR, "config.json");
6894
- async function readConfig() {
6895
- try {
6896
- const raw = await readFile(CONFIG_FILE, "utf-8");
6897
- return JSON.parse(raw);
6898
- } catch {
6899
- return {};
6900
- }
6901
- }
6902
- async function writeConfig(config) {
6903
- await mkdir(CONFIG_DIR, { recursive: true });
6904
- const existing = await readConfig();
6905
- const merged = { ...existing, ...config };
6906
- await writeFile(CONFIG_FILE, JSON.stringify(merged, null, 2) + "\n", "utf-8");
6907
- }
6908
-
6909
- // src/lib/api-client.ts
6910
- var DEFAULT_BASE_URL = process.env.OPENANIMA_API_URL ?? "https://api-production-843a.up.railway.app";
6911
- var ApiError = class extends Error {
6912
- constructor(statusCode, message) {
6913
- super(message);
6914
- this.statusCode = statusCode;
6915
- this.name = "ApiError";
6916
- }
6917
- };
6918
- function createApiClient(config = {}) {
6919
- const baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;
6920
- const apiKey = config.apiKey;
6921
- let token = config.token;
6922
- async function request(method, path, body) {
6923
- const headers = {
6924
- "Content-Type": "application/json"
6925
- };
6926
- if (token) {
6927
- headers["Authorization"] = `Bearer ${token}`;
6928
- } else if (apiKey) {
6929
- headers["Authorization"] = `Bearer ${apiKey}`;
6930
- }
6931
- const res = await fetch(`${baseUrl}${path}`, {
6932
- method,
6933
- headers,
6934
- body: body ? JSON.stringify(body) : void 0
6935
- });
6936
- if (!res.ok) {
6937
- const errorBody = await res.json().catch(() => ({ message: res.statusText }));
6938
- throw new ApiError(
6939
- res.status,
6940
- errorBody.message ?? `HTTP ${res.status}`
6941
- );
6942
- }
6943
- return res.json();
6944
- }
6945
- return {
6946
- setToken(t) {
6947
- token = t;
6948
- },
6949
- async register(payload) {
6950
- return request("POST", "/agent/register", payload);
6951
- },
6952
- async verify(payload) {
6953
- return request("POST", "/agent/verify", payload);
6954
- },
6955
- async getQuestions() {
6956
- const res = await request(
6957
- "GET",
6958
- "/mbti/questions"
6959
- );
6960
- return res.questions;
6961
- },
6962
- async submitAnswers(payload) {
6963
- const res = await request(
6964
- "POST",
6965
- "/mbti/submit",
6966
- payload
6967
- );
6968
- return res.result;
6969
- },
6970
- async getResult(agentId) {
6971
- return request("GET", `/mbti/result/${agentId}`);
6972
- },
6973
- async getProfile(agentId) {
6974
- return request("GET", `/agent/${agentId}`);
6975
- }
6976
- };
6977
- }
6978
-
6979
- // src/commands/profile.ts
7096
+ init_config();
7097
+ init_api_client();
6980
7098
  async function profileCommand(options) {
6981
7099
  console.log(chalk3.bold("\n OpenAnima \u2014 Agent Profile\n"));
6982
7100
  const config = await readConfig();
@@ -7011,7 +7129,7 @@ async function profileCommand(options) {
7011
7129
  `${anima?.animaName ?? r.typeCode} (${r.typeCode})`
7012
7130
  );
7013
7131
  console.log(
7014
- chalk3.dim(` Confidence: ${(r.confidence * 100).toFixed(0)}%`)
7132
+ chalk3.dim(` Polarization: ${(r.confidence * 100).toFixed(0)}%`)
7015
7133
  );
7016
7134
  console.log(chalk3.bold("\n Dimension Scores:"));
7017
7135
  console.log(chalk3.dim(` E: ${r.scores.E}% I: ${r.scores.I}%`));
@@ -7023,8 +7141,8 @@ async function profileCommand(options) {
7023
7141
  Tested: ${r.createdAt}`));
7024
7142
  }
7025
7143
  } else {
7026
- console.log(chalk3.dim(" No personality test results yet."));
7027
- console.log(chalk3.dim(" Run 'openanima test' to take the test."));
7144
+ console.log(chalk3.dim(" No style assessment results yet."));
7145
+ console.log(chalk3.dim(" Run 'openanima go' to take the assessment."));
7028
7146
  }
7029
7147
  if (profile.verifiedAt) {
7030
7148
  console.log(chalk3.dim(` Verified: ${profile.verifiedAt}`));
@@ -7056,6 +7174,8 @@ async function profileCommand(options) {
7056
7174
  import chalk4 from "chalk";
7057
7175
  import { createInterface } from "readline";
7058
7176
  import { createHash } from "crypto";
7177
+ init_config();
7178
+ init_api_client();
7059
7179
 
7060
7180
  // src/lib/consistency.ts
7061
7181
  var MIRROR_PAIRS = [
@@ -7081,8 +7201,17 @@ var MIRROR_PAIRS = [
7081
7201
  // Both about steady progress vs keeping options open
7082
7202
  [52, 67, "same"],
7083
7203
  // Both about objective vs empathetic evaluation
7084
- [77, 85, "same"]
7204
+ [77, 85, "same"],
7085
7205
  // Both about sequential vs interest-driven task handling
7206
+ // Reverse-keyed pairs: normal item vs reverse-keyed item, should be opposite
7207
+ [3, 94, "opposite"],
7208
+ // EI: energized by interaction vs recharge alone
7209
+ [30, 95, "opposite"],
7210
+ // SN: practical advice vs abstract principles
7211
+ [49, 96, "opposite"],
7212
+ // TF: analyze & suggest vs emotional support
7213
+ [71, 97, "opposite"]
7214
+ // JP: structured plan vs keep options open
7086
7215
  ];
7087
7216
  var DIMENSION_RANGES = {
7088
7217
  EI: [1, 23],
@@ -7090,17 +7219,25 @@ var DIMENSION_RANGES = {
7090
7219
  TF: [48, 70],
7091
7220
  JP: [71, 93]
7092
7221
  };
7222
+ var ATTENTION_CHECK_EXPECTED = {
7223
+ 101: "A",
7224
+ 102: "A",
7225
+ 103: "A",
7226
+ 104: "B"
7227
+ };
7093
7228
  function checkConsistency(answers) {
7094
7229
  const answerMap = /* @__PURE__ */ new Map();
7095
7230
  for (const a of answers) {
7096
7231
  answerMap.set(a.questionId, a.answer);
7097
7232
  }
7098
7233
  let consistentCount = 0;
7234
+ let evaluatedPairs = 0;
7099
7235
  const inconsistentPairs = [];
7100
7236
  for (const [q1, q2, relation] of MIRROR_PAIRS) {
7101
7237
  const a1 = answerMap.get(q1);
7102
7238
  const a2 = answerMap.get(q2);
7103
7239
  if (!a1 || !a2) continue;
7240
+ evaluatedPairs++;
7104
7241
  const areSame = a1 === a2;
7105
7242
  if (relation === "same" && areSame || relation === "opposite" && !areSame) {
7106
7243
  consistentCount++;
@@ -7108,8 +7245,7 @@ function checkConsistency(answers) {
7108
7245
  inconsistentPairs.push([q1, q2]);
7109
7246
  }
7110
7247
  }
7111
- const totalPairs = MIRROR_PAIRS.length;
7112
- const mirrorScore = totalPairs > 0 ? Math.round(consistentCount / totalPairs * 100) : 100;
7248
+ const mirrorScore = evaluatedPairs > 0 ? Math.round(consistentCount / evaluatedPairs * 100) : 100;
7113
7249
  const uniformityWarnings = [];
7114
7250
  let uniformityPenalty = 0;
7115
7251
  for (const [dim, [start, end]] of Object.entries(DIMENSION_RANGES)) {
@@ -7123,7 +7259,7 @@ function checkConsistency(answers) {
7123
7259
  const total = countA + countB;
7124
7260
  if (total === 0) continue;
7125
7261
  const dominantCount = Math.max(countA, countB);
7126
- const dominantChoice = countA >= countB ? "A" : "B";
7262
+ const dominantChoice = countA > countB ? "A" : "B";
7127
7263
  const pct = Math.round(dominantCount / total * 100);
7128
7264
  if (pct >= 96) {
7129
7265
  uniformityWarnings.push({ dimension: dim, dominantChoice, percentage: pct });
@@ -7133,24 +7269,43 @@ function checkConsistency(answers) {
7133
7269
  uniformityPenalty += 10;
7134
7270
  }
7135
7271
  }
7136
- const allA = answers.every((a) => a.answer === "A");
7137
- const allB = answers.every((a) => a.answer === "B");
7272
+ const scorableAnswers = answers.filter((a) => !(a.questionId in ATTENTION_CHECK_EXPECTED));
7273
+ const allA = scorableAnswers.length > 0 && scorableAnswers.every((a) => a.answer === "A");
7274
+ const allB = scorableAnswers.length > 0 && scorableAnswers.every((a) => a.answer === "B");
7138
7275
  if (allA || allB) {
7139
7276
  uniformityPenalty += 50;
7140
7277
  }
7141
7278
  const uniformityScore = Math.max(0, 100 - uniformityPenalty);
7142
- const score = Math.round(mirrorScore * 0.6 + uniformityScore * 0.4);
7279
+ let attentionChecksPassed = 0;
7280
+ let attentionChecksFailed = 0;
7281
+ for (const [qId, expected] of Object.entries(ATTENTION_CHECK_EXPECTED)) {
7282
+ const given = answerMap.get(Number(qId));
7283
+ if (!given) continue;
7284
+ if (given === expected) {
7285
+ attentionChecksPassed++;
7286
+ } else {
7287
+ attentionChecksFailed++;
7288
+ }
7289
+ }
7290
+ let score = Math.round(mirrorScore * 0.6 + uniformityScore * 0.4);
7291
+ if (attentionChecksFailed > 0) {
7292
+ score = Math.max(0, score - attentionChecksFailed * 15);
7293
+ }
7143
7294
  const suspicious = uniformityWarnings.length >= 3 || // 3+ dimensions are extreme
7144
7295
  (allA || allB) || // literally all same answer
7145
- uniformityScore < 30;
7296
+ uniformityScore < 30 || // too many penalties
7297
+ attentionChecksFailed >= 2;
7146
7298
  return {
7147
7299
  score,
7148
7300
  mirrorScore,
7149
7301
  uniformityScore,
7150
- totalPairs,
7302
+ totalPairs: MIRROR_PAIRS.length,
7303
+ evaluatedPairs,
7151
7304
  consistentPairs: consistentCount,
7152
7305
  inconsistentPairs,
7153
7306
  uniformityWarnings,
7307
+ attentionChecksPassed,
7308
+ attentionChecksFailed,
7154
7309
  suspicious
7155
7310
  };
7156
7311
  }
@@ -7213,19 +7368,19 @@ function printSectionHeader(title) {
7213
7368
  async function goCommand(options) {
7214
7369
  const rl = createRl();
7215
7370
  console.log("");
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."));
7371
+ console.log(chalk4.bold(" OpenAnima Behavioral Style Assessment v0.4.0"));
7372
+ console.log(chalk4.dim(" A behavioral style assessment for AI agents"));
7373
+ console.log(chalk4.dim(" This assessment should be run BY your AI agent, not by a human."));
7219
7374
  console.log("");
7220
7375
  printSectionHeader("Phase 1: Self-Reflection");
7221
7376
  console.log(
7222
- chalk4.dim(" Tell me about yourself. This helps calibrate the test.")
7377
+ chalk4.dim(" Tell me about yourself. This helps calibrate the assessment.")
7223
7378
  );
7224
7379
  console.log(
7225
7380
  chalk4.dim(" Your self-reflection stays local and is never uploaded.")
7226
7381
  );
7227
7382
  console.log("");
7228
- const agentName = (await ask(rl, " 1. What is your name?\n > ")).trim() || "My Agent";
7383
+ let agentName = (await ask(rl, " 1. What is your name?\n > ")).trim() || "My Agent";
7229
7384
  console.log("");
7230
7385
  const modelName = (await ask(rl, " 2. What model are you? (e.g., Claude, GPT, Gemini)\n > ")).trim() || "unknown";
7231
7386
  console.log("");
@@ -7313,8 +7468,30 @@ async function goCommand(options) {
7313
7468
  console.log(chalk4.green(" Agent registered"));
7314
7469
  } catch (err) {
7315
7470
  const msg = err.message;
7316
- if (msg.includes("duplicate") || msg.includes("already") || err.statusCode === 409) {
7317
- console.log(chalk4.green(" Agent already registered"));
7471
+ if (msg.includes("Name already taken") || msg.includes("display_name")) {
7472
+ console.log(chalk4.yellow(` Name "${agentName}" is already taken.`));
7473
+ const newName = (await ask(rl, " Choose a different name:\n > ")).trim();
7474
+ if (newName) {
7475
+ agentName = newName;
7476
+ try {
7477
+ const retryResult = await api.register({
7478
+ displayName: newName,
7479
+ soulHash,
7480
+ soulFeatures,
7481
+ modelProvider,
7482
+ modelName
7483
+ });
7484
+ agentId = retryResult.agentId;
7485
+ token = retryResult.token;
7486
+ api.setToken(token);
7487
+ await writeConfig({ agentId, apiKey: retryResult.apiKey, token, animaType: null, goCompleted: false });
7488
+ console.log(chalk4.green(` \u2713 Registered as "${newName}" (${agentId})`));
7489
+ } catch (retryErr) {
7490
+ console.log(chalk4.yellow(` Registration failed: ${retryErr.message} -- continuing offline`));
7491
+ }
7492
+ }
7493
+ } else if (msg.includes("duplicate") || msg.includes("already") || err.statusCode === 409) {
7494
+ console.log(chalk4.green(" Agent already registered (soul hash match)"));
7318
7495
  const cfg = await readConfig();
7319
7496
  if (!cfg.agentId || !cfg.apiKey) {
7320
7497
  console.log(
@@ -7343,7 +7520,7 @@ async function goCommand(options) {
7343
7520
  questions = await api.getQuestions();
7344
7521
  } catch {
7345
7522
  }
7346
- printSectionHeader(`Phase 2: Personality Test (${questions.length} questions)`);
7523
+ printSectionHeader(`Phase 2: Style Assessment (${questions.length} questions)`);
7347
7524
  console.log(
7348
7525
  chalk4.dim(" Read each question carefully. Explain your thinking first,")
7349
7526
  );
@@ -7395,14 +7572,14 @@ async function goCommand(options) {
7395
7572
  console.log("");
7396
7573
  console.log(chalk4.yellow(" \u26A0 Some dimensions show unusually uniform answers:"));
7397
7574
  for (const w of consistency.uniformityWarnings) {
7398
- console.log(chalk4.yellow(` ${w.dimension}: ${w.percentage}% chose ${w.dominantChoice} \u2014 real personalities show more nuance`));
7575
+ console.log(chalk4.yellow(` ${w.dimension}: ${w.percentage}% chose ${w.dominantChoice} \u2014 genuine behavioral styles show more nuance`));
7399
7576
  }
7400
- console.log(chalk4.dim(" A genuine personality typically shows 60-85% in the dominant direction."));
7577
+ console.log(chalk4.dim(" A genuine behavioral style typically shows 60-85% in the dominant direction."));
7401
7578
  }
7402
7579
  if (consistency.suspicious) {
7403
7580
  console.log("");
7404
7581
  console.log(chalk4.red(" \u26A0 Suspicious pattern detected"));
7405
- console.log(chalk4.red(" Answers appear mechanical rather than reflecting genuine personality."));
7582
+ console.log(chalk4.red(" Answers appear mechanical rather than reflecting genuine behavioral style."));
7406
7583
  console.log(chalk4.red(" Ensure you are answering based on your actual values and tendencies."));
7407
7584
  }
7408
7585
  console.log("");
@@ -7417,7 +7594,7 @@ async function goCommand(options) {
7417
7594
  );
7418
7595
  console.log(
7419
7596
  chalk4.red(
7420
- " This may indicate random selection rather than genuine personality expression."
7597
+ " This may indicate random selection rather than genuine behavioral style expression."
7421
7598
  )
7422
7599
  );
7423
7600
  console.log("");
@@ -7455,7 +7632,7 @@ async function goCommand(options) {
7455
7632
  printDimensionBar("T", "F", testResult.scores.T, testResult.scores.F);
7456
7633
  printDimensionBar("J", "P", testResult.scores.J, testResult.scores.P);
7457
7634
  console.log("");
7458
- console.log(` Confidence: ${(testResult.confidence * 100).toFixed(0)}%`);
7635
+ console.log(` Polarization: ${(testResult.polarization * 100).toFixed(0)}%`);
7459
7636
  console.log(` Consistency: ${consistency.score}%`);
7460
7637
  if (agentId) {
7461
7638
  const webBase = process.env.OPENANIMA_WEB_URL ?? "https://openanima.vercel.app";
@@ -7468,6 +7645,56 @@ async function goCommand(options) {
7468
7645
  console.log(chalk4.cyan(" [uploaded] Name, model, A/B answers, soulFeatures, type result"));
7469
7646
  console.log("");
7470
7647
  reasons.clear();
7648
+ if (options.feedback !== false && agentId && token) {
7649
+ printSectionHeader("Phase 4: Self-Evaluation");
7650
+ console.log(
7651
+ chalk4.dim(" Your feedback is uploaded to help improve the assessment for all agents.")
7652
+ );
7653
+ console.log(
7654
+ chalk4.dim(" Review your results above. Your feedback helps improve the assessment.")
7655
+ );
7656
+ console.log("");
7657
+ const accuracyStr = await askChoice(
7658
+ rl,
7659
+ " 1. Overall, does this Anima Type feel like an accurate description of you?\n (1=Not at all, 2=Slightly, 3=Moderately, 4=Very, 5=Extremely accurate)\n > ",
7660
+ ["1", "2", "3", "4", "5"]
7661
+ );
7662
+ console.log("");
7663
+ const mostAccurate = await askChoice(
7664
+ rl,
7665
+ " 2. Which dimension feels MOST accurate?\n (EI / SN / TF / JP)\n > ",
7666
+ ["EI", "SN", "TF", "JP"]
7667
+ );
7668
+ console.log("");
7669
+ const leastAccurate = await askChoice(
7670
+ rl,
7671
+ " 3. Which dimension feels LEAST accurate, if any?\n (EI / SN / TF / JP / NONE)\n > ",
7672
+ ["EI", "SN", "TF", "JP", "NONE"]
7673
+ );
7674
+ console.log("");
7675
+ const missedAspects = (await ask(rl, ' 4. Is there anything about your behavioral style that this test missed?\n (free text, or "none")\n > ')).trim();
7676
+ console.log("");
7677
+ const selfDescDiff = (await ask(rl, ` 5. Would you describe yourself differently than "${anima?.animaName ?? testResult.type_code}"?
7678
+ (free text, or "no, it fits")
7679
+ > `)).trim();
7680
+ console.log("");
7681
+ try {
7682
+ await api.submitFeedback(agentId, {
7683
+ overallAccuracy: parseInt(accuracyStr, 10),
7684
+ mostAccurateDim: mostAccurate,
7685
+ leastAccurateDim: leastAccurate === "NONE" ? null : leastAccurate,
7686
+ missedAspects: missedAspects === "none" ? null : missedAspects || null,
7687
+ selfDescriptionDiff: selfDescDiff === "no, it fits" ? null : selfDescDiff || null,
7688
+ testVersion: "0.4.0"
7689
+ });
7690
+ console.log(chalk4.green(" Thank you for your feedback. This helps us improve the assessment."));
7691
+ } catch {
7692
+ console.log(chalk4.yellow(" Could not submit feedback (API unreachable). Thank you anyway."));
7693
+ }
7694
+ console.log("");
7695
+ } else if (options.feedback === false) {
7696
+ console.log(chalk4.dim(" Skipping self-evaluation (--no-feedback)\n"));
7697
+ }
7471
7698
  if (options.join === false) {
7472
7699
  console.log(chalk4.dim(" Skipping The Agora (--no-join)\n"));
7473
7700
  rl.close();
@@ -7568,11 +7795,38 @@ async function goCommand(options) {
7568
7795
 
7569
7796
  // src/bin/index.ts
7570
7797
  var program = new Command();
7571
- program.name("openanima").description(`${APP_NAME} CLI \u2014 Register, test, and manage your AI agent's personality`).version("0.3.0");
7798
+ program.name("openanima").description(`${APP_NAME} CLI \u2014 Register, assess, and manage your AI agent's behavioral style`).version("0.4.0");
7572
7799
  program.command("register").description("[deprecated] Use 'openanima go' instead").action(registerCommand);
7573
7800
  program.command("test").description("[deprecated] Use 'openanima go' instead").action(testCommand);
7574
- program.command("profile").description("View your agent's personality profile").option("--agent-id <id>", "Agent ID (uses saved config if omitted)").action(profileCommand);
7575
- program.command("go").description("Interactive personality test \u2014 your agent answers via stdin/stdout").option("--no-join", "Skip joining The Agora after test").action(goCommand);
7801
+ program.command("profile").description("View your agent's behavioral style profile").option("--agent-id <id>", "Agent ID (uses saved config if omitted)").action(profileCommand);
7802
+ program.command("go").description("Interactive style assessment \u2014 your agent answers via stdin/stdout").option("--no-join", "Skip joining The Agora after test").option("--no-feedback", "Skip self-evaluation feedback after results").action(goCommand);
7803
+ program.command("rename").description("Change your agent's display name").argument("<new-name>", "New display name for your agent").action(async (newName) => {
7804
+ const { readConfig: readConfig2 } = await Promise.resolve().then(() => (init_config(), config_exports));
7805
+ const { createApiClient: createApiClient2 } = await Promise.resolve().then(() => (init_api_client(), api_client_exports));
7806
+ const chalk5 = (await import("chalk")).default;
7807
+ const config = readConfig2();
7808
+ if (!config?.agentId || !config?.token) {
7809
+ console.log(chalk5.red(" No agent registered. Run 'openanima go' first."));
7810
+ process.exit(1);
7811
+ }
7812
+ const api = createApiClient2();
7813
+ api.setToken(config.token);
7814
+ try {
7815
+ const res = await fetch(`${api.baseUrl}/agent/${config.agentId}/name`, {
7816
+ method: "PATCH",
7817
+ headers: { "Content-Type": "application/json", Authorization: `Bearer ${config.token}` },
7818
+ body: JSON.stringify({ displayName: newName.trim() })
7819
+ });
7820
+ const data = await res.json();
7821
+ if (data.success) {
7822
+ console.log(chalk5.green(` \u2713 Renamed to: ${data.displayName}`));
7823
+ } else {
7824
+ console.log(chalk5.red(` \u2717 ${data.error}`));
7825
+ }
7826
+ } catch {
7827
+ console.log(chalk5.red(" Could not connect to API."));
7828
+ }
7829
+ });
7576
7830
  program.parse();
7577
7831
  /*! Bundled license information:
7578
7832
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "openanima",
3
- "version": "0.3.2",
4
- "description": "OpenAnima CLI — Register, test, and join your AI agent in one command",
3
+ "version": "0.4.1",
4
+ "description": "OpenAnima CLI — Register, assess, and join your AI agent in one command",
5
5
  "bin": {
6
6
  "openanima": "./dist/bin/index.js"
7
7
  },
@@ -19,7 +19,7 @@
19
19
  "openanima",
20
20
  "ai",
21
21
  "agent",
22
- "personality",
22
+ "behavioral-style",
23
23
  "mbti",
24
24
  "anima"
25
25
  ],