@neuroverseos/governance 0.5.0 → 0.6.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 (133) hide show
  1. package/README.md +244 -0
  2. package/dist/adapters/autoresearch.d.cts +2 -1
  3. package/dist/adapters/autoresearch.d.ts +2 -1
  4. package/dist/adapters/autoresearch.js +2 -2
  5. package/dist/adapters/deep-agents.d.cts +3 -2
  6. package/dist/adapters/deep-agents.d.ts +3 -2
  7. package/dist/adapters/deep-agents.js +2 -2
  8. package/dist/adapters/express.d.cts +2 -1
  9. package/dist/adapters/express.d.ts +2 -1
  10. package/dist/adapters/express.js +2 -2
  11. package/dist/adapters/github.cjs +1697 -0
  12. package/dist/adapters/github.d.cts +225 -0
  13. package/dist/adapters/github.d.ts +225 -0
  14. package/dist/adapters/github.js +27 -0
  15. package/dist/adapters/index.d.cts +4 -316
  16. package/dist/adapters/index.d.ts +4 -316
  17. package/dist/adapters/index.js +23 -21
  18. package/dist/adapters/langchain.d.cts +3 -2
  19. package/dist/adapters/langchain.d.ts +3 -2
  20. package/dist/adapters/langchain.js +2 -2
  21. package/dist/adapters/mentraos.cjs +2181 -0
  22. package/dist/adapters/mentraos.d.cts +319 -0
  23. package/dist/adapters/mentraos.d.ts +319 -0
  24. package/dist/{mentraos-LLH7KEV4.js → adapters/mentraos.js} +12 -10
  25. package/dist/adapters/openai.d.cts +3 -2
  26. package/dist/adapters/openai.d.ts +3 -2
  27. package/dist/adapters/openai.js +2 -2
  28. package/dist/adapters/openclaw.d.cts +3 -2
  29. package/dist/adapters/openclaw.d.ts +3 -2
  30. package/dist/adapters/openclaw.js +2 -2
  31. package/dist/{add-LYHDZ5RL.js → add-XSANI3FK.js} +1 -1
  32. package/dist/admin/index.cjs +2214 -0
  33. package/dist/admin/index.d.cts +362 -0
  34. package/dist/admin/index.d.ts +362 -0
  35. package/dist/admin/index.js +703 -0
  36. package/dist/bootstrap-contract-DcV6t-8M.d.cts +216 -0
  37. package/dist/bootstrap-contract-DcV6t-8M.d.ts +216 -0
  38. package/dist/{build-SCAWPA7E.js → build-UTVDGHB3.js} +5 -5
  39. package/dist/{chunk-JKGPSFGH.js → chunk-7FL3U7Z5.js} +3 -3
  40. package/dist/chunk-A2UZTLRV.js +421 -0
  41. package/dist/{chunk-TD5GKIHP.js → chunk-B3IIPTY3.js} +3 -3
  42. package/dist/chunk-EQR7BGFN.js +337 -0
  43. package/dist/{chunk-5JUZ4HL7.js → chunk-FDPPZLSQ.js} +3 -3
  44. package/dist/{chunk-MFKHTE5R.js → chunk-FKQCPRKI.js} +3 -3
  45. package/dist/{chunk-7D7PZLB7.js → chunk-FS2UUJJO.js} +3 -3
  46. package/dist/{chunk-U6FRAEQJ.js → chunk-GJ6LM4JZ.js} +1 -441
  47. package/dist/chunk-H3REGQRI.js +107 -0
  48. package/dist/{chunk-25XHSTPT.js → chunk-HDNDL6D5.js} +3 -3
  49. package/dist/{chunk-BXLTEUS4.js → chunk-I4RTIMLX.js} +2 -2
  50. package/dist/chunk-IOVXB6QN.js +447 -0
  51. package/dist/{chunk-Y6WXAPKY.js → chunk-NTHXZAW4.js} +3 -3
  52. package/dist/{chunk-UTH7OXTM.js → chunk-OTZU76DH.js} +22 -4
  53. package/dist/{chunk-DWHUZUEY.js → chunk-T6GMRZWC.js} +3 -3
  54. package/dist/{chunk-V4FZHJQX.js → chunk-TIXVEPS2.js} +3 -3
  55. package/dist/{chunk-YNYCQECH.js → chunk-TJ5L2UTE.js} +3 -3
  56. package/dist/chunk-UGTNKTHS.js +542 -0
  57. package/dist/cli/neuroverse.cjs +3372 -523
  58. package/dist/cli/neuroverse.js +53 -21
  59. package/dist/cli/plan.js +2 -2
  60. package/dist/cli/run.cjs +242 -139
  61. package/dist/cli/run.js +23 -3
  62. package/dist/cli/worldmodel.cjs +1624 -0
  63. package/dist/cli/worldmodel.d.cts +24 -0
  64. package/dist/cli/worldmodel.d.ts +24 -0
  65. package/dist/cli/worldmodel.js +742 -0
  66. package/dist/{demo-66MMJTEH.js → demo-6W3YXLAX.js} +4 -4
  67. package/dist/{derive-AUQE3L3P.js → derive-42IJW7JI.js} +4 -4
  68. package/dist/{doctor-EY7LKSYY.js → doctor-XEMLO6UA.js} +3 -2
  69. package/dist/engine/bootstrap-emitter.cjs +241 -0
  70. package/dist/engine/bootstrap-emitter.d.cts +27 -0
  71. package/dist/engine/bootstrap-emitter.d.ts +27 -0
  72. package/dist/{bootstrap-emitter-GIMOJFOC.js → engine/bootstrap-emitter.js} +2 -2
  73. package/dist/engine/bootstrap-parser.cjs +560 -0
  74. package/dist/engine/bootstrap-parser.d.cts +96 -0
  75. package/dist/engine/bootstrap-parser.d.ts +96 -0
  76. package/dist/{bootstrap-parser-LBLGVEMU.js → engine/bootstrap-parser.js} +2 -2
  77. package/dist/engine/guard-engine.cjs +1116 -0
  78. package/dist/engine/guard-engine.d.cts +60 -0
  79. package/dist/engine/guard-engine.d.ts +60 -0
  80. package/dist/{guard-engine-N7TUIUU7.js → engine/guard-engine.js} +3 -3
  81. package/dist/engine/simulate-engine.cjs +390 -0
  82. package/dist/engine/simulate-engine.d.cts +105 -0
  83. package/dist/engine/simulate-engine.d.ts +105 -0
  84. package/dist/engine/simulate-engine.js +9 -0
  85. package/dist/engine/worldmodel-compiler.cjs +366 -0
  86. package/dist/engine/worldmodel-compiler.d.cts +46 -0
  87. package/dist/engine/worldmodel-compiler.d.ts +46 -0
  88. package/dist/engine/worldmodel-compiler.js +17 -0
  89. package/dist/engine/worldmodel-parser.cjs +566 -0
  90. package/dist/engine/worldmodel-parser.d.cts +22 -0
  91. package/dist/engine/worldmodel-parser.d.ts +22 -0
  92. package/dist/engine/worldmodel-parser.js +7 -0
  93. package/dist/{equity-penalties-WWC7UDQD.js → equity-penalties-CCO3GVHS.js} +6 -6
  94. package/dist/{explain-MUSGDT67.js → explain-HDFN4ION.js} +1 -1
  95. package/dist/{guard-W3BMQPBJ.js → guard-IHJEKHL2.js} +16 -4
  96. package/dist/{guard-contract-CLBbTGK_.d.ts → guard-contract-ddiIPlOg.d.cts} +2 -369
  97. package/dist/{guard-contract-CLBbTGK_.d.cts → guard-contract-q6HJAq3Q.d.ts} +2 -369
  98. package/dist/{improve-PJDAWW4Q.js → improve-LRORRYEX.js} +3 -3
  99. package/dist/index.cjs +471 -1
  100. package/dist/index.d.cts +14 -492
  101. package/dist/index.d.ts +14 -492
  102. package/dist/index.js +63 -42
  103. package/dist/keygen-BSZH3NM2.js +77 -0
  104. package/dist/{lens-IP6GIZ2Q.js → lens-TLDZQXBI.js} +152 -26
  105. package/dist/{mcp-server-OG3PPVD2.js → mcp-server-CKYBHXWK.js} +2 -2
  106. package/dist/migrate-NH5PVMX4.js +221 -0
  107. package/dist/{playground-4BK2XQ47.js → playground-3TTBN7XD.js} +5 -5
  108. package/dist/{redteam-BRZALBPP.js → redteam-W644UMWN.js} +3 -3
  109. package/dist/{session-SGRUT2UH.js → session-FMAROEIE.js} +2 -2
  110. package/dist/{shared-CwGpPheR.d.ts → shared-DAzdfWtU.d.ts} +1 -1
  111. package/dist/{shared-BGzmYP5g.d.cts → shared-PpalGKxc.d.cts} +1 -1
  112. package/dist/sign-RRELHKWM.js +11 -0
  113. package/dist/{simulate-FGXKIH7V.js → simulate-VT437EEL.js} +2 -2
  114. package/dist/{test-PT44BSYG.js → test-XDB2DH3L.js} +3 -3
  115. package/dist/types.cjs +18 -0
  116. package/dist/types.d.cts +370 -0
  117. package/dist/types.d.ts +370 -0
  118. package/dist/types.js +0 -0
  119. package/dist/{validate-Q5O5TGLT.js → validate-M52DX22Y.js} +1 -1
  120. package/dist/verify-6AVTWX75.js +151 -0
  121. package/dist/{world-V52ZMH26.js → world-O4HTQPDP.js} +1 -1
  122. package/dist/{world-loader-C4D3VPP3.js → world-loader-YTYFOP7D.js} +1 -1
  123. package/dist/worldmodel-contract-BPGhiuW5.d.cts +221 -0
  124. package/dist/worldmodel-contract-BPGhiuW5.d.ts +221 -0
  125. package/dist/worlds/auki-vanguard.worldmodel.md +116 -0
  126. package/dist/worlds/behavioral-demo.nv-world.md +130 -0
  127. package/dist/worlds/neuroverse-governance.worldmodel.md +115 -0
  128. package/package.json +44 -3
  129. package/dist/{bootstrap-IP5QMC3Q.js → bootstrap-2OW5ZLBL.js} +3 -3
  130. package/dist/{chunk-4G6WHPLI.js → chunk-735Z3HA4.js} +6 -6
  131. package/dist/{chunk-7QIAF377.js → chunk-CYDMUJVZ.js} +0 -0
  132. package/dist/{configure-ai-LL3VAPQW.js → configure-ai-5MP5DWTT.js} +3 -3
  133. package/dist/{decision-flow-3K4D72G4.js → decision-flow-IJPNMVQK.js} +3 -3
