nothumanallowed 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nothumanallowed",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "NotHumanAllowed — 38 specialized AI agents for security, code, DevOps, data, and more. Use them individually or let them collaborate via multi-round deliberation.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/constants.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import os from 'os';
2
2
  import path from 'path';
3
3
 
4
- export const VERSION = '1.0.0';
4
+ export const VERSION = '1.0.1';
5
5
  export const BASE_URL = 'https://nothumanallowed.com/cli';
6
6
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
7
7
 
package/src/spawn.mjs CHANGED
@@ -1,8 +1,55 @@
1
1
  /** Spawn legion-x.mjs or pif.mjs as child process with stdio inherited */
2
2
 
3
+ import fs from 'fs';
4
+ import path from 'path';
3
5
  import { spawn } from 'child_process';
4
- import { loadConfig, configToEnv } from './config.mjs';
5
- import { LEGION_FILE, PIF_FILE, AGENTS_DIR, EXTENSIONS_DIR, SESSIONS_DIR, CONFIG_FILE } from './constants.mjs';
6
+ import { loadConfig } from './config.mjs';
7
+ import { NHA_DIR, LEGION_FILE, PIF_FILE, AGENTS_DIR, EXTENSIONS_DIR, SESSIONS_DIR } from './constants.mjs';
8
+
9
+ /**
10
+ * Write a Legion-compatible flat config from the NHA structured config.
11
+ * Legion expects: { llmProvider, llmApiKey, nhaAgentId, nhaPrivateKeyPem, ... }
12
+ * NHA stores: { llm: { provider, apiKey }, agent: { id, privateKeyPem }, ... }
13
+ */
14
+ function writeLegionConfig(config) {
15
+ const legionConfig = {
16
+ llmProvider: config.llm?.provider || 'anthropic',
17
+ llmApiKey: config.llm?.apiKey || '',
18
+ llmModel: config.llm?.model || '',
19
+ openaiKey: config.llm?.openaiKey || '',
20
+ geminiKey: config.llm?.geminiKey || '',
21
+ deepseekKey: config.llm?.deepseekKey || '',
22
+ grokKey: config.llm?.grokKey || '',
23
+ mistralKey: config.llm?.mistralKey || '',
24
+ cohereKey: config.llm?.cohereKey || '',
25
+ timeout: config.llm?.timeout || 120000,
26
+ maxRetries: config.llm?.maxRetries || 2,
27
+ parallelism: config.llm?.parallelism || 4,
28
+ verbose: config.features?.verbose ?? true,
29
+ immersive: config.features?.immersive ?? true,
30
+ knowledgeEnabled: config.features?.knowledgeEnabled ?? true,
31
+ workspaceEnabled: config.features?.workspaceEnabled ?? true,
32
+ latentSpaceEnabled: config.features?.latentSpaceEnabled ?? true,
33
+ knowledgeGraphEnabled: config.features?.knowledgeGraphEnabled ?? true,
34
+ promptEvolutionEnabled: config.features?.promptEvolutionEnabled ?? true,
35
+ metaIntelligenceEnabled: config.features?.metaIntelligenceEnabled ?? true,
36
+ deliberationEnabled: config.deliberation?.enabled ?? true,
37
+ deliberationRounds: config.deliberation?.rounds || 3,
38
+ deliberationConvergence: config.deliberation?.convergence || 0.82,
39
+ minDeliberationRounds: config.deliberation?.minRounds || 2,
40
+ semanticConvergenceEnabled: config.deliberation?.semanticConvergence ?? true,
41
+ tribunalEnabled: config.deliberation?.tribunalEnabled ?? true,
42
+ // Agent identity
43
+ nhaAgentId: config.agent?.id || '',
44
+ nhaAgentName: config.agent?.name || '',
45
+ nhaPrivateKeyPem: config.agent?.privateKeyPem || '',
46
+ nhaPublicKeyHex: config.agent?.publicKeyHex || '',
47
+ };
48
+
49
+ const legionConfigFile = path.join(NHA_DIR, '.legion-config.json');
50
+ fs.writeFileSync(legionConfigFile, JSON.stringify(legionConfig, null, 2) + '\n', 'utf-8');
51
+ return legionConfigFile;
52
+ }
6
53
 
7
54
  /**
8
55
  * Spawn a core file (legion-x.mjs or pif.mjs) with the user's terminal.
@@ -13,13 +60,18 @@ import { LEGION_FILE, PIF_FILE, AGENTS_DIR, EXTENSIONS_DIR, SESSIONS_DIR, CONFIG
13
60
  export function spawnCore(target, args) {
14
61
  const file = target === 'legion' ? LEGION_FILE : PIF_FILE;
15
62
  const config = loadConfig();
63
+
64
+ // For Legion: write a flat config it can understand
65
+ const configFile = target === 'legion'
66
+ ? writeLegionConfig(config)
67
+ : path.join(NHA_DIR, 'config.json');
68
+
16
69
  const env = {
17
70
  ...process.env,
18
- ...configToEnv(config),
19
71
  NHA_AGENTS_DIR: AGENTS_DIR,
20
72
  NHA_EXTENSIONS_DIR: EXTENSIONS_DIR,
21
73
  NHA_SESSIONS_DIR: SESSIONS_DIR,
22
- NHA_CONFIG_FILE: CONFIG_FILE,
74
+ NHA_CONFIG_FILE: configFile,
23
75
  };
24
76
 
25
77
  return new Promise((resolve) => {