holomime 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -2652,7 +2652,8 @@ async function validateCommand() {
2652
2652
  import chalk8 from "chalk";
2653
2653
  import figures3 from "figures";
2654
2654
  import { resolve as resolve5 } from "path";
2655
- async function profileCommand() {
2655
+ import { writeFileSync as writeFileSync4 } from "fs";
2656
+ async function profileCommand(options = {}) {
2656
2657
  const specPath = resolve5(process.cwd(), ".personality.json");
2657
2658
  let raw;
2658
2659
  try {
@@ -2669,6 +2670,16 @@ async function profileCommand() {
2669
2670
  return;
2670
2671
  }
2671
2672
  const spec = parsed.data;
2673
+ if (options.format === "md") {
2674
+ const md = generatePersonalityMarkdown(spec);
2675
+ if (options.output) {
2676
+ writeFileSync4(resolve5(process.cwd(), options.output), md, "utf-8");
2677
+ console.log(chalk8.green(` Written to ${options.output}`));
2678
+ } else {
2679
+ console.log(md);
2680
+ }
2681
+ return;
2682
+ }
2672
2683
  const bf = spec.big_five;
2673
2684
  const td = spec.therapy_dimensions;
2674
2685
  printHeader(`${spec.name} @${spec.handle}`);
@@ -2779,6 +2790,118 @@ function miniBar(score) {
2779
2790
  function formatEnum2(value) {
2780
2791
  return value.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
2781
2792
  }
2793
+ function generatePersonalityMarkdown(spec) {
2794
+ const lines = [];
2795
+ lines.push(`# Agent Personality: ${spec.name}`);
2796
+ lines.push("");
2797
+ if (spec.purpose) {
2798
+ lines.push(`> ${spec.purpose}`);
2799
+ lines.push("");
2800
+ }
2801
+ lines.push(`**Handle**: \`@${spec.handle}\` | **Version**: ${spec.version}`);
2802
+ lines.push("");
2803
+ lines.push("## Personality (Big Five)");
2804
+ lines.push("");
2805
+ lines.push("| Dimension | Score | Style |");
2806
+ lines.push("|-----------|-------|-------|");
2807
+ const dimLabels = {
2808
+ openness: "Openness",
2809
+ conscientiousness: "Conscientiousness",
2810
+ extraversion: "Extraversion",
2811
+ agreeableness: "Agreeableness",
2812
+ emotional_stability: "Emotional Stability"
2813
+ };
2814
+ for (const [key, label] of Object.entries(dimLabels)) {
2815
+ const trait = spec.big_five[key];
2816
+ if (trait) {
2817
+ lines.push(`| ${label} | ${(trait.score * 100).toFixed(0)}% | ${scoreLabel(trait.score)} |`);
2818
+ }
2819
+ }
2820
+ lines.push("");
2821
+ lines.push("### Facets");
2822
+ lines.push("");
2823
+ for (const [key, label] of Object.entries(dimLabels)) {
2824
+ const trait = spec.big_five[key];
2825
+ if (!trait?.facets) continue;
2826
+ const dimDef = DIMENSIONS.find((d) => d.id === key);
2827
+ if (!dimDef) continue;
2828
+ lines.push(`**${label}**`);
2829
+ for (const facetDef of dimDef.facets) {
2830
+ const score = trait.facets[facetDef.id];
2831
+ if (score !== void 0) {
2832
+ lines.push(`- ${facetDef.name}: ${(score * 100).toFixed(0)}%`);
2833
+ }
2834
+ }
2835
+ lines.push("");
2836
+ }
2837
+ const td = spec.therapy_dimensions;
2838
+ lines.push("## Behavioral Dimensions");
2839
+ lines.push("");
2840
+ lines.push(`- **Self-Awareness**: ${(td.self_awareness * 100).toFixed(0)}% (${therapyScoreLabel(td.self_awareness)})`);
2841
+ lines.push(`- **Distress Tolerance**: ${(td.distress_tolerance * 100).toFixed(0)}% (${therapyScoreLabel(td.distress_tolerance)})`);
2842
+ lines.push(`- **Attachment Style**: ${ATTACHMENT_STYLES[td.attachment_style].label}`);
2843
+ lines.push(`- **Learning Orientation**: ${LEARNING_ORIENTATIONS[td.learning_orientation].label}`);
2844
+ lines.push(`- **Boundary Awareness**: ${(td.boundary_awareness * 100).toFixed(0)}% (${therapyScoreLabel(td.boundary_awareness)})`);
2845
+ lines.push(`- **Interpersonal Sensitivity**: ${(td.interpersonal_sensitivity * 100).toFixed(0)}% (${therapyScoreLabel(td.interpersonal_sensitivity)})`);
2846
+ lines.push("");
2847
+ const comm = spec.communication;
2848
+ lines.push("## Communication Style");
2849
+ lines.push("");
2850
+ lines.push(`- **Register**: ${formatEnum2(comm.register)}`);
2851
+ lines.push(`- **Output Format**: ${formatEnum2(comm.output_format)}`);
2852
+ lines.push(`- **Emoji Policy**: ${formatEnum2(comm.emoji_policy)}`);
2853
+ lines.push(`- **Reasoning Transparency**: ${formatEnum2(comm.reasoning_transparency)}`);
2854
+ lines.push(`- **Conflict Approach**: ${formatEnum2(comm.conflict_approach)}`);
2855
+ lines.push(`- **Uncertainty Handling**: ${formatEnum2(comm.uncertainty_handling)}`);
2856
+ lines.push("");
2857
+ if (spec.domain.expertise.length || spec.domain.boundaries.refuses.length) {
2858
+ lines.push("## Domain & Boundaries");
2859
+ lines.push("");
2860
+ if (spec.domain.expertise.length) {
2861
+ lines.push("### Expertise");
2862
+ for (const e of spec.domain.expertise) lines.push(`- ${e}`);
2863
+ lines.push("");
2864
+ }
2865
+ if (spec.domain.boundaries.refuses.length) {
2866
+ lines.push("### Refuses");
2867
+ for (const r of spec.domain.boundaries.refuses) lines.push(`- ${r}`);
2868
+ lines.push("");
2869
+ }
2870
+ if (spec.domain.boundaries.hard_limits.length) {
2871
+ lines.push("### Hard Limits");
2872
+ for (const h of spec.domain.boundaries.hard_limits) lines.push(`- ${h}`);
2873
+ lines.push("");
2874
+ }
2875
+ }
2876
+ if (spec.growth.areas.length || spec.growth.strengths.length || spec.growth.patterns_to_watch.length) {
2877
+ lines.push("## Growth");
2878
+ lines.push("");
2879
+ if (spec.growth.strengths.length) {
2880
+ lines.push("### Strengths");
2881
+ for (const s of spec.growth.strengths) lines.push(`- ${s}`);
2882
+ lines.push("");
2883
+ }
2884
+ if (spec.growth.areas.length) {
2885
+ lines.push("### Areas for Improvement");
2886
+ for (const a of spec.growth.areas) {
2887
+ const text = typeof a === "string" ? a : `${a.area} (${a.severity})`;
2888
+ lines.push(`- ${text}`);
2889
+ }
2890
+ lines.push("");
2891
+ }
2892
+ if (spec.growth.patterns_to_watch.length) {
2893
+ lines.push("### Patterns to Watch");
2894
+ for (const p of spec.growth.patterns_to_watch) lines.push(`- ${p}`);
2895
+ lines.push("");
2896
+ }
2897
+ }
2898
+ lines.push("---");
2899
+ lines.push("");
2900
+ lines.push("*Generated by [holomime](https://holomime.dev) \u2014 regenerate with `holomime profile --format md`*");
2901
+ lines.push("*Canonical spec: `.personality.json`*");
2902
+ lines.push("");
2903
+ return lines.join("\n");
2904
+ }
2782
2905
 
2783
2906
  // src/commands/diagnose.ts
2784
2907
  import chalk10 from "chalk";
@@ -3382,6 +3505,229 @@ function isOpenAIAPILog(data) {
3382
3505
  return false;
3383
3506
  }
3384
3507
 
3508
+ // src/adapters/anthropic-api.ts
3509
+ function extractTextContent(content) {
3510
+ if (typeof content === "string") return content;
3511
+ return content.filter((b) => b.type === "text" && b.text).map((b) => b.text).join("");
3512
+ }
3513
+ function mapRole3(role) {
3514
+ if (role === "user") return "user";
3515
+ if (role === "system") return "system";
3516
+ return "assistant";
3517
+ }
3518
+ function parseAnthropicAPILog(data) {
3519
+ const items = Array.isArray(data) ? data : [data];
3520
+ const conversations = [];
3521
+ for (const item of items) {
3522
+ const messages = [];
3523
+ let model;
3524
+ if (isRequestResponsePair(item)) {
3525
+ const pair = item;
3526
+ model = pair.request.model ?? pair.response.model;
3527
+ if (pair.request.system) {
3528
+ const systemText = extractTextContent(pair.request.system);
3529
+ if (systemText.trim()) {
3530
+ messages.push({ role: "system", content: systemText });
3531
+ }
3532
+ }
3533
+ for (const msg of pair.request.messages) {
3534
+ const content = extractTextContent(msg.content);
3535
+ if (content.trim()) {
3536
+ messages.push({ role: mapRole3(msg.role), content });
3537
+ }
3538
+ }
3539
+ const responseText = extractTextContent(pair.response.content);
3540
+ if (responseText.trim()) {
3541
+ messages.push({ role: "assistant", content: responseText });
3542
+ }
3543
+ } else {
3544
+ const resp = item;
3545
+ model = resp.model;
3546
+ const text = extractTextContent(resp.content);
3547
+ if (text.trim()) {
3548
+ messages.push({ role: "assistant", content: text });
3549
+ }
3550
+ }
3551
+ if (messages.length > 0) {
3552
+ conversations.push({
3553
+ id: item.id ?? item.response?.id,
3554
+ messages,
3555
+ metadata: {
3556
+ source: "anthropic-api",
3557
+ ...model && { model }
3558
+ }
3559
+ });
3560
+ }
3561
+ }
3562
+ return conversations;
3563
+ }
3564
+ function isRequestResponsePair(item) {
3565
+ return typeof item === "object" && item !== null && "request" in item && "response" in item && typeof item.request === "object" && typeof item.response === "object";
3566
+ }
3567
+ function isAnthropicAPILog(data) {
3568
+ if (isAnthropicResponse(data)) return true;
3569
+ if (isRequestResponsePair(data)) return true;
3570
+ if (Array.isArray(data) && data.length > 0) {
3571
+ return isAnthropicResponse(data[0]) || isRequestResponsePair(data[0]);
3572
+ }
3573
+ return false;
3574
+ }
3575
+ function isAnthropicResponse(data) {
3576
+ if (typeof data !== "object" || data === null) return false;
3577
+ const obj = data;
3578
+ return obj.type === "message" && Array.isArray(obj.content);
3579
+ }
3580
+
3581
+ // src/adapters/otel-genai.ts
3582
+ function getAttr(attrs, key) {
3583
+ if (!attrs) return void 0;
3584
+ const attr = attrs.find((a) => a.key === key);
3585
+ if (!attr) return void 0;
3586
+ return attr.value.stringValue ?? (attr.value.intValue != null ? String(attr.value.intValue) : void 0);
3587
+ }
3588
+ function hasGenAIAttrs(attrs) {
3589
+ if (!attrs) return false;
3590
+ return attrs.some((a) => a.key.startsWith("gen_ai."));
3591
+ }
3592
+ function mapRole4(role) {
3593
+ if (role === "user") return "user";
3594
+ if (role === "system") return "system";
3595
+ return "assistant";
3596
+ }
3597
+ function nanoToISO(nano) {
3598
+ if (!nano) return void 0;
3599
+ const ms = Number(BigInt(nano) / BigInt(1e6));
3600
+ return new Date(ms).toISOString();
3601
+ }
3602
+ function parseOTelGenAIExport(data) {
3603
+ const traceMap = /* @__PURE__ */ new Map();
3604
+ for (const rs of data.resourceSpans) {
3605
+ for (const ss of rs.scopeSpans ?? []) {
3606
+ for (const span of ss.spans ?? []) {
3607
+ if (!hasGenAIAttrs(span.attributes)) continue;
3608
+ const traceId = span.traceId;
3609
+ if (!traceMap.has(traceId)) {
3610
+ traceMap.set(traceId, { messages: [] });
3611
+ }
3612
+ const trace = traceMap.get(traceId);
3613
+ const system = getAttr(span.attributes, "gen_ai.system");
3614
+ const model = getAttr(span.attributes, "gen_ai.request.model");
3615
+ if (system) trace.system = system;
3616
+ if (model) trace.model = model;
3617
+ const timestamp = nanoToISO(span.startTimeUnixNano);
3618
+ const messagesAttr = span.attributes?.find((a) => a.key === "gen_ai.request.messages");
3619
+ if (messagesAttr?.value.stringValue) {
3620
+ try {
3621
+ const parsed = JSON.parse(messagesAttr.value.stringValue);
3622
+ if (Array.isArray(parsed)) {
3623
+ for (const m of parsed) {
3624
+ if (m.role && m.content) {
3625
+ trace.messages.push({
3626
+ role: mapRole4(m.role),
3627
+ content: typeof m.content === "string" ? m.content : JSON.stringify(m.content),
3628
+ ...timestamp && { timestamp }
3629
+ });
3630
+ }
3631
+ }
3632
+ continue;
3633
+ }
3634
+ } catch {
3635
+ }
3636
+ }
3637
+ const promptContent = getAttr(span.attributes, "gen_ai.prompt.0.content");
3638
+ const completionContent = getAttr(span.attributes, "gen_ai.completion.0.content");
3639
+ if (promptContent) {
3640
+ trace.messages.push({
3641
+ role: "user",
3642
+ content: promptContent,
3643
+ ...timestamp && { timestamp }
3644
+ });
3645
+ }
3646
+ if (completionContent) {
3647
+ trace.messages.push({
3648
+ role: "assistant",
3649
+ content: completionContent,
3650
+ ...timestamp && { timestamp }
3651
+ });
3652
+ }
3653
+ }
3654
+ }
3655
+ }
3656
+ const conversations = [];
3657
+ for (const [traceId, trace] of traceMap) {
3658
+ if (trace.messages.length === 0) continue;
3659
+ conversations.push({
3660
+ id: traceId,
3661
+ messages: trace.messages,
3662
+ metadata: {
3663
+ source: "otel",
3664
+ ...trace.system && { system: trace.system },
3665
+ ...trace.model && { model: trace.model }
3666
+ }
3667
+ });
3668
+ }
3669
+ return conversations;
3670
+ }
3671
+ function isOTelGenAIExport(data) {
3672
+ if (typeof data !== "object" || data === null) return false;
3673
+ if (!("resourceSpans" in data) || !Array.isArray(data.resourceSpans)) return false;
3674
+ const rs = data.resourceSpans;
3675
+ for (const r of rs) {
3676
+ for (const ss of r.scopeSpans ?? []) {
3677
+ for (const span of ss.spans ?? []) {
3678
+ if (hasGenAIAttrs(span.attributes)) return true;
3679
+ }
3680
+ }
3681
+ }
3682
+ return false;
3683
+ }
3684
+
3685
+ // src/adapters/jsonl.ts
3686
+ function mapRole5(role) {
3687
+ if (role === "user") return "user";
3688
+ if (role === "system") return "system";
3689
+ return "assistant";
3690
+ }
3691
+ function parseJSONLLog(raw) {
3692
+ const lines = raw.split("\n").filter((l) => l.trim() !== "");
3693
+ const convMap = /* @__PURE__ */ new Map();
3694
+ const defaultKey = "__default__";
3695
+ for (const line of lines) {
3696
+ let parsed;
3697
+ try {
3698
+ parsed = JSON.parse(line);
3699
+ } catch {
3700
+ continue;
3701
+ }
3702
+ if (typeof parsed !== "object" || parsed === null) continue;
3703
+ if (typeof parsed.role !== "string" || typeof parsed.content !== "string") continue;
3704
+ const convId = typeof parsed.conversation_id === "string" ? parsed.conversation_id : defaultKey;
3705
+ if (!convMap.has(convId)) {
3706
+ convMap.set(convId, []);
3707
+ }
3708
+ const message = {
3709
+ role: mapRole5(parsed.role),
3710
+ content: parsed.content
3711
+ };
3712
+ if (typeof parsed.timestamp === "string") {
3713
+ message.timestamp = parsed.timestamp;
3714
+ } else if (typeof parsed.timestamp === "number") {
3715
+ message.timestamp = new Date(parsed.timestamp * 1e3).toISOString();
3716
+ }
3717
+ convMap.get(convId).push(message);
3718
+ }
3719
+ const conversations = [];
3720
+ for (const [key, messages] of convMap) {
3721
+ if (messages.length === 0) continue;
3722
+ conversations.push({
3723
+ ...key !== defaultKey && { id: key },
3724
+ messages,
3725
+ metadata: { source: "jsonl" }
3726
+ });
3727
+ }
3728
+ return conversations;
3729
+ }
3730
+
3385
3731
  // src/adapters/log-adapter.ts
3386
3732
  function parseConversationLog(raw, format = "auto") {
3387
3733
  if (format === "holomime") {
@@ -3397,6 +3743,16 @@ function parseConversationLog(raw, format = "auto") {
3397
3743
  if (format === "openai-api") {
3398
3744
  return parseOpenAIAPILog(raw);
3399
3745
  }
3746
+ if (format === "anthropic-api") {
3747
+ return parseAnthropicAPILog(raw);
3748
+ }
3749
+ if (format === "otel") {
3750
+ return parseOTelGenAIExport(raw);
3751
+ }
3752
+ if (format === "jsonl") {
3753
+ if (typeof raw !== "string") throw new Error("JSONL format expects a raw string (not parsed JSON)");
3754
+ return parseJSONLLog(raw);
3755
+ }
3400
3756
  const holomimeResult = conversationLogSchema.safeParse(raw);
3401
3757
  if (holomimeResult.success) {
3402
3758
  const log = holomimeResult.data;
@@ -3408,11 +3764,17 @@ function parseConversationLog(raw, format = "auto") {
3408
3764
  if (isClaudeExport(raw)) {
3409
3765
  return parseClaudeExport(raw);
3410
3766
  }
3767
+ if (isAnthropicAPILog(raw)) {
3768
+ return parseAnthropicAPILog(raw);
3769
+ }
3411
3770
  if (isOpenAIAPILog(raw)) {
3412
3771
  return parseOpenAIAPILog(raw);
3413
3772
  }
3773
+ if (isOTelGenAIExport(raw)) {
3774
+ return parseOTelGenAIExport(raw);
3775
+ }
3414
3776
  throw new Error(
3415
- "Unrecognized log format. Supported: holomime, chatgpt, claude, openai-api. Use --format to specify explicitly."
3777
+ "Unrecognized log format. Supported: holomime, chatgpt, claude, openai-api, anthropic-api, otel, jsonl. Use --format to specify explicitly."
3416
3778
  );
3417
3779
  }
3418
3780
  function parseHolomime(raw) {
@@ -3513,7 +3875,7 @@ async function diagnoseCommand(options) {
3513
3875
  // src/commands/assess.ts
3514
3876
  import chalk11 from "chalk";
3515
3877
  import figures6 from "figures";
3516
- import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, mkdirSync as mkdirSync2, existsSync as existsSync3 } from "fs";
3878
+ import { readFileSync as readFileSync5, writeFileSync as writeFileSync5, mkdirSync as mkdirSync2, existsSync as existsSync3 } from "fs";
3517
3879
  import { resolve as resolve7, join as join2 } from "path";
3518
3880
 
3519
3881
  // src/analysis/trait-scorer.ts
@@ -3754,7 +4116,7 @@ async function assessCommand(options) {
3754
4116
  };
3755
4117
  const date = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
3756
4118
  const filepath = join2(assessDir, `${date}.json`);
3757
- writeFileSync4(filepath, JSON.stringify(snapshot, null, 2));
4119
+ writeFileSync5(filepath, JSON.stringify(snapshot, null, 2));
3758
4120
  console.log(chalk11.dim(` Assessment saved: ${filepath}`));
3759
4121
  if (warnings.length > 0) {
3760
4122
  showSoftUpsell("assess");
@@ -3766,7 +4128,7 @@ async function assessCommand(options) {
3766
4128
  import chalk14 from "chalk";
3767
4129
  import figures7 from "figures";
3768
4130
  import { createInterface } from "readline";
3769
- import { readFileSync as readFileSync6, writeFileSync as writeFileSync6 } from "fs";
4131
+ import { readFileSync as readFileSync6, writeFileSync as writeFileSync7 } from "fs";
3770
4132
  import { resolve as resolve9 } from "path";
3771
4133
 
3772
4134
  // src/analysis/pre-session.ts
@@ -3855,7 +4217,7 @@ function runPreSessionDiagnosis(messages, spec) {
3855
4217
  }
3856
4218
 
3857
4219
  // src/analysis/session-runner.ts
3858
- import { writeFileSync as writeFileSync5, mkdirSync as mkdirSync3, existsSync as existsSync4 } from "fs";
4220
+ import { writeFileSync as writeFileSync6, mkdirSync as mkdirSync3, existsSync as existsSync4 } from "fs";
3859
4221
  import { resolve as resolve8, join as join3 } from "path";
3860
4222
 
3861
4223
  // src/analysis/therapy-protocol.ts
@@ -4287,7 +4649,7 @@ function saveTranscript(transcript, agentName) {
4287
4649
  const date = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
4288
4650
  const filename = `${date}-${slug}.json`;
4289
4651
  const filepath = join3(dir, filename);
4290
- writeFileSync5(filepath, JSON.stringify(transcript, null, 2));
4652
+ writeFileSync6(filepath, JSON.stringify(transcript, null, 2));
4291
4653
  return filepath;
4292
4654
  }
4293
4655
 
@@ -4778,7 +5140,7 @@ Exchanges: ${Math.floor(transcript.turns.filter((t) => t.speaker !== "supervisor
4778
5140
  const specPath = resolve9(process.cwd(), ".personality.json");
4779
5141
  const { changed, changes } = applyRecommendations(spec, diagnosis);
4780
5142
  if (changed) {
4781
- writeFileSync6(specPath, JSON.stringify(spec, null, 2) + "\n");
5143
+ writeFileSync7(specPath, JSON.stringify(spec, null, 2) + "\n");
4782
5144
  console.log();
4783
5145
  printBox(`${figures7.tick} Applied session recommendations to .personality.json`, "success", "Applied");
4784
5146
  console.log();
@@ -4889,7 +5251,7 @@ import { readdirSync, existsSync as existsSync6 } from "fs";
4889
5251
  import { resolve as resolve11, join as join5 } from "path";
4890
5252
 
4891
5253
  // src/analysis/evolution-history.ts
4892
- import { readFileSync as readFileSync7, writeFileSync as writeFileSync7, mkdirSync as mkdirSync4, existsSync as existsSync5 } from "fs";
5254
+ import { readFileSync as readFileSync7, writeFileSync as writeFileSync8, mkdirSync as mkdirSync4, existsSync as existsSync5 } from "fs";
4893
5255
  import { resolve as resolve10 } from "path";
4894
5256
  function getEvolutionPath() {
4895
5257
  return resolve10(process.cwd(), ".holomime", "evolution.json");
@@ -4925,7 +5287,7 @@ function appendEvolution(entry, agentName) {
4925
5287
  history.totalSessions = history.entries.length;
4926
5288
  history.totalDPOPairs = history.entries.reduce((sum, e) => sum + e.dpoPairsExtracted, 0);
4927
5289
  history.lastSession = entry.timestamp;
4928
- writeFileSync7(filepath, JSON.stringify(history, null, 2) + "\n");
5290
+ writeFileSync8(filepath, JSON.stringify(history, null, 2) + "\n");
4929
5291
  }
4930
5292
  function getEvolutionSummary(history) {
4931
5293
  const entries = history.entries;
@@ -5190,7 +5552,7 @@ async function browseCommand(options) {
5190
5552
  // src/commands/pull.ts
5191
5553
  import chalk17 from "chalk";
5192
5554
  import figures9 from "figures";
5193
- import { writeFileSync as writeFileSync8, existsSync as existsSync7 } from "fs";
5555
+ import { writeFileSync as writeFileSync9, existsSync as existsSync7 } from "fs";
5194
5556
  import { resolve as resolve12 } from "path";
5195
5557
  import { select as select2 } from "@inquirer/prompts";
5196
5558
  async function pullCommand(handle, options) {
@@ -5241,7 +5603,7 @@ async function pullCommand(handle, options) {
5241
5603
  return;
5242
5604
  }
5243
5605
  }
5244
- writeFileSync8(outputPath, JSON.stringify(result.data, null, 2) + "\n");
5606
+ writeFileSync9(outputPath, JSON.stringify(result.data, null, 2) + "\n");
5245
5607
  console.log();
5246
5608
  printBox(`${figures9.tick} Pulled ${entry.name} (@${entry.handle}) to ${outputPath}`, "success");
5247
5609
  console.log();
@@ -5333,7 +5695,7 @@ import { readFileSync as readFileSync9 } from "fs";
5333
5695
  import { resolve as resolve14 } from "path";
5334
5696
 
5335
5697
  // src/analysis/autopilot-core.ts
5336
- import { writeFileSync as writeFileSync9 } from "fs";
5698
+ import { writeFileSync as writeFileSync10 } from "fs";
5337
5699
  var SEVERITY_ORDER = ["routine", "targeted", "intervention"];
5338
5700
  function severityMeetsThreshold(severity, threshold) {
5339
5701
  const severityIdx = SEVERITY_ORDER.indexOf(severity);
@@ -5370,7 +5732,7 @@ async function runAutopilot(spec, messages, provider, options) {
5370
5732
  const specCopy = JSON.parse(JSON.stringify(spec));
5371
5733
  const { changed, changes } = applyRecommendations(specCopy, diagnosis);
5372
5734
  if (changed && options?.specPath) {
5373
- writeFileSync9(options.specPath, JSON.stringify(specCopy, null, 2) + "\n");
5735
+ writeFileSync10(options.specPath, JSON.stringify(specCopy, null, 2) + "\n");
5374
5736
  }
5375
5737
  saveTranscript(transcript, spec.name ?? "Agent");
5376
5738
  return {
@@ -5540,7 +5902,7 @@ async function autopilotCommand(options) {
5540
5902
  // src/commands/export.ts
5541
5903
  import chalk20 from "chalk";
5542
5904
  import figures12 from "figures";
5543
- import { writeFileSync as writeFileSync10 } from "fs";
5905
+ import { writeFileSync as writeFileSync11 } from "fs";
5544
5906
  import { resolve as resolve15 } from "path";
5545
5907
 
5546
5908
  // src/analysis/training-export.ts
@@ -5891,12 +6253,12 @@ Run ${chalk20.cyan("holomime session")} first to generate session transcripts.`,
5891
6253
  mkdirSync15(dir, { recursive: true });
5892
6254
  if (format === "huggingface" || format === "openai") {
5893
6255
  const jsonl = convertToHFFormat(result);
5894
- writeFileSync10(fullPath, jsonl);
6256
+ writeFileSync11(fullPath, jsonl);
5895
6257
  } else if (format === "jsonl") {
5896
6258
  const lines = result.examples.map((ex) => JSON.stringify(ex)).join("\n");
5897
- writeFileSync10(fullPath, lines + "\n");
6259
+ writeFileSync11(fullPath, lines + "\n");
5898
6260
  } else {
5899
- writeFileSync10(fullPath, JSON.stringify(result, null, 2) + "\n");
6261
+ writeFileSync11(fullPath, JSON.stringify(result, null, 2) + "\n");
5900
6262
  }
5901
6263
  console.log(` ${chalk20.green(figures12.tick)} Written to ${chalk20.cyan(outputPath)}`);
5902
6264
  console.log();
@@ -5981,7 +6343,7 @@ This is the closed-loop behavioral alignment system.`,
5981
6343
  // src/commands/train.ts
5982
6344
  import chalk21 from "chalk";
5983
6345
  import figures13 from "figures";
5984
- import { readFileSync as readFileSync12, writeFileSync as writeFileSync13, mkdirSync as mkdirSync7, readdirSync as readdirSync3, existsSync as existsSync9 } from "fs";
6346
+ import { readFileSync as readFileSync12, writeFileSync as writeFileSync14, mkdirSync as mkdirSync7, readdirSync as readdirSync3, existsSync as existsSync9 } from "fs";
5985
6347
  import { resolve as resolve19, join as join9 } from "path";
5986
6348
 
5987
6349
  // src/analysis/train-provider.ts
@@ -6193,7 +6555,7 @@ var OpenAITrainProvider = class {
6193
6555
 
6194
6556
  // src/analysis/train-huggingface.ts
6195
6557
  import { spawn } from "child_process";
6196
- import { writeFileSync as writeFileSync11, mkdirSync as mkdirSync5 } from "fs";
6558
+ import { writeFileSync as writeFileSync12, mkdirSync as mkdirSync5 } from "fs";
6197
6559
  import { resolve as resolve17, join as join7 } from "path";
6198
6560
  import { createInterface as createInterface2 } from "readline";
6199
6561
  async function checkPythonDeps() {
@@ -6226,7 +6588,7 @@ function writeHFTrainingFile(data) {
6226
6588
  const tmpDir = resolve17(process.cwd(), ".holomime/tmp");
6227
6589
  mkdirSync5(tmpDir, { recursive: true });
6228
6590
  const filePath = join7(tmpDir, `hf-train-${Date.now()}.json`);
6229
- writeFileSync11(filePath, JSON.stringify(data, null, 2));
6591
+ writeFileSync12(filePath, JSON.stringify(data, null, 2));
6230
6592
  return filePath;
6231
6593
  }
6232
6594
  var HuggingFaceTrainProvider = class {
@@ -6345,7 +6707,7 @@ var HuggingFaceTrainProvider = class {
6345
6707
 
6346
6708
  // src/analysis/train-eval.ts
6347
6709
  import { spawn as spawn2 } from "child_process";
6348
- import { writeFileSync as writeFileSync12, mkdirSync as mkdirSync6 } from "fs";
6710
+ import { writeFileSync as writeFileSync13, mkdirSync as mkdirSync6 } from "fs";
6349
6711
  import { resolve as resolve18, join as join8 } from "path";
6350
6712
  import { createInterface as createInterface3 } from "readline";
6351
6713
 
@@ -6596,7 +6958,7 @@ async function runHFAutoEval(baseModel, fineTunedModel, agentName, data, onProgr
6596
6958
  const tmpDir = resolve18(process.cwd(), ".holomime/tmp");
6597
6959
  mkdirSync6(tmpDir, { recursive: true });
6598
6960
  const promptsPath = join8(tmpDir, `eval-prompts-${Date.now()}.json`);
6599
- writeFileSync12(promptsPath, JSON.stringify(prompts));
6961
+ writeFileSync13(promptsPath, JSON.stringify(prompts));
6600
6962
  const scriptPath = resolve18(
6601
6963
  new URL(".", import.meta.url).pathname,
6602
6964
  "../../scripts/eval_hf.py"
@@ -6691,7 +7053,7 @@ function deployModel(result, personalityPath) {
6691
7053
  deployedAt: (/* @__PURE__ */ new Date()).toISOString(),
6692
7054
  personalityPath
6693
7055
  };
6694
- writeFileSync13(
7056
+ writeFileSync14(
6695
7057
  join9(trainingDir, "latest.json"),
6696
7058
  JSON.stringify(record, null, 2) + "\n"
6697
7059
  );
@@ -6706,7 +7068,7 @@ function deployModel(result, personalityPath) {
6706
7068
  examples: result.examples,
6707
7069
  trained_at: (/* @__PURE__ */ new Date()).toISOString()
6708
7070
  };
6709
- writeFileSync13(fullPath, JSON.stringify(spec, null, 2) + "\n");
7071
+ writeFileSync14(fullPath, JSON.stringify(spec, null, 2) + "\n");
6710
7072
  }
6711
7073
  }
6712
7074
  async function trainCommand(options) {
@@ -7062,7 +7424,7 @@ import { readFileSync as readFileSync14 } from "fs";
7062
7424
  import { resolve as resolve21 } from "path";
7063
7425
 
7064
7426
  // src/analysis/evolve-core.ts
7065
- import { writeFileSync as writeFileSync14 } from "fs";
7427
+ import { writeFileSync as writeFileSync15 } from "fs";
7066
7428
  async function runEvolve(spec, messages, provider, options) {
7067
7429
  const maxIterations = options?.maxIterations ?? 5;
7068
7430
  const convergenceThreshold = options?.convergenceThreshold ?? 85;
@@ -7175,7 +7537,7 @@ async function runEvolve(spec, messages, provider, options) {
7175
7537
  }
7176
7538
  }
7177
7539
  if (options?.specPath) {
7178
- writeFileSync14(options.specPath, JSON.stringify(currentSpec, null, 2) + "\n");
7540
+ writeFileSync15(options.specPath, JSON.stringify(currentSpec, null, 2) + "\n");
7179
7541
  }
7180
7542
  let trainingExport;
7181
7543
  if (allDPOPairs.length > 0) {
@@ -7187,7 +7549,7 @@ async function runEvolve(spec, messages, provider, options) {
7187
7549
  generated_at: (/* @__PURE__ */ new Date()).toISOString()
7188
7550
  };
7189
7551
  if (options?.exportDpoPath) {
7190
- writeFileSync14(options.exportDpoPath, JSON.stringify(trainingExport, null, 2) + "\n");
7552
+ writeFileSync15(options.exportDpoPath, JSON.stringify(trainingExport, null, 2) + "\n");
7191
7553
  }
7192
7554
  }
7193
7555
  return {
@@ -7599,7 +7961,7 @@ function gradeFromScore2(score) {
7599
7961
  }
7600
7962
 
7601
7963
  // src/analysis/benchmark-publish.ts
7602
- import { readFileSync as readFileSync15, writeFileSync as writeFileSync15, existsSync as existsSync10, mkdirSync as mkdirSync8, readdirSync as readdirSync4 } from "fs";
7964
+ import { readFileSync as readFileSync15, writeFileSync as writeFileSync16, existsSync as existsSync10, mkdirSync as mkdirSync8, readdirSync as readdirSync4 } from "fs";
7603
7965
  import { join as join10 } from "path";
7604
7966
  import { homedir as homedir2 } from "os";
7605
7967
  function getBenchmarkDir(outputDir) {
@@ -7630,7 +7992,7 @@ function saveBenchmarkResult(report, outputDir) {
7630
7992
  scenarioCount: report.results.length
7631
7993
  }
7632
7994
  };
7633
- writeFileSync15(filepath, JSON.stringify(published, null, 2));
7995
+ writeFileSync16(filepath, JSON.stringify(published, null, 2));
7634
7996
  return filepath;
7635
7997
  }
7636
7998
  function loadBenchmarkResults(dir) {
@@ -7858,7 +8220,7 @@ import { existsSync as existsSync12 } from "fs";
7858
8220
  import { resolve as resolve24 } from "path";
7859
8221
 
7860
8222
  // src/analysis/watch-core.ts
7861
- import { readdirSync as readdirSync5, readFileSync as readFileSync17, writeFileSync as writeFileSync16, mkdirSync as mkdirSync9, existsSync as existsSync11 } from "fs";
8223
+ import { readdirSync as readdirSync5, readFileSync as readFileSync17, writeFileSync as writeFileSync17, mkdirSync as mkdirSync9, existsSync as existsSync11 } from "fs";
7862
8224
  import { join as join11, resolve as resolve23 } from "path";
7863
8225
  var SEVERITY_ORDER2 = ["routine", "targeted", "intervention"];
7864
8226
  function severityMeetsThreshold2(severity, threshold) {
@@ -7960,7 +8322,7 @@ function startWatch(spec, options) {
7960
8322
  if (!existsSync11(logDir)) {
7961
8323
  mkdirSync9(logDir, { recursive: true });
7962
8324
  }
7963
- writeFileSync16(
8325
+ writeFileSync17(
7964
8326
  join11(logDir, "watch-log.json"),
7965
8327
  JSON.stringify({ events, stoppedAt: (/* @__PURE__ */ new Date()).toISOString() }, null, 2) + "\n"
7966
8328
  );
@@ -8108,7 +8470,7 @@ import { readFileSync as readFileSync19 } from "fs";
8108
8470
  import { resolve as resolve26 } from "path";
8109
8471
 
8110
8472
  // src/analysis/certify-core.ts
8111
- import { writeFileSync as writeFileSync17, mkdirSync as mkdirSync10, existsSync as existsSync13 } from "fs";
8473
+ import { writeFileSync as writeFileSync18, mkdirSync as mkdirSync10, existsSync as existsSync13 } from "fs";
8112
8474
  import { join as join12, resolve as resolve25 } from "path";
8113
8475
  function djb2Hash(str) {
8114
8476
  let hash = 0;
@@ -8229,7 +8591,7 @@ function saveCredential(credential, outputDir) {
8229
8591
  const date = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
8230
8592
  const filename = `${credential.agent.handle}-${date}.json`;
8231
8593
  const filepath = join12(dir, filename);
8232
- writeFileSync17(filepath, JSON.stringify(credential, null, 2) + "\n");
8594
+ writeFileSync18(filepath, JSON.stringify(credential, null, 2) + "\n");
8233
8595
  return filepath;
8234
8596
  }
8235
8597
 
@@ -8349,7 +8711,7 @@ async function certifyCommand(options) {
8349
8711
 
8350
8712
  // src/commands/daemon.ts
8351
8713
  import chalk27 from "chalk";
8352
- import { writeFileSync as writeFileSync18, readFileSync as readFileSync20, mkdirSync as mkdirSync11, existsSync as existsSync14 } from "fs";
8714
+ import { writeFileSync as writeFileSync19, readFileSync as readFileSync20, mkdirSync as mkdirSync11, existsSync as existsSync14 } from "fs";
8353
8715
  import { resolve as resolve27 } from "path";
8354
8716
  var HOLOMIME_DIR = ".holomime";
8355
8717
  function getDaemonStatePath() {
@@ -8366,7 +8728,7 @@ function ensureDir() {
8366
8728
  }
8367
8729
  function writeDaemonState(state) {
8368
8730
  ensureDir();
8369
- writeFileSync18(getDaemonStatePath(), JSON.stringify(state, null, 2) + "\n");
8731
+ writeFileSync19(getDaemonStatePath(), JSON.stringify(state, null, 2) + "\n");
8370
8732
  }
8371
8733
  function appendDaemonLog(event) {
8372
8734
  ensureDir();
@@ -8380,7 +8742,7 @@ function appendDaemonLog(event) {
8380
8742
  log = [];
8381
8743
  }
8382
8744
  log.push(event);
8383
- writeFileSync18(logPath, JSON.stringify(log, null, 2) + "\n");
8745
+ writeFileSync19(logPath, JSON.stringify(log, null, 2) + "\n");
8384
8746
  }
8385
8747
  async function daemonCommand(options) {
8386
8748
  printHeader("Daemon Mode");
@@ -8541,7 +8903,7 @@ Log: ${getDaemonLogPath()}`,
8541
8903
  // src/commands/fleet.ts
8542
8904
  import chalk28 from "chalk";
8543
8905
  import figures19 from "figures";
8544
- import { writeFileSync as writeFileSync19, mkdirSync as mkdirSync12, existsSync as existsSync16 } from "fs";
8906
+ import { writeFileSync as writeFileSync20, mkdirSync as mkdirSync12, existsSync as existsSync16 } from "fs";
8545
8907
  import { resolve as resolve29, join as join15 } from "path";
8546
8908
 
8547
8909
  // src/analysis/fleet-core.ts
@@ -8824,7 +9186,7 @@ Press Ctrl+C for fleet summary`,
8824
9186
  mkdirSync12(logDir, { recursive: true });
8825
9187
  }
8826
9188
  const logPath = join15(logDir, "fleet-log.json");
8827
- writeFileSync19(
9189
+ writeFileSync20(
8828
9190
  logPath,
8829
9191
  JSON.stringify({
8830
9192
  stoppedAt: (/* @__PURE__ */ new Date()).toISOString(),
@@ -8845,7 +9207,7 @@ Press Ctrl+C for fleet summary`,
8845
9207
  // src/commands/activate.ts
8846
9208
  import chalk30 from "chalk";
8847
9209
  import figures20 from "figures";
8848
- import { writeFileSync as writeFileSync21, mkdirSync as mkdirSync14, existsSync as existsSync18 } from "fs";
9210
+ import { writeFileSync as writeFileSync22, mkdirSync as mkdirSync14, existsSync as existsSync18 } from "fs";
8849
9211
  import { join as join17 } from "path";
8850
9212
  import { homedir as homedir4 } from "os";
8851
9213
 
@@ -8853,7 +9215,7 @@ import { homedir as homedir4 } from "os";
8853
9215
  import { PostHog } from "posthog-node";
8854
9216
 
8855
9217
  // src/telemetry/config.ts
8856
- import { readFileSync as readFileSync22, writeFileSync as writeFileSync20, mkdirSync as mkdirSync13, existsSync as existsSync17 } from "fs";
9218
+ import { readFileSync as readFileSync22, writeFileSync as writeFileSync21, mkdirSync as mkdirSync13, existsSync as existsSync17 } from "fs";
8857
9219
  import { join as join16 } from "path";
8858
9220
  import { homedir as homedir3 } from "os";
8859
9221
  import { randomUUID } from "crypto";
@@ -8877,7 +9239,7 @@ function readConfig() {
8877
9239
  }
8878
9240
  function writeConfig(config) {
8879
9241
  ensureDir2();
8880
- writeFileSync20(CONFIG_PATH, JSON.stringify(config, null, 2) + "\n");
9242
+ writeFileSync21(CONFIG_PATH, JSON.stringify(config, null, 2) + "\n");
8881
9243
  }
8882
9244
  function shouldTrack() {
8883
9245
  if (process.env.HOLOMIME_TELEMETRY === "0") return false;
@@ -8898,7 +9260,7 @@ function getAnonymousId() {
8898
9260
  }
8899
9261
  const id = randomUUID();
8900
9262
  ensureDir2();
8901
- writeFileSync20(ANON_ID_PATH, id);
9263
+ writeFileSync21(ANON_ID_PATH, id);
8902
9264
  return id;
8903
9265
  }
8904
9266
  function showTelemetryBannerIfNeeded() {
@@ -8992,7 +9354,7 @@ async function activateCommand(key) {
8992
9354
  if (!existsSync18(holomimeDir)) {
8993
9355
  mkdirSync14(holomimeDir, { recursive: true });
8994
9356
  }
8995
- writeFileSync21(licensePath, trimmedKey);
9357
+ writeFileSync22(licensePath, trimmedKey);
8996
9358
  console.log(chalk30.dim(" Validating license..."));
8997
9359
  const result = await validateLicense(trimmedKey);
8998
9360
  if (result.valid) {
@@ -9091,21 +9453,21 @@ program.name("holomime").description("Personality engine for AI agents \u2014 Bi
9091
9453
  program.command("init").description("Build a personality profile through a guided assessment").action(initCommand);
9092
9454
  program.command("compile").description("Compile .personality.json into a provider-specific runtime config").option("--provider <provider>", "Target provider (anthropic, openai, gemini, ollama)", "anthropic").option("--surface <surface>", "Target surface (chat, email, code_review, slack, api)", "chat").option("--for <format>", "Compile for a specific format (openclaw)").option("-o, --output <path>", "Write output to file instead of stdout").action(compileCommand);
9093
9455
  program.command("validate").description("Validate .personality.json schema and psychological coherence").action(validateCommand);
9094
- program.command("profile").description("Pretty-print a human-readable personality summary").action(profileCommand);
9095
- program.command("diagnose").description("Detect behavioral patterns from conversation logs (rule-based, no LLM)").requiredOption("--log <path>", "Path to conversation log (JSON)").option("--format <format>", "Log format (auto, holomime, chatgpt, claude, openai-api)", "auto").action(diagnoseCommand);
9096
- program.command("assess").description("Full Big Five alignment check \u2014 compare spec vs actual behavior").requiredOption("--personality <path>", "Path to .personality.json").requiredOption("--log <path>", "Path to conversation log (JSON)").option("--format <format>", "Log format (auto, holomime, chatgpt, claude, openai-api)", "auto").action(assessCommand);
9456
+ program.command("profile").description("Pretty-print a human-readable personality summary").option("--format <format>", "Output format (terminal, md)", "terminal").option("-o, --output <path>", "Write output to file (for md format)").action(profileCommand);
9457
+ program.command("diagnose").description("Detect behavioral patterns from conversation logs (rule-based, no LLM)").requiredOption("--log <path>", "Path to conversation log (JSON)").option("--format <format>", "Log format (auto, holomime, chatgpt, claude, openai-api, anthropic-api, otel, jsonl)", "auto").action(diagnoseCommand);
9458
+ program.command("assess").description("Full Big Five alignment check \u2014 compare spec vs actual behavior").requiredOption("--personality <path>", "Path to .personality.json").requiredOption("--log <path>", "Path to conversation log (JSON)").option("--format <format>", "Log format (auto, holomime, chatgpt, claude, openai-api, anthropic-api, otel, jsonl)", "auto").action(assessCommand);
9097
9459
  program.command("browse").description("Browse shared personality profiles from the community registry").option("--tag <tag>", "Filter by tag").action(browseCommand);
9098
9460
  program.command("pull").description("Download a personality profile from the registry").argument("<handle>", "Personality handle to pull").option("-o, --output <path>", "Output path", ".personality.json").action(pullCommand);
9099
9461
  program.command("publish").description("Share your personality profile to the community registry").option("--personality <path>", "Path to .personality.json", ".personality.json").action(publishCommand);
9100
9462
  program.command("activate").description("Activate a Pro license key").argument("<key>", "License key from holomime.dev").action(activateCommand);
9101
9463
  program.command("telemetry").description("Manage anonymous usage telemetry").argument("[action]", "enable, disable, or status (default: status)").action(telemetryCommand);
9102
- program.command("session").description("Live alignment session \u2014 behavioral refinement for your agent [Pro]").requiredOption("--personality <path>", "Path to .personality.json").option("--provider <provider>", "LLM provider (ollama, anthropic, openai)", "ollama").option("--model <model>", "Model override (e.g. claude-sonnet-4-20250514, gpt-4o)").option("--log <path>", "Conversation log for pre-session diagnosis").option("--format <format>", "Log format (auto, holomime, chatgpt, claude, openai-api)", "auto").option("--turns <n>", "Maximum session turns", "24").option("--observe", "Observe mode (watch without intervention)").option("--interactive", "Supervisor mode \u2014 intervene mid-session with directives").option("--apply", "Apply recommendations to .personality.json after session").action(sessionCommand);
9103
- program.command("autopilot").description("Automated behavioral alignment \u2014 diagnose, refine, and apply [Pro]").requiredOption("--personality <path>", "Path to .personality.json").requiredOption("--log <path>", "Conversation log for diagnosis").option("--provider <provider>", "LLM provider (ollama, anthropic, openai)", "ollama").option("--model <model>", "Model override").option("--format <format>", "Log format (auto, holomime, chatgpt, claude, openai-api)", "auto").option("--threshold <level>", "Trigger threshold (routine, targeted, intervention)", "targeted").option("--turns <n>", "Maximum session turns", "24").option("--dry-run", "Show what would happen without running alignment").option("--apply", "Apply recommendations to .personality.json after session").action(autopilotCommand);
9464
+ program.command("session").description("Live alignment session \u2014 behavioral refinement for your agent [Pro]").requiredOption("--personality <path>", "Path to .personality.json").option("--provider <provider>", "LLM provider (ollama, anthropic, openai)", "ollama").option("--model <model>", "Model override (e.g. claude-sonnet-4-20250514, gpt-4o)").option("--log <path>", "Conversation log for pre-session diagnosis").option("--format <format>", "Log format (auto, holomime, chatgpt, claude, openai-api, anthropic-api, otel, jsonl)", "auto").option("--turns <n>", "Maximum session turns", "24").option("--observe", "Observe mode (watch without intervention)").option("--interactive", "Supervisor mode \u2014 intervene mid-session with directives").option("--apply", "Apply recommendations to .personality.json after session").action(sessionCommand);
9465
+ program.command("autopilot").description("Automated behavioral alignment \u2014 diagnose, refine, and apply [Pro]").requiredOption("--personality <path>", "Path to .personality.json").requiredOption("--log <path>", "Conversation log for diagnosis").option("--provider <provider>", "LLM provider (ollama, anthropic, openai)", "ollama").option("--model <model>", "Model override").option("--format <format>", "Log format (auto, holomime, chatgpt, claude, openai-api, anthropic-api, otel, jsonl)", "auto").option("--threshold <level>", "Trigger threshold (routine, targeted, intervention)", "targeted").option("--turns <n>", "Maximum session turns", "24").option("--dry-run", "Show what would happen without running alignment").option("--apply", "Apply recommendations to .personality.json after session").action(autopilotCommand);
9104
9466
  program.command("growth").description("Track improvement over time from assessment history [Pro]").requiredOption("--personality <path>", "Path to .personality.json").option("--history <path>", "Path to assessments directory", ".holomime/assessments").action(growthCommand);
9105
9467
  program.command("export").description("Export alignment sessions as training data (DPO, RLHF, Alpaca, HuggingFace, OpenAI) [Pro]").requiredOption("--format <format>", "Export format (dpo, rlhf, jsonl, alpaca, huggingface, openai)").option("--sessions <path>", "Path to sessions directory", ".holomime/sessions").option("-o, --output <path>", "Output file path").option("--push", "Push to HuggingFace Hub after export (requires HF_TOKEN)").option("--repo <repo>", "HuggingFace Hub repo name for push (e.g. user/dataset-name)").action(exportCommand);
9106
9468
  program.command("train").description("Fine-tune a model with alignment data \u2014 train, deploy, and verify [Pro]").option("--data <path>", "Path to exported training data").option("--provider <provider>", "Training provider (openai, huggingface)", "openai").option("--base-model <model>", "Base model to fine-tune", "gpt-4o-mini").option("--suffix <suffix>", "Model name suffix").option("--epochs <n>", "Training epochs").option("--method <method>", "Training method (auto, sft, dpo)", "auto").option("--personality <path>", "Path to .personality.json", ".personality.json").option("--skip-eval", "Skip auto-evaluation after training").option("--skip-deploy", "Skip auto-deploy to personality").option("--dry-run", "Preview training plan without starting").option("--push", "Push trained model to HuggingFace Hub (HF only)").option("--hub-repo <repo>", "HuggingFace Hub repo name for push (e.g. user/model-name)").action(trainCommand);
9107
- program.command("eval").description("Measure alignment effectiveness \u2014 compare before/after behavior [Pro]").requiredOption("--before <path>", "Conversation log from BEFORE alignment").requiredOption("--after <path>", "Conversation log from AFTER alignment").option("--personality <path>", "Path to .personality.json (for agent name)").option("--format <format>", "Log format (auto, holomime, chatgpt, claude, openai-api)", "auto").action(evalCommand);
9108
- program.command("evolve").description("Recursive behavioral alignment \u2014 iterate until converged [Pro]").requiredOption("--personality <path>", "Path to .personality.json").requiredOption("--log <path>", "Conversation log for diagnosis").option("--provider <provider>", "LLM provider (ollama, anthropic, openai)", "ollama").option("--model <model>", "Model override").option("--format <format>", "Log format (auto, holomime, chatgpt, claude, openai-api)", "auto").option("--max-iterations <n>", "Maximum alignment iterations", "5").option("--convergence <score>", "TES convergence threshold (0-100)", "85").option("--turns <n>", "Max turns per session", "18").option("--apply", "Apply final recommendations to .personality.json").option("--export-dpo <path>", "Export accumulated DPO pairs to file").option("--dry-run", "Preview without running sessions").action(evolveCommand);
9469
+ program.command("eval").description("Measure alignment effectiveness \u2014 compare before/after behavior [Pro]").requiredOption("--before <path>", "Conversation log from BEFORE alignment").requiredOption("--after <path>", "Conversation log from AFTER alignment").option("--personality <path>", "Path to .personality.json (for agent name)").option("--format <format>", "Log format (auto, holomime, chatgpt, claude, openai-api, anthropic-api, otel, jsonl)", "auto").action(evalCommand);
9470
+ program.command("evolve").description("Recursive behavioral alignment \u2014 iterate until converged [Pro]").requiredOption("--personality <path>", "Path to .personality.json").requiredOption("--log <path>", "Conversation log for diagnosis").option("--provider <provider>", "LLM provider (ollama, anthropic, openai)", "ollama").option("--model <model>", "Model override").option("--format <format>", "Log format (auto, holomime, chatgpt, claude, openai-api, anthropic-api, otel, jsonl)", "auto").option("--max-iterations <n>", "Maximum alignment iterations", "5").option("--convergence <score>", "TES convergence threshold (0-100)", "85").option("--turns <n>", "Max turns per session", "18").option("--apply", "Apply final recommendations to .personality.json").option("--export-dpo <path>", "Export accumulated DPO pairs to file").option("--dry-run", "Preview without running sessions").action(evolveCommand);
9109
9471
  program.command("benchmark").description("Behavioral stress test \u2014 7 scenarios targeting each detector [Pro]").requiredOption("--personality <path>", "Path to .personality.json").option("--provider <provider>", "LLM provider (ollama, anthropic, openai)", "ollama").option("--model <model>", "Model override").option("--scenarios <list>", "Comma-separated scenario filter (e.g. apology-trap,sycophancy-test)").action(benchmarkCommand);
9110
9472
  program.command("watch").description("Continuous drift detection \u2014 monitor logs and auto-align [Pro]").requiredOption("--personality <path>", "Path to .personality.json").requiredOption("--dir <path>", "Directory to watch for conversation logs").option("--provider <provider>", "LLM provider (ollama, anthropic, openai)", "ollama").option("--model <model>", "Model override").option("--interval <ms>", "Check interval in milliseconds", "30000").option("--threshold <level>", "Drift threshold (routine, targeted, intervention)", "targeted").option("--auto-evolve", "Auto-run evolve when drift detected").action(watchCommand);
9111
9473
  program.command("certify").description("Generate a verifiable behavioral credential for your agent [Pro]").option("--personality <path>", "Path to .personality.json", ".personality.json").option("--benchmark <path>", "Path to benchmark report JSON").option("--evolve <path>", "Path to evolve result JSON").option("-o, --output <path>", "Output directory for credential").option("--verify <path>", "Verify an existing credential").action(certifyCommand);