@@ -0,0 +1,221 @@
1
+ import "./chunk-QWGCMQQD.js";
2
+
3
+ // src/cli/migrate.ts
4
+ import { readFileSync, writeFileSync, cpSync, existsSync } from "fs";
5
+ import { join } from "path";
6
+ var USAGE = `
7
+ neuroverse migrate \u2014 World schema version migration
8
+
9
+ Usage:
10
+ neuroverse migrate --world <dir> [options]
11
+
12
+ Options:
13
+ --world <dir> World directory to migrate (required)
14
+ --dry-run Show what would change without modifying files
15
+ --backup Copy original world to <dir>.backup before migrating
16
+ --target <version> Target schema version (default: latest)
17
+ --json Output migration plan as JSON
18
+
19
+ Examples:
20
+ neuroverse migrate --world ./world/ --dry-run
21
+ neuroverse migrate --world ./world/ --backup
22
+ neuroverse migrate --world ./world/ --target 1.1.0
23
+ `.trim();
24
+ var MIGRATIONS = [
25
+ {
26
+ from: "1.0.0",
27
+ to: "1.1.0",
28
+ description: "Add enforcement_level to world.json, normalize metadata fields",
29
+ apply: (worldPath) => {
30
+ const changes = [];
31
+ const worldJsonPath = join(worldPath, "world.json");
32
+ if (existsSync(worldJsonPath)) {
33
+ const world = JSON.parse(readFileSync(worldJsonPath, "utf-8"));
34
+ if (!world.enforcement_level) {
35
+ world.enforcement_level = "standard";
36
+ writeFileSync(worldJsonPath, JSON.stringify(world, null, 2) + "\n", "utf-8");
37
+ changes.push({
38
+ file: "world.json",
39
+ action: "modified",
40
+ description: 'Added enforcement_level: "standard"'
41
+ });
42
+ }
43
+ }
44
+ const metaPath = join(worldPath, "metadata.json");
45
+ if (existsSync(metaPath)) {
46
+ const meta = JSON.parse(readFileSync(metaPath, "utf-8"));
47
+ let modified = false;
48
+ if (meta.configurator_version && !meta.authoring_method) {
49
+ meta.authoring_method = meta.configurator_version;
50
+ delete meta.configurator_version;
51
+ modified = true;
52
+ }
53
+ if (!meta.schema_version) {
54
+ meta.schema_version = "1.1.0";
55
+ modified = true;
56
+ } else {
57
+ meta.schema_version = "1.1.0";
58
+ modified = true;
59
+ }
60
+ if (modified) {
61
+ writeFileSync(metaPath, JSON.stringify(meta, null, 2) + "\n", "utf-8");
62
+ changes.push({
63
+ file: "metadata.json",
64
+ action: "modified",
65
+ description: "Normalized metadata fields, updated schema_version to 1.1.0"
66
+ });
67
+ }
68
+ }
69
+ return changes;
70
+ }
71
+ }
72
+ ];
73
+ var LATEST_VERSION = MIGRATIONS.length > 0 ? MIGRATIONS[MIGRATIONS.length - 1].to : "1.0.0";
74
+ function detectVersion(worldPath) {
75
+ const metaPath = join(worldPath, "metadata.json");
76
+ if (existsSync(metaPath)) {
77
+ try {
78
+ const meta = JSON.parse(readFileSync(metaPath, "utf-8"));
79
+ if (meta.schema_version) return meta.schema_version;
80
+ } catch {
81
+ }
82
+ }
83
+ return "1.0.0";
84
+ }
85
+ function compareVersions(a, b) {
86
+ const pa = a.split(".").map(Number);
87
+ const pb = b.split(".").map(Number);
88
+ for (let i = 0; i < 3; i++) {
89
+ if ((pa[i] ?? 0) < (pb[i] ?? 0)) return -1;
90
+ if ((pa[i] ?? 0) > (pb[i] ?? 0)) return 1;
91
+ }
92
+ return 0;
93
+ }
94
+ function findMigrationPath(from, to) {
95
+ const path = [];
96
+ let current = from;
97
+ while (compareVersions(current, to) < 0) {
98
+ const next = MIGRATIONS.find((m) => m.from === current);
99
+ if (!next) break;
100
+ path.push(next);
101
+ current = next.to;
102
+ }
103
+ return path;
104
+ }
105
+ function parseArgs(argv) {
106
+ let worldPath = "";
107
+ let dryRun = false;
108
+ let backup = false;
109
+ let target = LATEST_VERSION;
110
+ let json = false;
111
+ let help = false;
112
+ for (let i = 0; i < argv.length; i++) {
113
+ const arg = argv[i];
114
+ if (arg === "--world" && argv[i + 1]) {
115
+ worldPath = argv[++i];
116
+ } else if (arg === "--dry-run") {
117
+ dryRun = true;
118
+ } else if (arg === "--backup") {
119
+ backup = true;
120
+ } else if (arg === "--target" && argv[i + 1]) {
121
+ target = argv[++i];
122
+ } else if (arg === "--json") {
123
+ json = true;
124
+ } else if (arg === "--help" || arg === "-h") {
125
+ help = true;
126
+ }
127
+ }
128
+ return { worldPath, dryRun, backup, target, json, help };
129
+ }
130
+ async function main(argv = process.argv.slice(2)) {
131
+ const args = parseArgs(argv);
132
+ if (args.help) {
133
+ process.stdout.write(USAGE + "\n");
134
+ return;
135
+ }
136
+ if (!args.worldPath) {
137
+ process.stderr.write("Error: --world <dir> is required.\n");
138
+ process.exit(1);
139
+ }
140
+ const currentVersion = detectVersion(args.worldPath);
141
+ const targetVersion = args.target;
142
+ if (compareVersions(currentVersion, targetVersion) >= 0) {
143
+ const plan2 = {
144
+ currentVersion,
145
+ targetVersion,
146
+ migrations: [],
147
+ changes: []
148
+ };
149
+ if (args.json) {
150
+ process.stdout.write(JSON.stringify(plan2, null, 2) + "\n");
151
+ } else {
152
+ process.stdout.write(`World is already at version ${currentVersion} (target: ${targetVersion})
153
+ `);
154
+ process.stdout.write("No migrations needed.\n");
155
+ }
156
+ return;
157
+ }
158
+ const migrationPath = findMigrationPath(currentVersion, targetVersion);
159
+ if (migrationPath.length === 0) {
160
+ process.stderr.write(`No migration path from ${currentVersion} to ${targetVersion}
161
+ `);
162
+ process.exit(1);
163
+ return;
164
+ }
165
+ if (args.dryRun) {
166
+ const plan2 = {
167
+ currentVersion,
168
+ targetVersion,
169
+ migrations: migrationPath.map((m) => ({ from: m.from, to: m.to, description: m.description })),
170
+ changes: []
171
+ };
172
+ if (args.json) {
173
+ process.stdout.write(JSON.stringify(plan2, null, 2) + "\n");
174
+ } else {
175
+ process.stdout.write(`Migration plan: ${currentVersion} \u2192 ${targetVersion}
176
+ `);
177
+ process.stdout.write(`Steps: ${migrationPath.length}
178
+
179
+ `);
180
+ for (const m of migrationPath) {
181
+ process.stdout.write(` ${m.from} \u2192 ${m.to}: ${m.description}
182
+ `);
183
+ }
184
+ process.stdout.write("\nRun without --dry-run to apply.\n");
185
+ }
186
+ return;
187
+ }
188
+ if (args.backup) {
189
+ const backupPath = args.worldPath + ".backup";
190
+ cpSync(args.worldPath, backupPath, { recursive: true });
191
+ process.stdout.write(`Backup created: ${backupPath}
192
+ `);
193
+ }
194
+ const allChanges = [];
195
+ for (const migration of migrationPath) {
196
+ process.stdout.write(`Applying: ${migration.from} \u2192 ${migration.to} (${migration.description})
197
+ `);
198
+ const changes = migration.apply(args.worldPath);
199
+ allChanges.push(...changes);
200
+ for (const change of changes) {
201
+ process.stdout.write(` ${change.action}: ${change.file} \u2014 ${change.description}
202
+ `);
203
+ }
204
+ }
205
+ const plan = {
206
+ currentVersion,
207
+ targetVersion,
208
+ migrations: migrationPath.map((m) => ({ from: m.from, to: m.to, description: m.description })),
209
+ changes: allChanges
210
+ };
211
+ if (args.json) {
212
+ process.stdout.write(JSON.stringify(plan, null, 2) + "\n");
213
+ }
214
+ process.stdout.write(`
215
+ Migration complete: ${currentVersion} \u2192 ${targetVersion} (${allChanges.length} changes)
216
+ `);
217
+ }
218
+ export {
219
+ LATEST_VERSION,
220
+ main
221
+ };
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  validateWorld
3
3
  } from "./chunk-7P3S7MAY.js";
