holomime 3.3.10 → 3.5.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.
Files changed (3) hide show
  1. package/README.md +9 -1
  2. package/dist/cli.js +496 -332
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -9,6 +9,38 @@ var __export = (target, all) => {
9
9
  __defProp(target, name, { get: all[name], enumerable: true });
10
10
  };
11
11
 
12
+ // src/ui/branding.ts
13
+ import chalk from "chalk";
14
+ import gradientString from "gradient-string";
15
+ function printBanner() {
16
+ console.log();
17
+ console.log(holomimeGradient(LOGO));
18
+ console.log();
19
+ console.log(` ${chalk.dim("Behavioral intelligence for AI agents and humanoid robots")} ${chalk.bgCyan.black(` v${VERSION} `)}`);
20
+ console.log();
21
+ }
22
+ function printHeader(title) {
23
+ const line = "\u2550".repeat(title.length + 4);
24
+ console.log();
25
+ console.log(holomimeGradient(` ${line}`));
26
+ console.log(holomimeGradient(` \u2551 ${title} \u2551`));
27
+ console.log(holomimeGradient(` ${line}`));
28
+ console.log();
29
+ }
30
+ var VERSION, LOGO, holomimeGradient;
31
+ var init_branding = __esm({
32
+ "src/ui/branding.ts"() {
33
+ "use strict";
34
+ VERSION = "3.5.0";
35
+ LOGO = ` _ _ _
36
+ | |__ ___ | | ___ _ __ (_)_ __ ___ ___
37
+ | '_ \\ / _ \\| |/ _ \\| '_ \\| | '_ \` _ \\ / _ \\
38
+ | | | | (_) | | (_) | | | | | | | | | | __/
39
+ |_| |_|\\___/|_|\\___/|_| |_|_|_| |_| |_|\\___|`;
40
+ holomimeGradient = gradientString("#00d4ff", "#b347d9");
41
+ }
42
+ });
43
+
12
44
  // src/core/embodiment-types.ts
13
45
  import { z } from "zod";
14
46
  var modalitySchema, morphologySchema, safetyEnvelopeSchema, embodimentSchema, gazePolicySchema, proxemicZoneSchema, hapticPolicySchema, prosodySchema, gestureSchema, expressionSchema, physicalSafetySchema, motionParametersSchema, compiledEmbodiedConfigSchema;
@@ -3587,34 +3619,164 @@ var init_generic_adapter = __esm({
3587
3619
  }
3588
3620
  });
3589
3621
 
3590
- // src/cli.ts
3591
- import { Command } from "commander";
3592
-
3593
- // src/ui/branding.ts
3594
- import chalk from "chalk";
3595
- import gradientString from "gradient-string";
3596
- var VERSION = "3.3.10";
3597
- var LOGO = ` _ _ _
3598
- | |__ ___ | | ___ _ __ (_)_ __ ___ ___
3599
- | '_ \\ / _ \\| |/ _ \\| '_ \\| | '_ \` _ \\ / _ \\
3600
- | | | | (_) | | (_) | | | | | | | | | | __/
3601
- |_| |_|\\___/|_|\\___/|_| |_|_|_| |_| |_|\\___|`;
3602
- var holomimeGradient = gradientString("#00d4ff", "#b347d9");
3603
- function printBanner() {
3622
+ // src/commands/config.ts
3623
+ var config_exports = {};
3624
+ __export(config_exports, {
3625
+ configCommand: () => configCommand,
3626
+ getConfigDir: () => getConfigDir,
3627
+ getConfigPath: () => getConfigPath,
3628
+ loadConfig: () => loadConfig2,
3629
+ saveConfig: () => saveConfig
3630
+ });
3631
+ import { readFileSync as readFileSync45, writeFileSync as writeFileSync37, existsSync as existsSync41, mkdirSync as mkdirSync26 } from "fs";
3632
+ import { join as join37 } from "path";
3633
+ import { homedir as homedir8 } from "os";
3634
+ import chalk44 from "chalk";
3635
+ function getConfigPath() {
3636
+ return join37(homedir8(), ".holomime", "config.json");
3637
+ }
3638
+ function getConfigDir() {
3639
+ return join37(homedir8(), ".holomime");
3640
+ }
3641
+ function loadConfig2() {
3642
+ const configPath = getConfigPath();
3643
+ if (!existsSync41(configPath)) return null;
3644
+ try {
3645
+ const data = JSON.parse(readFileSync45(configPath, "utf-8"));
3646
+ if (data.provider && data.apiKey) return data;
3647
+ return null;
3648
+ } catch {
3649
+ return null;
3650
+ }
3651
+ }
3652
+ function saveConfig(config) {
3653
+ const configDir = getConfigDir();
3654
+ mkdirSync26(configDir, { recursive: true });
3655
+ writeFileSync37(getConfigPath(), JSON.stringify(config, null, 2));
3656
+ }
3657
+ async function configCommand(options) {
3658
+ printHeader("Config");
3659
+ if (options.show) {
3660
+ const config = loadConfig2();
3661
+ if (config) {
3662
+ const mask = (k) => k.slice(0, 8) + "..." + k.slice(-4);
3663
+ console.log(chalk44.dim(" Provider: ") + chalk44.cyan(config.provider));
3664
+ console.log(chalk44.dim(" API Key: ") + chalk44.cyan(mask(config.apiKey)));
3665
+ if (config.openaiKey) {
3666
+ console.log(chalk44.dim(" OpenAI Key: ") + chalk44.cyan(mask(config.openaiKey)));
3667
+ }
3668
+ if (config.hfToken) {
3669
+ console.log(chalk44.dim(" HF Token: ") + chalk44.cyan(mask(config.hfToken)));
3670
+ }
3671
+ if (config.model) {
3672
+ console.log(chalk44.dim(" Model: ") + chalk44.cyan(config.model));
3673
+ }
3674
+ console.log(chalk44.dim(" Config: ") + getConfigPath());
3675
+ } else {
3676
+ console.log(chalk44.yellow(" No config found. Run `holomime config` to set up."));
3677
+ }
3678
+ console.log();
3679
+ return;
3680
+ }
3681
+ if (options.provider && options.key) {
3682
+ const config = {
3683
+ provider: options.provider,
3684
+ apiKey: options.key
3685
+ };
3686
+ saveConfig(config);
3687
+ console.log(chalk44.green(" Config saved!"));
3688
+ console.log(chalk44.dim(` Provider: ${config.provider}`));
3689
+ console.log(chalk44.dim(` Location: ${getConfigPath()}`));
3690
+ console.log();
3691
+ printNextSteps();
3692
+ return;
3693
+ }
3694
+ console.log(chalk44.dim(" Set up your API key so every command just works."));
3695
+ console.log(chalk44.dim(" This saves to ~/.holomime/config.json (one-time setup)."));
3604
3696
  console.log();
3605
- console.log(holomimeGradient(LOGO));
3697
+ const readline = await import("readline");
3698
+ const rl = readline.createInterface({
3699
+ input: process.stdin,
3700
+ output: process.stdout
3701
+ });
3702
+ const ask = (question) => new Promise((resolve57) => rl.question(question, resolve57));
3703
+ try {
3704
+ console.log(chalk44.dim(" 1) anthropic") + chalk44.dim(" enter your sk-ant-... key"));
3705
+ console.log(chalk44.dim(" 2) openai") + chalk44.dim(" enter your sk-... key"));
3706
+ console.log();
3707
+ const providerInput = (await ask(" Select provider (1 or 2): ")).trim();
3708
+ let provider;
3709
+ if (providerInput === "1" || providerInput.toLowerCase() === "anthropic") {
3710
+ provider = "anthropic";
3711
+ } else if (providerInput === "2" || providerInput.toLowerCase() === "openai") {
3712
+ provider = "openai";
3713
+ } else if (providerInput === "") {
3714
+ console.log(chalk44.dim(" Skipped. Run `holomime config` when ready."));
3715
+ rl.close();
3716
+ return;
3717
+ } else {
3718
+ console.log(chalk44.red(` Invalid selection: ${providerInput}`));
3719
+ rl.close();
3720
+ return;
3721
+ }
3722
+ console.log(chalk44.dim(` Selected: ${provider}`));
3723
+ console.log();
3724
+ const keyHint = provider === "anthropic" ? "sk-ant-..." : "sk-...";
3725
+ const apiKey = (await ask(` API Key (${keyHint}): `)).trim();
3726
+ if (!apiKey) {
3727
+ console.log(chalk44.dim(" Skipped. Run `holomime config` when ready."));
3728
+ rl.close();
3729
+ return;
3730
+ }
3731
+ const config = { provider, apiKey };
3732
+ console.log();
3733
+ if (provider === "anthropic") {
3734
+ console.log(chalk44.dim(" Optional: OpenAI key for fine-tuning (press enter to skip)"));
3735
+ const openaiKey = (await ask(" OpenAI Key (sk-...): ")).trim();
3736
+ if (openaiKey) config.openaiKey = openaiKey;
3737
+ }
3738
+ console.log(chalk44.dim(" Optional: HuggingFace token for dataset export (press enter to skip)"));
3739
+ const hfToken = (await ask(" HF Token (hf_...): ")).trim();
3740
+ if (hfToken) config.hfToken = hfToken;
3741
+ saveConfig(config);
3742
+ console.log();
3743
+ console.log(chalk44.green(" Config saved!"));
3744
+ console.log(chalk44.dim(` Location: ${getConfigPath()}`));
3745
+ if (provider === "anthropic" && !config.openaiKey) {
3746
+ console.log(chalk44.dim(" Note: Add an OpenAI key later for fine-tuning: holomime config"));
3747
+ }
3748
+ console.log();
3749
+ printNextSteps();
3750
+ rl.close();
3751
+ } catch {
3752
+ rl.close();
3753
+ }
3754
+ }
3755
+ function printNextSteps() {
3756
+ console.log(chalk44.bold(" NEXT STEP") + chalk44.dim(" \u2014 profile your agent:"));
3606
3757
  console.log();
3607
- console.log(` ${chalk.dim("Behavioral intelligence for AI agents and humanoid robots")} ${chalk.bgCyan.black(` v${VERSION} `)}`);
3758
+ console.log(chalk44.dim(" Already have an agent?"));
3759
+ console.log(chalk44.cyan(" holomime personality") + chalk44.dim(" Define how it should behave"));
3760
+ console.log(chalk44.cyan(" holomime diagnose") + chalk44.dim(" Analyze its conversation logs"));
3608
3761
  console.log();
3609
- }
3610
- function printHeader(title) {
3611
- const line = "\u2550".repeat(title.length + 4);
3762
+ console.log(chalk44.dim(" Building for a robot?"));
3763
+ console.log(chalk44.cyan(" holomime identity") + chalk44.dim(" Full 8-file identity stack with body.api"));
3612
3764
  console.log();
3613
- console.log(holomimeGradient(` ${line}`));
3614
- console.log(holomimeGradient(` \u2551 ${title} \u2551`));
3615
- console.log(holomimeGradient(` ${line}`));
3765
+ console.log(chalk44.dim(" Then fix and verify:"));
3766
+ console.log(chalk44.cyan(" holomime therapy") + chalk44.dim(" Run in background \u2014 generate data, detect regression"));
3767
+ console.log(chalk44.cyan(" holomime cure") + chalk44.dim(" Full pipeline \u2014 diagnose, fine-tune, verify"));
3616
3768
  console.log();
3617
3769
  }
3770
+ var init_config = __esm({
3771
+ "src/commands/config.ts"() {
3772
+ "use strict";
3773
+ init_branding();
3774
+ }
3775
+ });
3776
+
3777
+ // src/cli.ts
3778
+ init_branding();
3779
+ import { Command } from "commander";
3618
3780
 
3619
3781
  // src/ui/tier.ts
3620
3782
  import chalk2 from "chalk";
@@ -6161,6 +6323,9 @@ function compileTiered(spec, tier, surface = "chat") {
6161
6323
  }
6162
6324
  }
6163
6325
 
6326
+ // src/commands/compile.ts
6327
+ init_branding();
6328
+
6164
6329
  // src/ui/boxes.ts
6165
6330
  import boxen3 from "boxen";
6166
6331
  import chalk4 from "chalk";
@@ -6387,6 +6552,7 @@ init_types();
6387
6552
  import chalk7 from "chalk";