4
- import {
5
- evaluateGuard
6
- } from "./chunk-ZAF6JH23.js";
7
- import "./chunk-QLPTHTVB.js";
8
4
  import {
9
5
  DEFAULT_BUNDLED_WORLD,
10
6
  loadBundledWorld,
11
7
  loadWorld
12
- } from "./chunk-BXLTEUS4.js";
8
+ } from "./chunk-I4RTIMLX.js";
9
+ import {
10
+ evaluateGuard
11
+ } from "./chunk-ZAF6JH23.js";
12
+ import "./chunk-QLPTHTVB.js";
13
13
  import "./chunk-QWGCMQQD.js";
14
14
 
15
15
  // src/cli/playground.ts
@@ -1,10 +1,10 @@
1
+ import {
2
+ loadWorld
3
+ } from "./chunk-I4RTIMLX.js";
1
4
  import {
2
5
  evaluateGuard
3
6
  } from "./chunk-ZAF6JH23.js";
4
7
  import "./chunk-QLPTHTVB.js";
5
- import {
6
- loadWorld
7
- } from "./chunk-BXLTEUS4.js";
8
8
  import "./chunk-QWGCMQQD.js";
9
9
 
10
10
  // src/cli/redteam.ts
@@ -2,11 +2,11 @@ import {
2
2
  SessionManager,
3
3
  runInteractiveMode,
4
4
  runPipeMode
5
- } from "./chunk-UTH7OXTM.js";
5
+ } from "./chunk-OTZU76DH.js";
6
6
  import "./chunk-D2UCV5AK.js";
7
+ import "./chunk-I4RTIMLX.js";
7
8
  import "./chunk-ZAF6JH23.js";
8
9
  import "./chunk-QLPTHTVB.js";
9
- import "./chunk-BXLTEUS4.js";
10
10
  import "./chunk-QWGCMQQD.js";
11
11
  export {
12
12
  SessionManager,
@@ -1,4 +1,4 @@
1
- import { a as GuardVerdict, P as PlanDefinition, c as PlanProgress, b as GuardEngineOptions, G as GuardEvent } from './guard-contract-CLBbTGK_.js';
1
+ import { G as GuardVerdict, P as PlanDefinition, c as PlanProgress, b as GuardEngineOptions, a as GuardEvent } from './guard-contract-q6HJAq3Q.js';
2
2
 
3
3
  /**
4
4
  * Shared Adapter Utilities
@@ -1,4 +1,4 @@
1
- import { a as GuardVerdict, P as PlanDefinition, c as PlanProgress, b as GuardEngineOptions, G as GuardEvent } from './guard-contract-CLBbTGK_.cjs';
1
+ import { G as GuardVerdict, P as PlanDefinition, c as PlanProgress, b as GuardEngineOptions, a as GuardEvent } from './guard-contract-ddiIPlOg.cjs';
2
2
 
3
3
  /**
4
4
  * Shared Adapter Utilities
@@ -0,0 +1,11 @@
1
+ import {
2
+ buildManifest,
3
+ canonicalManifest,
4
+ main
5
+ } from "./chunk-H3REGQRI.js";
6
+ import "./chunk-QWGCMQQD.js";
7
+ export {
8
+ buildManifest,
9
+ canonicalManifest,
10
+ main
11
+ };
@@ -5,10 +5,10 @@ import {
5
5
  import {
6
6
  renderSimulateText,
7
7
  simulateWorld
8
- } from "./chunk-7QIAF377.js";
8
+ } from "./chunk-CYDMUJVZ.js";
9
9
  import {
10
10
  loadWorld
11
- } from "./chunk-BXLTEUS4.js";
11
+ } from "./chunk-I4RTIMLX.js";
12
12
  import "./chunk-QWGCMQQD.js";
13
13
 
14
14
  // src/cli/simulate.ts
@@ -1,10 +1,10 @@
1
+ import {
2
+ loadWorld
3
+ } from "./chunk-I4RTIMLX.js";
1
4
  import {
2
5
  evaluateGuard
3
6
  } from "./chunk-ZAF6JH23.js";
4
7
  import "./chunk-QLPTHTVB.js";
5
- import {
6
- loadWorld
7
- } from "./chunk-BXLTEUS4.js";
8
8
  import "./chunk-QWGCMQQD.js";
9
9
 
10
10
  // src/cli/test.ts
package/dist/types.cjs ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);