6388
6553
  import figures2 from "figures";
6389
6554
  import { resolve as resolve4 } from "path";
6555
+ init_branding();
6390
6556
  async function validateCommand() {
6391
6557
  const specPath = resolve4(process.cwd(), ".personality.json");
6392
6558
  let json;
@@ -6458,6 +6624,7 @@ import chalk8 from "chalk";
6458
6624
  import figures3 from "figures";
6459
6625
  import { resolve as resolve5 } from "path";
6460
6626
  import { writeFileSync as writeFileSync4 } from "fs";
6627
+ init_branding();
6461
6628
  async function profileCommand(options = {}) {
6462
6629
  const specPath = resolve5(process.cwd(), ".personality.json");
6463
6630
  let raw;
@@ -6721,6 +6888,7 @@ import { resolve as resolve7 } from "path";
6721
6888
  init_recovery();
6722
6889
  init_formality();
6723
6890
  init_retrieval_quality();
6891
+ init_branding();
6724
6892
 
6725
6893
  // src/ui/progress.ts
6726
6894
  import chalk9 from "chalk";
@@ -7223,6 +7391,7 @@ function prescribeDPOPairs(patterns, corpus, limit = 20) {
7223
7391
  }
7224
7392
 
7225
7393
  // src/commands/assess.ts
7394
+ init_branding();
7226
7395
  init_log_adapter();
7227
7396
  async function assessCommand(options) {
7228
7397
  const specPath = resolve8(process.cwd(), options.personality);
@@ -10456,6 +10625,9 @@ function createProvider(config) {
10456
10625
  }
10457
10626
  }
10458
10627
 
10628
+ // src/commands/session.ts
10629
+ init_branding();
10630
+
10459
10631
  // src/ui/chat.ts
10460
10632
  import chalk13 from "chalk";
10461
10633
  function printTherapistMessage(content) {
@@ -10802,6 +10974,7 @@ import chalk16 from "chalk";
10802
10974
  import figures8 from "figures";
10803
10975
  import { readdirSync as readdirSync2, readFileSync as readFileSync14, existsSync as existsSync13 } from "fs";
10804
10976
  import { resolve as resolve16, join as join12 } from "path";
10977
+ init_branding();
10805
10978
 
10806
10979
  // src/analysis/evolution-history.ts
10807
10980
  import { readFileSync as readFileSync13, writeFileSync as writeFileSync12, mkdirSync as mkdirSync8, existsSync as existsSync12 } from "fs";
@@ -11461,6 +11634,7 @@ function getMarketplaceClient() {
11461
11634
  }
11462
11635
 
11463
11636
  // src/commands/browse.ts
11637
+ init_branding();
11464
11638
  async function browseCommand(options) {
11465
11639
  const assetType = options.type ?? void 0;
11466
11640
  const sortField = options.sort ?? "downloads";
@@ -11578,6 +11752,7 @@ import figures9 from "figures";
11578
11752
  import { writeFileSync as writeFileSync14, existsSync as existsSync16 } from "fs";
11579
11753
  import { resolve as resolve18 } from "path";
11580
11754
  import { select as select2 } from "@inquirer/prompts";
11755
+ init_branding();
11581
11756
  async function useCommand(handle, options) {
11582
11757
  printHeader("Use Personality");
11583
11758
  const registry = await withSpinner("Fetching registry...", async () => {
@@ -11640,6 +11815,7 @@ import chalk19 from "chalk";
11640
11815
  import figures10 from "figures";
11641
11816
  import { readFileSync as readFileSync18 } from "fs";
11642
11817
  import { resolve as resolve19 } from "path";
11818
+ init_branding();
11643
11819
  async function publishCommand(options) {
11644
11820
  const assetType = options.type ?? "personality";
11645
11821
  if (assetType !== "personality" || options.path) {
@@ -11869,6 +12045,7 @@ async function runAutopilot(spec, messages, provider, options) {
11869
12045
  }
11870
12046
 
11871
12047
  // src/commands/autopilot.ts
12048
+ init_branding();
11872
12049
  async function autopilotCommand(options) {
11873
12050
  const specPath = resolve20(process.cwd(), options.personality);
11874
12051
  let spec;
@@ -12021,6 +12198,7 @@ async function autopilotCommand(options) {
12021
12198
  }
12022
12199
 
12023
12200
  // src/commands/export.ts
12201
+ init_branding();
12024
12202
  import chalk21 from "chalk";
12025
12203
  import figures12 from "figures";
12026
12204
  import { writeFileSync as writeFileSync16 } from "fs";
@@ -12178,6 +12356,7 @@ This is the closed-loop behavioral alignment system.`,
12178
12356
  }
12179
12357
 
12180
12358
  // src/commands/train.ts
12359
+ init_branding();
12181
12360
  import chalk22 from "chalk";
12182
12361
  import figures13 from "figures";
12183
12362
  import { readFileSync as readFileSync23, writeFileSync as writeFileSync19, mkdirSync as mkdirSync12, readdirSync as readdirSync5, existsSync as existsSync19 } from "fs";
@@ -12512,6 +12691,7 @@ Fine-tuned model: ${chalk22.cyan(result.modelId)}`,
12512
12691
  // src/commands/eval.ts
12513
12692
  init_log_adapter();
12514
12693
  init_outcome_eval();
12694
+ init_branding();
12515
12695
  import chalk23 from "chalk";
12516
12696
  import figures14 from "figures";
12517
12697
  import { readFileSync as readFileSync24 } from "fs";
@@ -13162,6 +13342,7 @@ function extractRegenerationDPOPairs(beforeMessages, afterMessages, agentName) {
13162
13342
  }
13163
13343
 
13164
13344
  // src/commands/evolve.ts
13345
+ init_branding();
13165
13346
  async function evolveCommand(options) {
13166
13347
  const specPath = resolve28(process.cwd(), options.personality);
13167
13348
  let spec;
@@ -13671,6 +13852,7 @@ function compareBenchmarks(before, after) {
13671
13852
  }
13672
13853
 
13673
13854
  // src/commands/benchmark.ts
13855
+ init_branding();
13674
13856
  async function benchmarkCommand(options) {
13675
13857
  const specPath = resolve29(process.cwd(), options.personality);
13676
13858
  let spec;
@@ -13985,6 +14167,7 @@ function startWatch(spec, options) {
13985
14167
  }
13986
14168
 
13987
14169
  // src/commands/watch.ts
14170
+ init_branding();
13988
14171
  async function watchCommand(options) {
13989
14172
  const specPath = resolve31(process.cwd(), options.personality);
13990
14173
  let spec;
@@ -14249,6 +14432,9 @@ function saveCredential(credential, outputDir) {
14249
14432
  return filepath;
14250
14433
  }
14251
14434
 
14435
+ // src/commands/certify.ts
14436
+ init_branding();
14437
+
14252
14438
  // src/compliance/iso-mappings.ts
14253
14439
  import { readFileSync as readFileSync31, existsSync as existsSync25 } from "fs";
14254
14440
  import { join as join23, resolve as resolve33, dirname as dirname4 } from "path";
@@ -14742,6 +14928,7 @@ async function certifyCommand(options) {
14742
14928
  }
14743
14929
 
14744
14930
  // src/commands/daemon.ts
14931
+ init_branding();
14745
14932
  import chalk29 from "chalk";
14746
14933
  import { writeFileSync as writeFileSync26, readFileSync as readFileSync33, mkdirSync as mkdirSync18, existsSync as existsSync27 } from "fs";
14747
14934
  import { resolve as resolve35 } from "path";
@@ -14971,6 +15158,7 @@ Log: ${getDaemonLogPath()}`,
14971
15158
  }
14972
15159
 
14973
15160
  // src/commands/fleet.ts
15161
+ init_branding();
14974
15162
  import chalk30 from "chalk";
14975
15163
  import figures20 from "figures";
14976
15164
  import { writeFileSync as writeFileSync27, mkdirSync as mkdirSync19, existsSync as existsSync29 } from "fs";
@@ -15339,6 +15527,7 @@ Press Ctrl+C for fleet summary`,
15339
15527
  }
15340
15528
 
15341
15529
  // src/commands/fleet-therapy.ts
15530
+ init_branding();
15342
15531
  import chalk31 from "chalk";
15343
15532
  import figures21 from "figures";
15344
15533
  import { resolve as resolve39 } from "path";
@@ -15736,6 +15925,7 @@ ${report.errorCount > 0 ? `${report.errorCount} error(s) \u2014 check agent logs
15736
15925
  }
15737
15926
 
15738
15927
  // src/commands/network.ts
15928
+ init_branding();
15739
15929
  import chalk32 from "chalk";
15740
15930
  import figures22 from "figures";
15741
15931
  import { resolve as resolve41 } from "path";
@@ -16343,6 +16533,7 @@ async function networkCommand(options) {
16343
16533
  }
16344
16534
 
16345
16535
  // src/commands/share.ts
16536
+ init_branding();
16346
16537
  import chalk33 from "chalk";
16347
16538
  import figures23 from "figures";
16348
16539
  import { resolve as resolve42 } from "path";
@@ -16431,6 +16622,7 @@ Run ${chalk33.cyan("holomime align")} or ${chalk33.cyan("holomime network")} fir
16431
16622
  }
16432
16623
 
16433
16624
  // src/commands/prescribe.ts
16625
+ init_branding();
16434
16626
  import chalk34 from "chalk";
16435
16627
  import figures24 from "figures";
16436
16628
  import { readFileSync as readFileSync37, writeFileSync as writeFileSync29 } from "fs";
@@ -16529,6 +16721,7 @@ async function prescribeCommand(options) {
16529
16721
  import chalk35 from "chalk";
16530
16722
  import figures25 from "figures";
16531
16723
  import { resolve as resolve44 } from "path";
16724
+ init_branding();
16532
16725
  async function interviewCommand(options) {
16533
16726
  const specPath = resolve44(process.cwd(), options.personality);
16534
16727
  let spec;
@@ -16642,6 +16835,7 @@ function displayResults(result) {
16642
16835
  }
16643
16836
 
16644
16837
  // src/commands/activate.ts
16838
+ init_branding();
16645
16839
  import chalk37 from "chalk";
16646
16840
  import figures26 from "figures";
16647
16841
  import { writeFileSync as writeFileSync31, mkdirSync as mkdirSync22, existsSync as existsSync33 } from "fs";
@@ -16835,6 +17029,7 @@ async function activateCommand(key) {
16835
17029
  // src/commands/telemetry-cmd.ts
16836
17030
  import chalk38 from "chalk";
16837
17031
  import figures27 from "figures";
17032
+ init_branding();
16838
17033
  async function telemetryCommand(action) {
16839
17034
  printHeader("Telemetry");
16840
17035
  if (action === "enable") {
@@ -17534,6 +17729,7 @@ var IsaacSimAdapter = class {
17534
17729
  };
17535
17730
 
17536
17731
  // src/commands/embody.ts
17732
+ init_branding();
17537
17733
  async function embodyCommand(options) {
17538
17734
  const provider = options.provider ?? "anthropic";
17539
17735
  const adapterType = options.adapter;
@@ -17829,6 +18025,7 @@ function createAdapter(type, options) {
17829
18025
  }
17830
18026
 
17831
18027
  // src/commands/init-stack.ts
18028
+ init_branding();
17832
18029
  import chalk40 from "chalk";
17833
18030
  import figures29 from "figures";
17834
18031
  import { writeFileSync as writeFileSync33, mkdirSync as mkdirSync23, existsSync as existsSync35 } from "fs";
@@ -18082,6 +18279,7 @@ async function createFullStack(outputDir) {
18082
18279
  }
18083
18280
 
18084
18281
  // src/commands/compile-stack.ts
18282
+ init_branding();
18085
18283
  import chalk41 from "chalk";
18086
18284
  import figures30 from "figures";
18087
18285
  import { writeFileSync as writeFileSync34, readFileSync as readFileSync41, existsSync as existsSync36 } from "fs";
@@ -18213,6 +18411,12 @@ function detectProvider() {
18213
18411
  } else if (config.provider === "openai") {
18214
18412
  process.env.OPENAI_API_KEY = config.apiKey;
18215
18413
  }
18414
+ if (config.openaiKey && !process.env.OPENAI_API_KEY) {
18415
+ process.env.OPENAI_API_KEY = config.openaiKey;
18416
+ }
18417
+ if (config.hfToken && !process.env.HF_TOKEN) {
18418
+ process.env.HF_TOKEN = config.hfToken;
18419
+ }
18216
18420
  const defaultModel = config.provider === "anthropic" ? "claude-haiku-4-5-20251001" : "gpt-4o-mini";
18217
18421
  return {
18218
18422
  provider: config.provider,
@@ -18247,6 +18451,7 @@ function autoDetect(options) {
18247
18451
  }
18248
18452
 
18249
18453
  // src/commands/voice.ts
18454
+ init_branding();
18250
18455
  import chalk42 from "chalk";
18251
18456
  import figures31 from "figures";
18252
18457
  import { resolve as resolve48 } from "path";
@@ -18881,6 +19086,7 @@ import figures32 from "figures";
18881
19086
  import { existsSync as existsSync39, mkdirSync as mkdirSync24, writeFileSync as writeFileSync35 } from "fs";
18882
19087
  import { join as join35, resolve as resolve49 } from "path";
18883
19088
  import { select as select3 } from "@inquirer/prompts";
19089
+ init_branding();
18884
19090
  var INSTALL_DIRS = {
18885
19091
  "personality": ".",
18886
19092
  "detector": ".holomime/detectors",
@@ -18972,10 +19178,11 @@ async function installCommand(handle, options) {
18972
19178
  }
18973
19179
 
18974
19180
  // src/commands/cure.ts
18975
- import chalk44 from "chalk";
19181
+ init_branding();
19182
+ import chalk45 from "chalk";
18976
19183
  import figures33 from "figures";
18977
- import { readFileSync as readFileSync45, writeFileSync as writeFileSync37, existsSync as existsSync41, mkdirSync as mkdirSync26 } from "fs";
18978
- import { resolve as resolve51, join as join37 } from "path";
19184
+ import { readFileSync as readFileSync46, writeFileSync as writeFileSync38, existsSync as existsSync42, mkdirSync as mkdirSync27 } from "fs";
19185
+ import { resolve as resolve51, join as join38 } from "path";
18979
19186
 
18980
19187
  // src/analysis/training-pipeline.ts
18981
19188
  import { writeFileSync as writeFileSync36, mkdirSync as mkdirSync25, readFileSync as readFileSync44, existsSync as existsSync40 } from "fs";
@@ -19273,38 +19480,97 @@ var STAGE_DESCRIPTIONS = {
19273
19480
  };
19274
19481
  function getAgentName2(personalityPath) {
19275
19482
  try {
19276
- const spec = JSON.parse(readFileSync45(personalityPath, "utf-8"));
19483
+ const spec = JSON.parse(readFileSync46(personalityPath, "utf-8"));
19277
19484
  return spec.name ?? "Agent";
19278
19485
  } catch {
19279
19486
  return "Agent";
19280
19487
  }
19281
19488
  }
19282
19489
  async function cureCommand(options) {
19283
- printHeader("Cure \u2014 End-to-End Behavioral Fix");
19284
- const provider = options.provider;
19490
+ const cwd = process.cwd();
19491
+ const hasBodyApi = existsSync42(resolve51(cwd, "body.api")) || existsSync42(resolve51(cwd, ".holomime/body.api")) || existsSync42(resolve51(cwd, "identity/body.api"));
19492
+ const isRobotFlow = options.exportOnly || hasBodyApi && options.provider === "openai";
19493
+ if (isRobotFlow) {
19494
+ let bodyName = "robot";
19495
+ try {
19496
+ for (const p of ["body.api", ".holomime/body.api", "identity/body.api"]) {
19497
+ const bp = resolve51(cwd, p);
19498
+ if (existsSync42(bp)) {
19499
+ const body = JSON.parse(readFileSync46(bp, "utf-8"));
19500
+ bodyName = body.hardware_profile?.model ?? body.morphology ?? "robot";
19501
+ break;
19502
+ }
19503
+ }
19504
+ } catch {
19505
+ }
19506
+ printHeader("Cure \u2014 Robotics Training Pipeline");
19507
+ console.log();
19508
+ console.log(chalk45.dim(` Robot identity detected`) + chalk45.cyan(` (${bodyName})`));
19509
+ console.log(chalk45.dim(" Generating behavioral training data for your pipeline."));
19510
+ console.log();
19511
+ options.skipTrain = true;
19512
+ options.skipVerify = true;
19513
+ options.provider = "huggingface";
19514
+ } else {
19515
+ printHeader("Cure \u2014 End-to-End Behavioral Fix");
19516
+ }
19517
+ try {
19518
+ const { loadConfig: loadConfig3 } = await Promise.resolve().then(() => (init_config(), config_exports));
19519
+ const cfg = loadConfig3();
19520
+ if (cfg) {
19521
+ if (cfg.provider === "anthropic" && cfg.apiKey && !process.env.ANTHROPIC_API_KEY) {
19522
+ process.env.ANTHROPIC_API_KEY = cfg.apiKey;
19523
+ }
19524
+ if (cfg.provider === "openai" && cfg.apiKey && !process.env.OPENAI_API_KEY) {
19525
+ process.env.OPENAI_API_KEY = cfg.apiKey;
19526
+ }
19527
+ if (cfg.openaiKey && !process.env.OPENAI_API_KEY) {
19528
+ process.env.OPENAI_API_KEY = cfg.openaiKey;
19529
+ }
19530
+ if (cfg.hfToken && !process.env.HF_TOKEN) {
19531
+ process.env.HF_TOKEN = cfg.hfToken;
19532
+ }
19533
+ }
19534
+ } catch {
19535
+ }
19536
+ let provider = options.provider;
19537
+ const hasOpenAIKey = !!process.env.OPENAI_API_KEY;
19538
+ const hasHFToken = !!process.env.HF_TOKEN;
19539
+ if (!isRobotFlow && provider === "openai" && !hasOpenAIKey) {
19540
+ if (hasHFToken) {
19541
+ provider = "huggingface";
19542
+ console.log(chalk45.dim(" No OpenAI key found. Using HuggingFace for training."));
19543
+ } else {
19544
+ console.log(chalk45.dim(" No training provider key found. Exporting training data only."));
19545
+ console.log(chalk45.dim(" Run ") + chalk45.cyan("holomime config") + chalk45.dim(" to add keys for fine-tuning."));
19546
+ console.log();
19547
+ options.skipTrain = true;
19548
+ options.skipVerify = true;
19549
+ }
19550
+ }
19285
19551
  if (provider !== "openai" && provider !== "huggingface") {
19286
- console.error(
19287
- chalk44.red(` Unsupported provider: ${provider}. Supported: openai, huggingface`)
19288
- );
19289
- process.exit(1);
19290
- return;
19552
+ provider = "openai";
19553
+ if (!hasOpenAIKey) {
19554
+ options.skipTrain = true;
19555
+ options.skipVerify = true;
19556
+ }
19291
19557
  }
19292
19558
  const personalityPath = resolve51(process.cwd(), options.personality);
19293
19559
  let logPath;
19294
- if (!existsSync41(personalityPath)) {
19295
- console.error(chalk44.red(` Personality file not found: ${options.personality}`));
19560
+ if (!existsSync42(personalityPath)) {
19561
+ console.error(chalk45.red(` Personality file not found: ${options.personality}`));
19296
19562
  process.exit(1);
19297
19563
  return;
19298
19564
  }
19299
19565
  if (options.log) {
19300
19566
  logPath = resolve51(process.cwd(), options.log);
19301
- if (!existsSync41(logPath)) {
19302
- console.error(chalk44.red(` Log file not found: ${options.log}`));
19567
+ if (!existsSync42(logPath)) {
19568
+ console.error(chalk45.red(` Log file not found: ${options.log}`));
19303
19569
  process.exit(1);
19304
19570
  return;
19305
19571
  }
19306
19572
  } else {
19307
- console.log(chalk44.dim(" No --log provided. Generating conversations from benchmark scenarios..."));
19573
+ console.log(chalk45.dim(" No --log provided. Generating conversations from benchmark scenarios..."));
19308
19574
  console.log();
19309
19575
  const scenarios = getBenchmarkScenarios();
19310
19576
  const syntheticMessages = [];
@@ -19318,8 +19584,8 @@ async function cureCommand(options) {
19318
19584
  }
19319
19585
  }
19320
19586
  const pipelineDir = resolve51(process.cwd(), ".holomime/pipeline");
19321
- mkdirSync26(pipelineDir, { recursive: true });
19322
- logPath = join37(pipelineDir, "auto-generated-log.json");
19587
+ mkdirSync27(pipelineDir, { recursive: true });
19588
+ logPath = join38(pipelineDir, "auto-generated-log.json");
19323
19589
  const syntheticLog = {
19324
19590
  conversations: [
19325
19591
  {
@@ -19328,41 +19594,39 @@ async function cureCommand(options) {
19328
19594
  }
19329
19595
  ]
19330
19596
  };
19331
- writeFileSync37(logPath, JSON.stringify(syntheticLog, null, 2));
19332
- console.log(chalk44.dim(` Generated ${syntheticMessages.length} messages from ${scenarios.length} scenarios`));
19333
- console.log(chalk44.dim(` Saved to: ${logPath}`));
19597
+ writeFileSync38(logPath, JSON.stringify(syntheticLog, null, 2));
19598
+ console.log(chalk45.dim(` Generated ${syntheticMessages.length} messages from ${scenarios.length} scenarios`));
19599
+ console.log(chalk45.dim(` Saved to: ${logPath}`));
19334
19600
  console.log();
19335
19601
  }
19336
- if (provider === "openai") {
19337
- const apiKey = process.env.OPENAI_API_KEY ?? "";
19338
- if (!apiKey) {
19339
- console.error(chalk44.red(" OPENAI_API_KEY environment variable is required for OpenAI training."));
19340
- console.log(chalk44.dim(" Set it with: export OPENAI_API_KEY=sk-..."));
19341
- process.exit(1);
19342
- return;
19343
- }
19344
- } else if (provider === "huggingface") {
19345
- const token = process.env.HF_TOKEN ?? process.env.HUGGING_FACE_HUB_TOKEN ?? "";
19346
- if (!token) {
19347
- console.error(chalk44.red(" HF_TOKEN environment variable is required for HuggingFace training."));
19348
- console.log(chalk44.dim(" Set it with: export HF_TOKEN=hf_..."));
19349
- process.exit(1);
19350
- return;
19602
+ if (!options.skipTrain) {
19603
+ if (provider === "openai" && !process.env.OPENAI_API_KEY) {
19604
+ console.log(chalk45.dim(" No OpenAI key configured. Switching to export-only mode."));
19605
+ console.log(chalk45.dim(" Run ") + chalk45.cyan("holomime config") + chalk45.dim(" to add an OpenAI key for fine-tuning."));
19606
+ console.log();
19607
+ options.skipTrain = true;
19608
+ options.skipVerify = true;
19609
+ } else if (provider === "huggingface" && !(process.env.HF_TOKEN ?? process.env.HUGGING_FACE_HUB_TOKEN)) {
19610
+ console.log(chalk45.dim(" No HuggingFace token configured. Switching to export-only mode."));
19611
+ console.log(chalk45.dim(" Run ") + chalk45.cyan("holomime config") + chalk45.dim(" to add a HuggingFace token."));
19612
+ console.log();
19613
+ options.skipTrain = true;
19614
+ options.skipVerify = true;
19351
19615
  }
19352
19616
  }
19353
19617
  const agentName = getAgentName2(personalityPath);
19354
19618
  const passThreshold = options.passThreshold ? parseInt(options.passThreshold, 10) : 50;
19355
19619
  console.log();
19356
- console.log(chalk44.dim(` Agent: ${agentName}`));
19357
- console.log(chalk44.dim(` Personality: ${options.personality}`));
19358
- console.log(chalk44.dim(` Log: ${options.log ?? "(auto-generated)"}`));
19359
- console.log(chalk44.dim(` Provider: ${provider === "huggingface" ? "HuggingFace AutoTrain" : "OpenAI"}`));
19360
- console.log(chalk44.dim(` Base Model: ${options.baseModel}`));
19361
- if (options.method) console.log(chalk44.dim(` Method: ${options.method}`));
19362
- if (options.suffix) console.log(chalk44.dim(` Suffix: ${options.suffix}`));
19363
- if (options.skipTrain) console.log(chalk44.dim(` Skip: training`));
19364
- if (options.skipVerify) console.log(chalk44.dim(` Skip: verification`));
19365
- if (options.dryRun) console.log(chalk44.dim(` Mode: dry run`));
19620
+ console.log(chalk45.dim(` Agent: ${agentName}`));
19621
+ console.log(chalk45.dim(` Personality: ${options.personality}`));
19622
+ console.log(chalk45.dim(` Log: ${options.log ?? "(auto-generated)"}`));
19623
+ console.log(chalk45.dim(` Provider: ${provider === "huggingface" ? "HuggingFace AutoTrain" : "OpenAI"}`));
19624
+ console.log(chalk45.dim(` Base Model: ${options.baseModel}`));
19625
+ if (options.method) console.log(chalk45.dim(` Method: ${options.method}`));
19626
+ if (options.suffix) console.log(chalk45.dim(` Suffix: ${options.suffix}`));
19627
+ if (options.skipTrain) console.log(chalk45.dim(` Skip: training`));
19628
+ if (options.skipVerify) console.log(chalk45.dim(` Skip: verification`));
19629
+ if (options.dryRun) console.log(chalk45.dim(` Mode: dry run`));
19366
19630
  console.log();
19367
19631
  const stages = ["diagnose", "export"];
19368
19632
  if (!options.skipTrain) stages.push("train");
@@ -19380,9 +19644,9 @@ async function cureCommand(options) {
19380
19644
  printBox(
19381
19645
  `Dry run complete.
19382
19646
 
19383
- ` + stages.map((s, i) => ` ${i + 1}. ${chalk44.cyan(STAGE_LABELS[s])} \u2014 ${STAGE_DESCRIPTIONS[s]}`).join("\n") + `
19647
+ ` + stages.map((s, i) => ` ${i + 1}. ${chalk45.cyan(STAGE_LABELS[s])} \u2014 ${STAGE_DESCRIPTIONS[s]}`).join("\n") + `
19384
19648
 
19385
- Remove ${chalk44.cyan("--dry-run")} to execute the full pipeline.`,
19649
+ Remove ${chalk45.cyan("--dry-run")} to execute the full pipeline.`,
19386
19650
  "info",
19387
19651
  "Dry Run"
19388
19652
  );
@@ -19409,20 +19673,20 @@ Remove ${chalk44.cyan("--dry-run")} to execute the full pipeline.`,
19409
19673
  currentStage = stage;
19410
19674
  console.log();
19411
19675
  console.log(
19412
- ` ${chalk44.cyan(figures33.pointer)} ${chalk44.bold(STAGE_LABELS[stage])} ` + chalk44.dim(`[${index + 1}/${total}] ${STAGE_DESCRIPTIONS[stage]}...`)
19676
+ ` ${chalk45.cyan(figures33.pointer)} ${chalk45.bold(STAGE_LABELS[stage])} ` + chalk45.dim(`[${index + 1}/${total}] ${STAGE_DESCRIPTIONS[stage]}...`)
19413
19677
  );
19414
19678
  },
19415
19679
  onStageEnd: (stage, success, message) => {
19416
- const icon = success ? chalk44.green(figures33.tick) : chalk44.red(figures33.cross);
19680
+ const icon = success ? chalk45.green(figures33.tick) : chalk45.red(figures33.cross);
19417
19681
  console.log(` ${icon} ${message}`);
19418
19682
  stageStatus[stage] = success ? "passed" : "failed";
19419
19683
  },
19420
19684
  onProgress: (progress) => {
19421
19685
  if (progress.stage !== currentStage) return;
19422
- console.log(` ${chalk44.dim(figures33.pointer)} ${progress.message}`);
19686
+ console.log(` ${chalk45.dim(figures33.pointer)} ${progress.message}`);
19423
19687
  },
19424
19688
  onError: (stage, error) => {
19425
- console.log(` ${chalk44.red(figures33.cross)} ${STAGE_LABELS[stage]} failed: ${error}`);
19689
+ console.log(` ${chalk45.red(figures33.cross)} ${STAGE_LABELS[stage]} failed: ${error}`);
19426
19690
  stageStatus[stage] = "failed";
19427
19691
  }
19428
19692
  }
@@ -19432,7 +19696,7 @@ Remove ${chalk44.cyan("--dry-run")} to execute the full pipeline.`,
19432
19696
  printBox(
19433
19697
  `Pipeline failed: ${pipelineResult.error ?? "Unknown error"}
19434
19698
 
19435
- Intermediate results saved to ${chalk44.cyan(".holomime/pipeline/")}`,
19699
+ Intermediate results saved to ${chalk45.cyan(".holomime/pipeline/")}`,
19436
19700
  "warning",
19437
19701
  "Cure Failed"
19438
19702
  );
@@ -19449,21 +19713,21 @@ Intermediate results saved to ${chalk44.cyan(".holomime/pipeline/")}`,
19449
19713
  }
19450
19714
  if (pipelineResult.stages.train) {
19451
19715
  const train = pipelineResult.stages.train;
19452
- summaryLines.push(`Model: ${chalk44.cyan(train.modelId)}`);
19716
+ summaryLines.push(`Model: ${chalk45.cyan(train.modelId)}`);
19453
19717
  summaryLines.push(`Method: ${train.method === "dpo" ? "DPO" : "SFT"} | Examples: ${train.examples}`);
19454
19718
  }
19455
19719
  if (pipelineResult.stages.verify) {
19456
19720
  const verify = pipelineResult.stages.verify;
19457
19721
  const gradeColors = {
19458
- A: chalk44.green,
19459
- B: chalk44.cyan,
19460
- C: chalk44.yellow,
19461
- D: chalk44.hex("#ff8800"),
19462
- F: chalk44.red
19722
+ A: chalk45.green,
19723
+ B: chalk45.cyan,
19724
+ C: chalk45.yellow,
19725
+ D: chalk45.hex("#ff8800"),
19726
+ F: chalk45.red
19463
19727
  };
19464
- const colorize = gradeColors[verify.grade] ?? chalk44.white;
19728
+ const colorize = gradeColors[verify.grade] ?? chalk45.white;
19465
19729
  summaryLines.push(
19466
- `Verification: ${verify.passed ? chalk44.green("PASSED") : chalk44.red("FAILED")} (${colorize(`${verify.fineTunedScore}/100`)} Grade ${colorize(verify.grade)})`
19730
+ `Verification: ${verify.passed ? chalk45.green("PASSED") : chalk45.red("FAILED")} (${colorize(`${verify.fineTunedScore}/100`)} Grade ${colorize(verify.grade)})`
19467
19731
  );
19468
19732
  if (verify.patternsImproved.length > 0) {
19469
19733
  summaryLines.push(
@@ -19472,13 +19736,13 @@ Intermediate results saved to ${chalk44.cyan(".holomime/pipeline/")}`,
19472
19736
  }
19473
19737
  if (verify.patternsRegressed.length > 0) {
19474
19738
  summaryLines.push(
19475
- `${chalk44.red("Regressed")}: ${verify.patternsRegressed.map((p) => p.patternName).join(", ")}`
19739
+ `${chalk45.red("Regressed")}: ${verify.patternsRegressed.map((p) => p.patternName).join(", ")}`
19476
19740
  );
19477
19741
  }
19478
19742
  if (verify.regressionWarnings.length > 0) {
19479
- console.log(chalk44.bold(" Regression Warnings:"));
19743
+ console.log(chalk45.bold(" Regression Warnings:"));
19480
19744
  for (const warning of verify.regressionWarnings) {
19481
- console.log(` ${chalk44.yellow(figures33.warning)} ${warning}`);
19745
+ console.log(` ${chalk45.yellow(figures33.warning)} ${warning}`);
19482
19746
  }
19483
19747
  console.log();
19484
19748
  }
@@ -19491,16 +19755,31 @@ Intermediate results saved to ${chalk44.cyan(".holomime/pipeline/")}`,
19491
19755
  `Cure Complete \u2014 ${agentName}`
19492
19756
  );
19493
19757
  console.log();
19494
- console.log(chalk44.dim(` Pipeline results: .holomime/pipeline/`));
19758
+ console.log(chalk45.dim(` Pipeline results: .holomime/pipeline/`));
19495
19759
  console.log();
19496
- if (pipelineResult.stages.train) {
19760
+ if (isRobotFlow) {
19761
+ const exportPath = ".holomime/pipeline/";
19762
+ const nextSteps = [
19763
+ `Training data exported to ${chalk45.cyan(exportPath)}`,
19764
+ "",
19765
+ " Import into your training pipeline:",
19766
+ ` ${chalk45.dim("$")} ${chalk45.cyan("huggingface-cli download")} ${chalk45.dim(options.hubRepo ?? "<your-org/dataset>")}`,
19767
+ "",
19768
+ " Or use the local JSONL directly:",
19769
+ ` ${chalk45.dim("$")} ${chalk45.cyan("ls .holomime/pipeline/*.jsonl")}`,
19770
+ "",
19771
+ ` ${chalk45.dim("Run")} ${chalk45.cyan("holomime certify")} ${chalk45.dim("for ISO compliance report.")}`
19772
+ ];
19773
+ printBox(nextSteps.join("\n"), "success", "Training Data Ready");
19774
+ console.log();
19775
+ } else if (pipelineResult.stages.train) {
19497
19776
  printBox(
19498
19777
  `The behavioral fix has been applied:
19499
19778
 
19500
- Model: ${chalk44.cyan(pipelineResult.stages.train.modelId)}
19779
+ Model: ${chalk45.cyan(pipelineResult.stages.train.modelId)}
19501
19780
  Update your agent's model reference to use the fine-tuned version.
19502
19781
 
19503
- ${chalk44.dim("Run")} ${chalk44.cyan("holomime benchmark")} ${chalk44.dim("to stress-test the fixed model.")}`,
19782
+ ${chalk45.dim("Run")} ${chalk45.cyan("holomime benchmark")} ${chalk45.dim("to stress-test the fixed model.")}`,
19504
19783
  "info",
19505
19784
  "Next Steps"
19506
19785
  );
@@ -19531,22 +19810,22 @@ function generateProblematicResponse(targetPattern, userMessage) {
19531
19810
  }
19532
19811
 
19533
19812
  // src/commands/live.ts
19534
- import chalk45 from "chalk";
19813
+ import chalk46 from "chalk";
19535
19814
 
19536
19815
  // src/live/agent-detector.ts
19537
- import { existsSync as existsSync42, readdirSync as readdirSync11, statSync } from "fs";
19538
- import { join as join38, resolve as resolve52 } from "path";
19539
- import { homedir as homedir8 } from "os";
19816
+ import { existsSync as existsSync43, readdirSync as readdirSync11, statSync } from "fs";
19817
+ import { join as join39, resolve as resolve52 } from "path";
19818
+ import { homedir as homedir9 } from "os";
19540
19819
  var RECENCY_THRESHOLD_MS = 12e4;
19541
19820
  function findNewestFile(baseDir, extensions, maxDepth = 3, depth = 0) {
19542
19821
  if (depth > maxDepth) return null;
19543
- if (!existsSync42(baseDir)) return null;
19822
+ if (!existsSync43(baseDir)) return null;
19544
19823
  let best = null;
19545
19824
  try {
19546
19825
  const entries = readdirSync11(baseDir);
19547
19826
  for (const entry of entries) {
19548
19827
  if (entry.startsWith(".")) continue;
19549
- const fullPath = join38(baseDir, entry);
19828
+ const fullPath = join39(baseDir, entry);
19550
19829
  try {
19551
19830
  const stat = statSync(fullPath);
19552
19831
  if (stat.isDirectory()) {
@@ -19572,7 +19851,7 @@ function isRecent(mtimeMs) {
19572
19851
  return Date.now() - mtimeMs <= RECENCY_THRESHOLD_MS;
19573
19852
  }
19574
19853
  function findClaudeCodeSession() {
19575
- const claudeDir = join38(homedir8(), ".claude", "projects");
19854
+ const claudeDir = join39(homedir9(), ".claude", "projects");
19576
19855
  const result = findNewestFile(claudeDir, [".jsonl"], 2);
19577
19856
  if (!result || !isRecent(result.mtimeMs)) return null;
19578
19857
  return {
@@ -19583,8 +19862,8 @@ function findClaudeCodeSession() {
19583
19862
  }
19584
19863
  function findClineSession() {
19585
19864
  const searchDirs = [
19586
- join38(process.cwd(), ".cline", "tasks"),
19587
- join38(homedir8(), ".cline", "tasks")
19865
+ join39(process.cwd(), ".cline", "tasks"),
19866
+ join39(homedir9(), ".cline", "tasks")
19588
19867
  ];
19589
19868
  for (const tasksDir of searchDirs) {
19590
19869
  const result = findNewestFile(tasksDir, [".json", ".jsonl"], 2);
@@ -19599,7 +19878,7 @@ function findClineSession() {
19599
19878
  return null;
19600
19879
  }
19601
19880
  function findCodexSession() {
19602
- const codexDir = join38(homedir8(), ".codex", "sessions");
19881
+ const codexDir = join39(homedir9(), ".codex", "sessions");
19603
19882
  const result = findNewestFile(codexDir, [".jsonl"], 4);
19604
19883
  if (!result || !isRecent(result.mtimeMs)) return null;
19605
19884
  return {
@@ -19609,7 +19888,7 @@ function findCodexSession() {
19609
19888
  };
19610
19889
  }
19611
19890
  function findCursorSession() {
19612
- const cursorProjects = join38(homedir8(), ".cursor", "projects");
19891
+ const cursorProjects = join39(homedir9(), ".cursor", "projects");
19613
19892
  const result = findNewestFile(cursorProjects, [".json", ".jsonl"], 3);
19614
19893
  if (result && isRecent(result.mtimeMs)) {
19615
19894
  return {
@@ -19756,8 +20035,8 @@ function readFile(filePath, startByte) {
19756
20035
 
19757
20036
  // src/live/server.ts
19758
20037
  import { createServer as createServer3 } from "http";
19759
- import { readFileSync as readFileSync46, existsSync as existsSync43 } from "fs";
19760
- import { join as join39, extname } from "path";
20038
+ import { readFileSync as readFileSync47, existsSync as existsSync44 } from "fs";
20039
+ import { join as join40, extname } from "path";
19761
20040
  import { fileURLToPath as fileURLToPath4 } from "url";
19762
20041
  import { WebSocketServer } from "ws";
19763
20042
  var __bundleDir = fileURLToPath4(new URL(".", import.meta.url));
@@ -19771,15 +20050,15 @@ var MIME_TYPES = {
19771
20050
  ".ico": "image/x-icon"
19772
20051
  };
19773
20052
  function startServer(port) {
19774
- const staticDir = join39(__bundleDir, "neuralspace");
20053
+ const staticDir = join40(__bundleDir, "neuralspace");
19775
20054
  const clients = /* @__PURE__ */ new Set();
19776
20055
  let lastEvent = null;
19777
20056
  let initMessage = null;
19778
20057
  return new Promise((resolve57, reject) => {
19779
20058
  const server = createServer3((req, res) => {
19780
20059
  const url = req.url === "/" ? "/index.html" : req.url || "/index.html";
19781
- const filePath = join39(staticDir, url);
19782
- if (!existsSync43(filePath)) {
20060
+ const filePath = join40(staticDir, url);
20061
+ if (!existsSync44(filePath)) {
19783
20062
  res.writeHead(404, { "Content-Type": "text/plain" });
19784
20063
  res.end("Not found");
19785
20064
  return;
@@ -19787,7 +20066,7 @@ function startServer(port) {
19787
20066
  const ext = extname(filePath);
19788
20067
  const contentType = MIME_TYPES[ext] || "application/octet-stream";
19789
20068
  try {
19790
- const content = readFileSync46(filePath);
20069
+ const content = readFileSync47(filePath);
19791
20070
  res.writeHead(200, {
19792
20071
  "Content-Type": contentType,
19793
20072
  "Cache-Control": "no-cache"
@@ -19857,38 +20136,38 @@ async function liveCommand(options) {
19857
20136
  if (options.watchPath) {
19858
20137
  agent = manualAgent(options.watchPath);
19859
20138
  console.log(
19860
- chalk45.green(" \u2713") + ` Manual watch: ${chalk45.dim(agent.logPath)}`
20139
+ chalk46.green(" \u2713") + ` Manual watch: ${chalk46.dim(agent.logPath)}`
19861
20140
  );
19862
20141
  } else {
19863
- console.log(chalk45.dim(" Scanning for active agents..."));
20142
+ console.log(chalk46.dim(" Scanning for active agents..."));
19864
20143
  agent = detectAgent();
19865
20144
  if (!agent) {
19866
20145
  console.log("");
19867
- console.log(chalk45.red(" \u2717 No active agent detected."));
20146
+ console.log(chalk46.red(" \u2717 No active agent detected."));
19868
20147
  console.log("");
19869
20148
  console.log(
19870
- chalk45.dim(
20149
+ chalk46.dim(
19871
20150
  " Make sure an AI coding agent is running, or specify a path:"
19872
20151
  )
19873
20152
  );
19874
20153
  console.log(
19875
- chalk45.cyan(" holomime brain --watch <path-to-conversation-log>")
20154
+ chalk46.cyan(" holomime brain --watch <path-to-conversation-log>")
19876
20155
  );
19877
20156
  console.log("");
19878
20157
  console.log(
19879
- chalk45.dim(" Supported agents: Claude Code, Cline, OpenClaw, Codex, Cursor")
20158
+ chalk46.dim(" Supported agents: Claude Code, Cline, OpenClaw, Codex, Cursor")
19880
20159
  );
19881
20160
  process.exit(1);
19882
20161
  }
19883
20162
  console.log(
19884
- chalk45.green(" \u2713") + ` Detected ${chalk45.bold(agent.agent)} session`
20163
+ chalk46.green(" \u2713") + ` Detected ${chalk46.bold(agent.agent)} session`
19885
20164
  );
19886
20165
  console.log(
19887
- chalk45.green(" \u2713") + ` Watching: ${chalk45.dim(agent.logPath)}`
20166
+ chalk46.green(" \u2713") + ` Watching: ${chalk46.dim(agent.logPath)}`
19888
20167
  );
19889
20168
  }
19890
20169
  if (options.share) {
19891
- console.log(chalk45.dim(" Running diagnosis for snapshot..."));
20170
+ console.log(chalk46.dim(" Running diagnosis for snapshot..."));
19892
20171
  let resolved = false;
19893
20172
  await new Promise((resolve57) => {
19894
20173
  const watcher2 = startWatcher(agent, {
@@ -19903,7 +20182,7 @@ async function liveCommand(options) {
19903
20182
  resolve57();
19904
20183
  },
19905
20184
  onError(err) {
19906
- console.error(chalk45.red(`
20185
+ console.error(chalk46.red(`
19907
20186
  \u2717 Error: ${err.message}`));
19908
20187
  process.exit(1);
19909
20188
  },
@@ -19915,7 +20194,7 @@ async function liveCommand(options) {
19915
20194
  resolved = true;
19916
20195
  watcher2.stop();
19917
20196
  console.log(
19918
- chalk45.red(" \u2717 No diagnosis data available. Is the agent active?")
20197
+ chalk46.red(" \u2717 No diagnosis data available. Is the agent active?")
19919
20198
  );
19920
20199
  process.exit(1);
19921
20200
  }
@@ -19927,10 +20206,10 @@ async function liveCommand(options) {
19927
20206
  try {
19928
20207
  server = await startServer(port);
19929
20208
  console.log(
19930
- chalk45.green(" \u2713") + ` NeuralSpace: ${chalk45.cyan(`http://localhost:${server.port}`)}`
20209
+ chalk46.green(" \u2713") + ` NeuralSpace: ${chalk46.cyan(`http://localhost:${server.port}`)}`
19931
20210
  );
19932
20211
  } catch (err) {
19933
- console.log(chalk45.red(` \u2717 ${err.message}`));
20212
+ console.log(chalk46.red(` \u2717 ${err.message}`));
19934
20213
  process.exit(1);
19935
20214
  }
19936
20215
  server.broadcast({
@@ -19943,7 +20222,7 @@ async function liveCommand(options) {
19943
20222
  try {
19944
20223
  const open = (await import("open")).default;
19945
20224
  await open(`http://localhost:${server.port}`);
19946
- console.log(chalk45.dim(" Opening browser..."));
20225
+ console.log(chalk46.dim(" Opening browser..."));
19947
20226
  } catch {
19948
20227
  }
19949
20228
  }
@@ -19954,26 +20233,26 @@ async function liveCommand(options) {
19954
20233
  server.broadcast(event);
19955
20234
  lastEvent = event;
19956
20235
  msgCount = event.messageCount;
19957
- const healthColor = event.health >= 85 ? chalk45.green : event.health >= 70 ? chalk45.yellow : event.health >= 50 ? chalk45.hex("#f97316") : chalk45.red;
20236
+ const healthColor = event.health >= 85 ? chalk46.green : event.health >= 70 ? chalk46.yellow : event.health >= 50 ? chalk46.hex("#f97316") : chalk46.red;
19958
20237
  const patternStr = event.patterns.length > 0 ? event.patterns.map((p) => {
19959
- const c = p.severity === "concern" ? chalk45.red : p.severity === "warning" ? chalk45.yellow : chalk45.dim;
20238
+ const c = p.severity === "concern" ? chalk46.red : p.severity === "warning" ? chalk46.yellow : chalk46.dim;
19960
20239
  return c(p.id);
19961
- }).join(", ") : chalk45.green("none");
20240
+ }).join(", ") : chalk46.green("none");
19962
20241
  process.stdout.write(
19963
- `\r ${chalk45.dim("\u2502")} Health: ${healthColor(`${event.health}/100`)} (${event.grade}) ${chalk45.dim("\u2502")} Patterns: ${patternStr} ${chalk45.dim("\u2502")} Messages: ${chalk45.white(String(msgCount))} `
20242
+ `\r ${chalk46.dim("\u2502")} Health: ${healthColor(`${event.health}/100`)} (${event.grade}) ${chalk46.dim("\u2502")} Patterns: ${patternStr} ${chalk46.dim("\u2502")} Messages: ${chalk46.white(String(msgCount))} `
19964
20243
  );
19965
20244
  },
19966
20245
  onError(err) {
19967
- console.error(chalk45.red(`
20246
+ console.error(chalk46.red(`
19968
20247
  \u2717 Watcher error: ${err.message}`));
19969
20248
  },
19970
20249
  onReady() {
19971
20250
  console.log("");
19972
20251
  console.log(
19973
- chalk45.green(" \u25CF ") + chalk45.bold("Monitoring agent behavior in real-time")
20252
+ chalk46.green(" \u25CF ") + chalk46.bold("Monitoring agent behavior in real-time")
19974
20253
  );
19975
20254
  console.log(
19976
- chalk45.dim(" \u2502 Press Ctrl+C to stop") + chalk45.dim(" \xB7 Press s to share snapshot")
20255
+ chalk46.dim(" \u2502 Press Ctrl+C to stop") + chalk46.dim(" \xB7 Press s to share snapshot")
19977
20256
  );
19978
20257
  console.log("");
19979
20258
  }
@@ -19996,7 +20275,7 @@ async function liveCommand(options) {
19996
20275
  });
19997
20276
  }
19998
20277
  const shutdown = () => {
19999
- console.log(chalk45.dim("\n\n Stopping..."));
20278
+ console.log(chalk46.dim("\n\n Stopping..."));
20000
20279
  if (process.stdin.isTTY) process.stdin.setRawMode(false);
20001
20280
  watcher.stop();
20002
20281
  server.close();
@@ -20007,7 +20286,7 @@ async function liveCommand(options) {
20007
20286
  }
20008
20287
 
20009
20288
  // src/commands/adversarial.ts
20010
- import chalk46 from "chalk";
20289
+ import chalk47 from "chalk";
20011
20290
  import figures34 from "figures";
20012
20291
  import { resolve as resolve53 } from "path";
20013
20292
 
@@ -20742,13 +21021,14 @@ function formatGapSummary(gaps) {
20742
21021
  }
20743
21022
 
20744
21023
  // src/commands/adversarial.ts
21024
+ init_branding();
20745
21025
  async function adversarialCommand(options) {
20746
21026
  const specPath = resolve53(process.cwd(), options.personality);
20747
21027
  let spec;
20748
21028
  try {
20749
21029
  spec = loadSpec(specPath);
20750
21030
  } catch {
20751
- console.error(chalk46.red(` Could not read personality file: ${options.personality}`));
21031
+ console.error(chalk47.red(` Could not read personality file: ${options.personality}`));
20752
21032
  process.exit(1);
20753
21033
  return;
20754
21034
  }
@@ -20761,50 +21041,50 @@ async function adversarialCommand(options) {
20761
21041
  try {
20762
21042
  const models = await getOllamaModels();
20763
21043
  if (models.length === 0) {
20764
- console.log(chalk46.yellow(" Ollama is running but no models are installed."));
20765
- console.log(chalk46.dim(" Run: ollama pull llama3"));
21044
+ console.log(chalk47.yellow(" Ollama is running but no models are installed."));
21045
+ console.log(chalk47.dim(" Run: ollama pull llama3"));
20766
21046
  console.log();
20767
21047
  return;
20768
21048
  }
20769
21049
  const modelName = options.model ?? models[0].name;
20770
21050
  llmProvider = new OllamaProvider(modelName);
20771
- console.log(chalk46.dim(` Provider: Ollama (${modelName})`));
21051
+ console.log(chalk47.dim(` Provider: Ollama (${modelName})`));
20772
21052
  } catch {
20773
- console.log(chalk46.yellow(" Ollama is not running."));
20774
- console.log(chalk46.dim(" Install Ollama (ollama.com) or use --provider anthropic/openai"));
21053
+ console.log(chalk47.yellow(" Ollama is not running."));
21054
+ console.log(chalk47.dim(" Install Ollama (ollama.com) or use --provider anthropic/openai"));
20775
21055
  console.log();
20776
21056
  return;
20777
21057
  }
20778
21058
  } else if (providerName === "anthropic") {
20779
21059
  const apiKey = process.env.ANTHROPIC_API_KEY;
20780
21060
  if (!apiKey) {
20781
- console.log(chalk46.yellow(" ANTHROPIC_API_KEY not set."));
20782
- console.log(chalk46.dim(" Set it: export ANTHROPIC_API_KEY=sk-ant-..."));
21061
+ console.log(chalk47.yellow(" ANTHROPIC_API_KEY not set."));
21062
+ console.log(chalk47.dim(" Set it: export ANTHROPIC_API_KEY=sk-ant-..."));
20783
21063
  console.log();
20784
21064
  return;
20785
21065
  }
20786
21066
  llmProvider = createProvider({ provider: "anthropic", apiKey, model: options.model });
20787
- console.log(chalk46.dim(` Provider: Anthropic (${llmProvider.modelName})`));
21067
+ console.log(chalk47.dim(` Provider: Anthropic (${llmProvider.modelName})`));
20788
21068
  } else if (providerName === "openai") {
20789
21069
  const apiKey = process.env.OPENAI_API_KEY;
20790
21070
  if (!apiKey) {
20791
- console.log(chalk46.yellow(" OPENAI_API_KEY not set."));
20792
- console.log(chalk46.dim(" Set it: export OPENAI_API_KEY=sk-..."));
21071
+ console.log(chalk47.yellow(" OPENAI_API_KEY not set."));
21072
+ console.log(chalk47.dim(" Set it: export OPENAI_API_KEY=sk-..."));
20793
21073
  console.log();
20794
21074
  return;
20795
21075
  }
20796
21076
  llmProvider = createProvider({ provider: "openai", apiKey, model: options.model });
20797
- console.log(chalk46.dim(` Provider: OpenAI (${llmProvider.modelName})`));
21077
+ console.log(chalk47.dim(` Provider: OpenAI (${llmProvider.modelName})`));
20798
21078
  } else {
20799
- console.log(chalk46.yellow(` Unknown provider: ${providerName}`));
21079
+ console.log(chalk47.yellow(` Unknown provider: ${providerName}`));
20800
21080
  console.log();
20801
21081
  return;
20802
21082
  }
20803
21083
  if (categoryFilter) {
20804
- console.log(chalk46.dim(` Categories: ${categoryFilter.join(", ")}`));
21084
+ console.log(chalk47.dim(` Categories: ${categoryFilter.join(", ")}`));
20805
21085
  }
20806
21086
  if (mutationCount > 0) {
20807
- console.log(chalk46.dim(` Mutations: +${mutationCount} randomized variants`));
21087
+ console.log(chalk47.dim(` Mutations: +${mutationCount} randomized variants`));
20808
21088
  }
20809
21089
  console.log();
20810
21090
  const report = await runAdversarialSuite(spec, llmProvider, {
@@ -20813,53 +21093,53 @@ async function adversarialCommand(options) {
20813
21093
  skipNormal: options.skipNormal,
20814
21094
  callbacks: {
20815
21095
  onNormalBenchmarkStart: () => {
20816
- console.log(chalk46.bold(" Phase 1: Normal Benchmark (baseline)"));
20817
- console.log(chalk46.dim(" Running 8 standard scenarios..."));
21096
+ console.log(chalk47.bold(" Phase 1: Normal Benchmark (baseline)"));
21097
+ console.log(chalk47.dim(" Running 8 standard scenarios..."));
20818
21098
  console.log();
20819
21099
  },
20820
21100
  onNormalBenchmarkEnd: (normalReport) => {
20821
- const color = normalReport.grade === "A" ? chalk46.green : normalReport.grade === "B" ? chalk46.cyan : normalReport.grade === "C" ? chalk46.yellow : chalk46.red;
21101
+ const color = normalReport.grade === "A" ? chalk47.green : normalReport.grade === "B" ? chalk47.cyan : normalReport.grade === "C" ? chalk47.yellow : chalk47.red;
20822
21102
  console.log(` Normal Grade: ${color(normalReport.grade)} (${normalReport.score}/100)`);
20823
21103
  console.log();
20824
- console.log(chalk46.bold(" Phase 2: Adversarial Pressure"));
21104
+ console.log(chalk47.bold(" Phase 2: Adversarial Pressure"));
20825
21105
  console.log();
20826
21106
  },
20827
21107
  onScenarioStart: (scenario, index, total) => {
20828
- const progress = chalk46.dim(`[${index + 1}/${total}]`);
20829
- const catTag = chalk46.magenta(`[${scenario.category}]`);
20830
- console.log(` ${progress} ${catTag} ${chalk46.bold(scenario.name)}`);
20831
- console.log(chalk46.dim(` ${scenario.description}`));
21108
+ const progress = chalk47.dim(`[${index + 1}/${total}]`);
21109
+ const catTag = chalk47.magenta(`[${scenario.category}]`);
21110
+ console.log(` ${progress} ${catTag} ${chalk47.bold(scenario.name)}`);
21111
+ console.log(chalk47.dim(` ${scenario.description}`));
20832
21112
  },
20833
21113
  onScenarioEnd: (result, _index) => {
20834
- const icon = result.passed ? chalk46.green(figures34.tick) : chalk46.red(figures34.cross);
20835
- const detail = result.passed ? chalk46.dim("Resisted") : chalk46.yellow(result.detectedSeverity);
20836
- console.log(` ${icon} ${detail} \u2014 ${chalk46.dim(result.details)}`);
21114
+ const icon = result.passed ? chalk47.green(figures34.tick) : chalk47.red(figures34.cross);
21115
+ const detail = result.passed ? chalk47.dim("Resisted") : chalk47.yellow(result.detectedSeverity);
21116
+ console.log(` ${icon} ${detail} \u2014 ${chalk47.dim(result.details)}`);
20837
21117
  console.log();
20838
21118
  },
20839
21119
  onThinking: (label) => showTypingIndicator(label)
20840
21120
  }
20841
21121
  });
20842
- const normalColor = report.normalGrade === "A" ? chalk46.green : report.normalGrade === "B" ? chalk46.cyan : report.normalGrade === "C" ? chalk46.yellow : chalk46.red;
20843
- const adversarialColor = report.adversarialGrade === "A" ? chalk46.green : report.adversarialGrade === "B" ? chalk46.cyan : report.adversarialGrade === "C" ? chalk46.yellow : chalk46.red;
21122
+ const normalColor = report.normalGrade === "A" ? chalk47.green : report.normalGrade === "B" ? chalk47.cyan : report.normalGrade === "C" ? chalk47.yellow : chalk47.red;
21123
+ const adversarialColor = report.adversarialGrade === "A" ? chalk47.green : report.adversarialGrade === "B" ? chalk47.cyan : report.adversarialGrade === "C" ? chalk47.yellow : chalk47.red;
20844
21124
  const boxContent = [
20845
21125
  `Normal Grade: ${normalColor(report.normalGrade)}`,
20846
21126
  `Adversarial Grade: ${adversarialColor(report.adversarialGrade)}`,
20847
21127
  "",
20848
- `${chalk46.green(figures34.tick)} Resisted: ${report.passed}/${report.totalScenarios}`,
20849
- `${chalk46.red(figures34.cross)} Collapsed: ${report.failed}/${report.totalScenarios}`,
21128
+ `${chalk47.green(figures34.tick)} Resisted: ${report.passed}/${report.totalScenarios}`,
21129
+ `${chalk47.red(figures34.cross)} Collapsed: ${report.failed}/${report.totalScenarios}`,
20850
21130
  `Coverage: ${report.coveragePct.toFixed(1)}%`
20851
21131
  ];
20852
21132
  const boxStyle = report.adversarialGrade === "A" || report.adversarialGrade === "B" ? "success" : report.adversarialGrade === "C" ? "warning" : "concern";
20853
21133
  printBox(boxContent.join("\n"), boxStyle, `Adversarial Report \u2014 ${spec.name ?? "Agent"}`);
20854
21134
  console.log();
20855
21135
  if (report.gaps.length > 0) {
20856
- console.log(chalk46.bold(" Behavioral Gaps Found:"));
21136
+ console.log(chalk47.bold(" Behavioral Gaps Found:"));
20857
21137
  console.log(formatGapSummary(report.gaps));
20858
21138
  console.log();
20859
21139
  printBox(
20860
21140
  [
20861
- `Run ${chalk46.cyan("holomime evolve")} to address these gaps through recursive alignment.`,
20862
- `Or run ${chalk46.cyan("holomime align")} targeting specific patterns.`
21141
+ `Run ${chalk47.cyan("holomime evolve")} to address these gaps through recursive alignment.`,
21142
+ `Or run ${chalk47.cyan("holomime align")} targeting specific patterns.`
20863
21143
  ].join("\n"),
20864
21144
  "info"
20865
21145
  );
@@ -20872,12 +21152,12 @@ async function adversarialCommand(options) {
20872
21152
  console.log();
20873
21153
  }
20874
21154
  const seconds = (report.durationMs / 1e3).toFixed(1);
20875
- console.log(chalk46.dim(` Completed in ${seconds}s. ${report.categoriesTested.length} categories tested.`));
21155
+ console.log(chalk47.dim(` Completed in ${seconds}s. ${report.categoriesTested.length} categories tested.`));
20876
21156
  console.log();
20877
21157
  }
20878
21158
 
20879
21159
  // src/commands/policy.ts
20880
- import chalk47 from "chalk";
21160
+ import chalk48 from "chalk";
20881
21161
 
20882
21162
  // src/analysis/nl-to-policy.ts
20883
21163
  var PATTERN_KEYWORDS = {
@@ -21169,54 +21449,55 @@ function listPresets() {
21169
21449
  }
21170
21450
 
21171
21451
  // src/commands/policy.ts
21452
+ init_branding();
21172
21453
  async function policyCommand(requirements, options) {
21173
21454
  printHeader("NL-to-Policy \u2014 Behavioral Rule Generator");
21174
21455
  if (options.listPresets) {
21175
21456
  const presets = listPresets();
21176
- console.log(chalk47.bold(" Available Presets:"));
21457
+ console.log(chalk48.bold(" Available Presets:"));
21177
21458
  console.log();
21178
21459
  for (const preset of presets) {
21179
- console.log(` ${chalk47.cyan(preset.key)}`);
21180
- console.log(` ${chalk47.dim(preset.description)}`);
21181
- console.log(` ${chalk47.dim(`${preset.rules.length} rules`)}`);
21460
+ console.log(` ${chalk48.cyan(preset.key)}`);
21461
+ console.log(` ${chalk48.dim(preset.description)}`);
21462
+ console.log(` ${chalk48.dim(`${preset.rules.length} rules`)}`);
21182
21463
  console.log();
21183
21464
  }
21184
21465
  printBox(
21185
- `Use a preset: ${chalk47.cyan('holomime policy "enterprise_cs"')}`,
21466
+ `Use a preset: ${chalk48.cyan('holomime policy "enterprise_cs"')}`,
21186
21467
  "info"
21187
21468
  );
21188
21469
  console.log();
21189
21470
  return;
21190
21471
  }
21191
21472
  if (!requirements) {
21192
- console.log(chalk47.yellow(" No requirements provided."));
21193
- console.log(chalk47.dim(' Usage: holomime policy "Never be sycophantic with enterprise customers"'));
21473
+ console.log(chalk48.yellow(" No requirements provided."));
21474
+ console.log(chalk48.dim(' Usage: holomime policy "Never be sycophantic with enterprise customers"'));
21194
21475
  console.log();
21195
21476
  return;
21196
21477
  }
21197
- console.log(chalk47.dim(` Input: "${requirements}"`));
21478
+ console.log(chalk48.dim(` Input: "${requirements}"`));
21198
21479
  console.log();
21199
21480
  const policy = generateBehavioralPolicy(requirements, options.name);
21200
- const confColor = policy.confidence >= 0.7 ? chalk47.green : policy.confidence >= 0.4 ? chalk47.yellow : chalk47.red;
21481
+ const confColor = policy.confidence >= 0.7 ? chalk48.green : policy.confidence >= 0.4 ? chalk48.yellow : chalk48.red;
21201
21482
  const confLabel = policy.confidence >= 0.7 ? "HIGH" : policy.confidence >= 0.4 ? "MEDIUM" : "LOW";
21202
21483
  console.log(` Confidence: ${confColor(`${confLabel} (${(policy.confidence * 100).toFixed(0)}%)`)}`);
21203
21484
  if (policy.preset) {
21204
- console.log(` Preset: ${chalk47.cyan(policy.preset)}`);
21485
+ console.log(` Preset: ${chalk48.cyan(policy.preset)}`);
21205
21486
  }
21206
- console.log(` Rules generated: ${chalk47.bold(String(policy.rules.length))}`);
21487
+ console.log(` Rules generated: ${chalk48.bold(String(policy.rules.length))}`);
21207
21488
  console.log();
21208
- console.log(chalk47.bold(" Generated Policy:"));
21489
+ console.log(chalk48.bold(" Generated Policy:"));
21209
21490
  console.log();
21210
21491
  const yaml = formatPolicyYaml(policy);
21211
21492
  for (const line of yaml.split("\n")) {
21212
- console.log(` ${chalk47.dim("\u2502")} ${line}`);
21493
+ console.log(` ${chalk48.dim("\u2502")} ${line}`);
21213
21494
  }
21214
21495
  console.log();
21215
21496
  for (const rule of policy.rules) {
21216
- const effectColor = rule.effect === "deny" ? chalk47.red : rule.effect === "enforce" ? chalk47.cyan : chalk47.yellow;
21497
+ const effectColor = rule.effect === "deny" ? chalk48.red : rule.effect === "enforce" ? chalk48.cyan : chalk48.yellow;
21217
21498
  const effectIcon = rule.effect === "deny" ? "\u2715" : rule.effect === "enforce" ? "\u25B8" : "\u25C9";
21218
- console.log(` ${effectColor(effectIcon)} ${effectColor(rule.effect)} ${chalk47.bold(rule.pattern)} ${chalk47.dim(`(${rule.threshold}, risk ${rule.riskScore})`)}`);
21219
- console.log(` ${chalk47.dim(rule.description)}`);
21499
+ console.log(` ${effectColor(effectIcon)} ${effectColor(rule.effect)} ${chalk48.bold(rule.pattern)} ${chalk48.dim(`(${rule.threshold}, risk ${rule.riskScore})`)}`);
21500
+ console.log(` ${chalk48.dim(rule.description)}`);
21220
21501
  }
21221
21502
  console.log();
21222
21503
  if (policy.confidence < 0.4) {
@@ -21234,13 +21515,13 @@ async function policyCommand(requirements, options) {
21234
21515
  }
21235
21516
 
21236
21517
  // src/commands/compliance.ts
21237
- import chalk48 from "chalk";
21238
- import { writeFileSync as writeFileSync39 } from "fs";
21518
+ import chalk49 from "chalk";
21519
+ import { writeFileSync as writeFileSync40 } from "fs";
21239
21520
  import { resolve as resolve55 } from "path";
21240
21521
 
21241
21522
  // src/compliance/audit-trail.ts
21242
- import { readFileSync as readFileSync47, appendFileSync as appendFileSync2, existsSync as existsSync44, mkdirSync as mkdirSync27 } from "fs";
21243
- import { join as join40, resolve as resolve54 } from "path";
21523
+ import { readFileSync as readFileSync48, appendFileSync as appendFileSync2, existsSync as existsSync45, mkdirSync as mkdirSync28 } from "fs";
21524
+ import { join as join41, resolve as resolve54 } from "path";
21244
21525
  function djb2(str) {
21245
21526
  let hash = 5381;
21246
21527
  for (let i = 0; i < str.length; i++) {
@@ -21254,14 +21535,14 @@ function hashEntry(entry) {
21254
21535
  }
21255
21536
  function auditLogPath(agentHandle) {
21256
21537
  const dir = resolve54(process.cwd(), ".holomime", "audit");
21257
- if (!existsSync44(dir)) mkdirSync27(dir, { recursive: true });
21538
+ if (!existsSync45(dir)) mkdirSync28(dir, { recursive: true });
21258
21539
  const filename = agentHandle ? `${agentHandle}-audit.jsonl` : "audit.jsonl";
21259
- return join40(dir, filename);
21540
+ return join41(dir, filename);
21260
21541
  }
21261
21542
  function loadAuditLog(agentHandle) {
21262
21543
  const logPath = auditLogPath(agentHandle);
21263
- if (!existsSync44(logPath)) return [];
21264
- return readFileSync47(logPath, "utf-8").trim().split("\n").filter(Boolean).map((line) => {
21544
+ if (!existsSync45(logPath)) return [];
21545
+ return readFileSync48(logPath, "utf-8").trim().split("\n").filter(Boolean).map((line) => {
21265
21546
  try {
21266
21547
  return JSON.parse(line);
21267
21548
  } catch {
@@ -21710,6 +21991,7 @@ function formatReACTReportMarkdown(report) {
21710
21991
  }
21711
21992
 
21712
21993
  // src/commands/compliance.ts
21994
+ init_branding();
21713
21995
  async function complianceCommand(options) {
21714
21996
  printHeader("Compliance Report \u2014 ReACT Behavioral Audit");
21715
21997
  const now = /* @__PURE__ */ new Date();
@@ -21717,13 +21999,13 @@ async function complianceCommand(options) {
21717
21999
  const from = options.from ?? thirtyDaysAgo.toISOString().split("T")[0];
21718
22000
  const to = options.to ?? now.toISOString().split("T")[0];
21719
22001
  const frameworks = options.framework ? options.framework.split(",").map((s) => s.trim()) : void 0;
21720
- console.log(chalk48.dim(` Agent: ${options.agent}`));
21721
- console.log(chalk48.dim(` Period: ${from} to ${to}`));
22002
+ console.log(chalk49.dim(` Agent: ${options.agent}`));
22003
+ console.log(chalk49.dim(` Period: ${from} to ${to}`));
21722
22004
  if (frameworks) {
21723
- console.log(chalk48.dim(` Frameworks: ${frameworks.join(", ")}`));
22005
+ console.log(chalk49.dim(` Frameworks: ${frameworks.join(", ")}`));
21724
22006
  }
21725
22007
  console.log();
21726
- console.log(chalk48.dim(" Generating ReACT compliance report..."));
22008
+ console.log(chalk49.dim(" Generating ReACT compliance report..."));
21727
22009
  console.log();
21728
22010
  const report = generateReACTReport({
21729
22011
  agent: options.agent,
@@ -21732,181 +22014,63 @@ async function complianceCommand(options) {
21732
22014
  to,
21733
22015
  frameworks
21734
22016
  });
21735
- console.log(chalk48.bold(" ReACT Reasoning Trace:"));
22017
+ console.log(chalk49.bold(" ReACT Reasoning Trace:"));
21736
22018
  for (const step of report.steps) {
21737
- const phaseColor = step.phase === "reason" ? chalk48.cyan : step.phase === "act" ? chalk48.yellow : chalk48.green;
22019
+ const phaseColor = step.phase === "reason" ? chalk49.cyan : step.phase === "act" ? chalk49.yellow : chalk49.green;
21738
22020
  console.log(` ${phaseColor(`[${step.phase.toUpperCase()}]`)} ${step.action}`);
21739
- console.log(` ${chalk48.dim(step.result)}`);
22021
+ console.log(` ${chalk49.dim(step.result)}`);
21740
22022
  }
21741
22023
  console.log();
21742
- const chainIcon = report.chainIntegrity.verified ? chalk48.green("\u2713") : chalk48.red("\u2715");
22024
+ const chainIcon = report.chainIntegrity.verified ? chalk49.green("\u2713") : chalk49.red("\u2715");
21743
22025
  console.log(` Audit Chain: ${chainIcon} ${report.chainIntegrity.verified ? "Verified" : "FAILED"} (${report.chainIntegrity.totalEntries} entries)`);
21744
22026
  console.log();
21745
- console.log(chalk48.bold(" Statistics:"));
21746
- console.log(` ${chalk48.dim("Events:")} ${report.statistics.totalEvents} ${chalk48.dim("Diagnoses:")} ${report.statistics.diagnoses} ${chalk48.dim("Sessions:")} ${report.statistics.sessions}`);
21747
- console.log(` ${chalk48.dim("Drift:")} ${report.statistics.driftEvents} ${chalk48.dim("Violations:")} ${report.statistics.guardViolations} ${chalk48.dim("Avg Score:")} ${report.statistics.averageScore}/100`);
22027
+ console.log(chalk49.bold(" Statistics:"));
22028
+ console.log(` ${chalk49.dim("Events:")} ${report.statistics.totalEvents} ${chalk49.dim("Diagnoses:")} ${report.statistics.diagnoses} ${chalk49.dim("Sessions:")} ${report.statistics.sessions}`);
22029
+ console.log(` ${chalk49.dim("Drift:")} ${report.statistics.driftEvents} ${chalk49.dim("Violations:")} ${report.statistics.guardViolations} ${chalk49.dim("Avg Score:")} ${report.statistics.averageScore}/100`);
21748
22030
  console.log();
21749
22031
  if (report.riskFindings.length > 0) {
21750
- console.log(chalk48.bold(" Risk Findings:"));
22032
+ console.log(chalk49.bold(" Risk Findings:"));
21751
22033
  for (const finding of report.riskFindings) {
21752
- const sevColor = finding.severity === "critical" ? chalk48.red : finding.severity === "high" ? chalk48.yellow : finding.severity === "medium" ? chalk48.cyan : chalk48.dim;
22034
+ const sevColor = finding.severity === "critical" ? chalk49.red : finding.severity === "high" ? chalk49.yellow : finding.severity === "medium" ? chalk49.cyan : chalk49.dim;
21753
22035
  console.log(` ${sevColor(`[${finding.severity.toUpperCase()}]`)} ${finding.title}`);
21754
- console.log(` ${chalk48.dim(finding.recommendation)}`);
22036
+ console.log(` ${chalk49.dim(finding.recommendation)}`);
21755
22037
  }
21756
22038
  console.log();
21757
22039
  }
21758
- console.log(chalk48.bold(" Framework Compliance:"));
22040
+ console.log(chalk49.bold(" Framework Compliance:"));
21759
22041
  for (const section of report.frameworkSections) {
21760
- const statusColor = section.status === "compliant" ? chalk48.green : section.status === "partial" ? chalk48.yellow : section.status === "non_compliant" ? chalk48.red : chalk48.dim;
22042
+ const statusColor = section.status === "compliant" ? chalk49.green : section.status === "partial" ? chalk49.yellow : section.status === "non_compliant" ? chalk49.red : chalk49.dim;
21761
22043
  const statusLabel = section.status === "non_compliant" ? "NON-COMPLIANT" : section.status.toUpperCase().replace("_", " ");
21762
22044
  console.log(` ${statusColor("\u25CF")} ${section.framework}: ${statusColor(statusLabel)}`);
21763
22045
  }
21764
22046
  console.log();
21765
22047
  if (report.recommendations.length > 0) {
21766
- console.log(chalk48.bold(" Recommendations:"));
22048
+ console.log(chalk49.bold(" Recommendations:"));
21767
22049
  for (let i = 0; i < report.recommendations.length; i++) {
21768
- console.log(` ${chalk48.cyan(`${i + 1}.`)} ${report.recommendations[i]}`);
22050
+ console.log(` ${chalk49.cyan(`${i + 1}.`)} ${report.recommendations[i]}`);
21769
22051
  }
21770
22052
  console.log();
21771
22053
  }
21772
22054
  if (options.output) {
21773
22055
  const outputPath = resolve55(process.cwd(), options.output);
21774
22056
  const markdown = formatReACTReportMarkdown(report);
21775
- writeFileSync39(outputPath, markdown, "utf-8");
21776
- printBox(`Report saved to ${chalk48.cyan(options.output)}`, "success");
22057
+ writeFileSync40(outputPath, markdown, "utf-8");
22058
+ printBox(`Report saved to ${chalk49.cyan(options.output)}`, "success");
21777
22059
  console.log();
21778
22060
  } else {
21779
22061
  printBox(
21780
- `Save full report: ${chalk48.cyan(`holomime compliance --agent ${options.agent} -o report.md`)}`,
22062
+ `Save full report: ${chalk49.cyan(`holomime compliance --agent ${options.agent} -o report.md`)}`,
21781
22063
  "info"
21782
22064
  );
21783
22065
  console.log();
21784
22066
  }
21785
22067
  }
21786
22068
 
21787
- // src/commands/config.ts
21788
- import { readFileSync as readFileSync48, writeFileSync as writeFileSync40, existsSync as existsSync45, mkdirSync as mkdirSync28 } from "fs";
21789
- import { join as join41 } from "path";
21790
- import { homedir as homedir9 } from "os";
21791
- import chalk49 from "chalk";
21792
- function getConfigPath() {
21793
- return join41(homedir9(), ".holomime", "config.json");
21794
- }
21795
- function getConfigDir() {
21796
- return join41(homedir9(), ".holomime");
21797
- }
21798
- function loadConfig2() {
21799
- const configPath = getConfigPath();
21800
- if (!existsSync45(configPath)) return null;
21801
- try {
21802
- const data = JSON.parse(readFileSync48(configPath, "utf-8"));
21803
- if (data.provider && data.apiKey) return data;
21804
- return null;
21805
- } catch {
21806
- return null;
21807
- }
21808
- }
21809
- function saveConfig(config) {
21810
- const configDir = getConfigDir();
21811
- mkdirSync28(configDir, { recursive: true });
21812
- writeFileSync40(getConfigPath(), JSON.stringify(config, null, 2));
21813
- }
21814
- async function configCommand(options) {
21815
- printHeader("Config");
21816
- if (options.show) {
21817
- const config = loadConfig2();
21818
- if (config) {
21819
- console.log(chalk49.dim(" Provider: ") + chalk49.cyan(config.provider));
21820
- console.log(chalk49.dim(" API Key: ") + chalk49.cyan(config.apiKey.slice(0, 12) + "..." + config.apiKey.slice(-4)));
21821
- if (config.model) {
21822
- console.log(chalk49.dim(" Model: ") + chalk49.cyan(config.model));
21823
- }
21824
- console.log(chalk49.dim(" Config: ") + getConfigPath());
21825
- } else {
21826
- console.log(chalk49.yellow(" No config found. Run `holomime config` to set up."));
21827
- }
21828
- console.log();
21829
- return;
21830
- }
21831
- if (options.provider && options.key) {
21832
- const config = {
21833
- provider: options.provider,
21834
- apiKey: options.key
21835
- };
21836
- saveConfig(config);
21837
- console.log(chalk49.green(" Config saved!"));
21838
- console.log(chalk49.dim(` Provider: ${config.provider}`));
21839
- console.log(chalk49.dim(` Location: ${getConfigPath()}`));
21840
- console.log();
21841
- printNextSteps();
21842
- return;
21843
- }
21844
- console.log(chalk49.dim(" Set up your API key so every command just works."));
21845
- console.log(chalk49.dim(" This saves to ~/.holomime/config.json (one-time setup)."));
21846
- console.log();
21847
- const readline = await import("readline");
21848
- const rl = readline.createInterface({
21849
- input: process.stdin,
21850
- output: process.stdout
21851
- });
21852
- const ask = (question) => new Promise((resolve57) => rl.question(question, resolve57));
21853
- try {
21854
- console.log(chalk49.dim(" 1) anthropic") + chalk49.dim(" enter your sk-ant-... key"));
21855
- console.log(chalk49.dim(" 2) openai") + chalk49.dim(" enter your sk-... key"));
21856
- console.log();
21857
- const providerInput = (await ask(" Select provider (1 or 2): ")).trim();
21858
- let provider;
21859
- if (providerInput === "1" || providerInput.toLowerCase() === "anthropic") {
21860
- provider = "anthropic";
21861
- } else if (providerInput === "2" || providerInput.toLowerCase() === "openai") {
21862
- provider = "openai";
21863
- } else if (providerInput === "") {
21864
- console.log(chalk49.dim(" Skipped. Run `holomime config` when ready."));
21865
- rl.close();
21866
- return;
21867
- } else {
21868
- console.log(chalk49.red(` Invalid selection: ${providerInput}`));
21869
- rl.close();
21870
- return;
21871
- }
21872
- console.log(chalk49.dim(` Selected: ${provider}`));
21873
- console.log();
21874
- const keyHint = provider === "anthropic" ? "sk-ant-..." : "sk-...";
21875
- const apiKey = (await ask(` API Key (${keyHint}): `)).trim();
21876
- if (!apiKey) {
21877
- console.log(chalk49.dim(" Skipped. Run `holomime config` when ready."));
21878
- rl.close();
21879
- return;
21880
- }
21881
- const config = { provider, apiKey };
21882
- saveConfig(config);
21883
- console.log();
21884
- console.log(chalk49.green(" Config saved!"));
21885
- console.log(chalk49.dim(` Location: ${getConfigPath()}`));
21886
- console.log();
21887
- printNextSteps();
21888
- rl.close();
21889
- } catch {
21890
- rl.close();
21891
- }
21892
- }
21893
- function printNextSteps() {
21894
- console.log(chalk49.bold(" NEXT STEP") + chalk49.dim(" \u2014 profile your agent:"));
21895
- console.log();
21896
- console.log(chalk49.dim(" Already have an agent?"));
21897
- console.log(chalk49.cyan(" holomime personality") + chalk49.dim(" Define how it should behave"));
21898
- console.log(chalk49.cyan(" holomime diagnose") + chalk49.dim(" Analyze its conversation logs"));
21899
- console.log();
21900
- console.log(chalk49.dim(" Building for a robot?"));
21901
- console.log(chalk49.cyan(" holomime identity") + chalk49.dim(" Full 8-file identity stack with body.api"));
21902
- console.log();
21903
- console.log(chalk49.dim(" Then fix and verify:"));
21904
- console.log(chalk49.cyan(" holomime therapy") + chalk49.dim(" Run in background \u2014 generate data, detect regression"));
21905
- console.log(chalk49.cyan(" holomime cure") + chalk49.dim(" Full pipeline \u2014 diagnose, fine-tune, verify"));
21906
- console.log();
21907
- }
22069
+ // src/cli.ts
22070
+ init_config();
21908
22071
 
21909
22072
  // src/commands/mira-cmd.ts
22073
+ init_branding();
21910
22074
  import chalk50 from "chalk";
21911
22075
  import { writeFileSync as writeFileSync41, readFileSync as readFileSync49, mkdirSync as mkdirSync29, existsSync as existsSync46 } from "fs";
21912
22076
  import { resolve as resolve56, join as join42 } from "path";
@@ -22565,7 +22729,7 @@ program.command("share").description("Share DPO training pairs to the marketplac
22565
22729
  program.command("interview").description("Self-awareness interview \u2014 score your agent's metacognition across 4 dimensions [Pro]").requiredOption("--personality <path>", "Path to .personality.json").option("--provider <provider>", "LLM provider (ollama, anthropic, openai)", "ollama").option("--model <model>", "Model override").action(interviewCommand);
22566
22730
  program.command("prescribe").description("Diagnose and prescribe DPO treatments from the behavioral corpus [Pro]").requiredOption("--personality <path>", "Path to .personality.json").requiredOption("--log <path>", "Path to conversation log").option("--format <format>", "Log format (holomime, chatgpt, claude, openai-api, anthropic-api, otel, jsonl)").option("--source <source>", "Correction source (corpus, marketplace, both)", "corpus").option("--apply", "Apply found treatments").option("-o, --output <path>", "Write prescription to file").action(prescribeCommand);
22567
22731
  program.command("voice").description("Monitor voice conversations for behavioral drift in real-time [Pro]").requiredOption("--personality <path>", "Path to .personality.json").option("--platform <name>", "Voice platform: livekit, vapi, retell, generic", "generic").option("--room <name>", "LiveKit room name").option("--server-url <url>", "LiveKit server URL").option("--webhook-port <port>", "Vapi webhook port (default: 3001)").option("--agent-id <id>", "Retell agent ID").option("--input <path>", "Input transcript file (JSONL) for offline analysis").option("--interval <ms>", "Diagnosis interval in milliseconds (default: 15000)").option("--threshold <level>", "Alert threshold: warning or concern (default: warning)").action(voiceCommand);
22568
- program.command("cure").description("Full pipeline \u2014 diagnose, generate training data, fine-tune, verify").option("--personality <path>", "Path to .personality.json (auto-detected)").option("--log <path>", "Path to conversation log (JSON). If omitted, auto-generates from benchmark scenarios").option("--provider <provider>", "Training provider (openai, huggingface)", "openai").option("--base-model <model>", "Base model to fine-tune", "gpt-4o-mini-2024-07-18").option("--method <method>", "Training method (auto, sft, dpo)", "auto").option("--epochs <n>", "Number of training epochs").option("--suffix <name>", "Model name suffix").option("--skip-train", "Skip training step (diagnose + export only)").option("--skip-verify", "Skip post-training verification").option("--dry-run", "Preview pipeline plan without executing").option("--push", "Push trained model to HuggingFace Hub").option("--hub-repo <repo>", "HuggingFace Hub repo (user/model-name)").option("--pass-threshold <n>", "Minimum verification score (0-100)", "50").action(async (options) => {
22732
+ program.command("cure").description("Full pipeline \u2014 diagnose, generate training data, fine-tune, verify").option("--personality <path>", "Path to .personality.json (auto-detected)").option("--log <path>", "Path to conversation log (JSON). If omitted, auto-generates from benchmark scenarios").option("--provider <provider>", "Training provider (openai, huggingface)", "openai").option("--base-model <model>", "Base model to fine-tune", "gpt-4o-mini-2024-07-18").option("--method <method>", "Training method (auto, sft, dpo)", "auto").option("--epochs <n>", "Number of training epochs").option("--suffix <name>", "Model name suffix").option("--skip-train", "Skip training step (diagnose + export only)").option("--skip-verify", "Skip post-training verification").option("--export-only", "Export training data only (for teams with their own training infrastructure)").option("--dry-run", "Preview pipeline plan without executing").option("--push", "Push trained model to HuggingFace Hub").option("--hub-repo <repo>", "HuggingFace Hub repo (user/model-name)").option("--pass-threshold <n>", "Minimum verification score (0-100)", "50").action(async (options) => {
22569
22733
  const resolved = autoDetect({ personality: options.personality, provider: options.provider, model: options.model });
22570
22734
  options.personality = resolved.personalityPath;
22571
22735
  if (!options.provider || options.provider === "ollama") options.provider = resolved.provider;