@neuroverseos/governance 0.1.5 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +279 -423
  2. package/dist/adapters/express.cjs +242 -2
  3. package/dist/adapters/express.d.cts +1 -1
  4. package/dist/adapters/express.d.ts +1 -1
  5. package/dist/adapters/express.js +5 -3
  6. package/dist/adapters/index.cjs +301 -5
  7. package/dist/adapters/index.d.cts +1 -1
  8. package/dist/adapters/index.d.ts +1 -1
  9. package/dist/adapters/index.js +8 -6
  10. package/dist/adapters/langchain.cjs +267 -3
  11. package/dist/adapters/langchain.d.cts +8 -1
  12. package/dist/adapters/langchain.d.ts +8 -1
  13. package/dist/adapters/langchain.js +5 -3
  14. package/dist/adapters/openai.cjs +267 -3
  15. package/dist/adapters/openai.d.cts +8 -1
  16. package/dist/adapters/openai.d.ts +8 -1
  17. package/dist/adapters/openai.js +5 -3
  18. package/dist/adapters/openclaw.cjs +267 -3
  19. package/dist/adapters/openclaw.d.cts +8 -1
  20. package/dist/adapters/openclaw.d.ts +8 -1
  21. package/dist/adapters/openclaw.js +5 -3
  22. package/dist/{bootstrap-H4HHKQ5G.js → bootstrap-GXVDZNF7.js} +2 -1
  23. package/dist/{build-73KAVHEY.js → build-P42YFKQV.js} +34 -3
  24. package/dist/{chunk-FYPYZFV5.js → chunk-2JQJ5U5X.js} +1 -1
  25. package/dist/chunk-37JG24WH.js +161 -0
  26. package/dist/chunk-5EDDNJU6.js +321 -0
  27. package/dist/{chunk-O5OMJMIE.js → chunk-7P3S7MAY.js} +502 -2
  28. package/dist/chunk-A5W4GNQO.js +130 -0
  29. package/dist/{chunk-ITJ3LCPG.js → chunk-ADV7Q2LJ.js} +1 -1
  30. package/dist/chunk-AKW5YVCE.js +96 -0
  31. package/dist/{chunk-EIUHJXBB.js → chunk-GR6DGCZ2.js} +1 -1
  32. package/dist/{chunk-EQXFOKH2.js → chunk-IVPKFJX3.js} +24 -3
  33. package/dist/{chunk-D7BGWV2J.js → chunk-NF5POFCI.js} +5 -3
  34. package/dist/chunk-OT6PXH54.js +61 -0
  35. package/dist/chunk-P74Y66ZV.js +205 -0
  36. package/dist/chunk-PAX2P6ZP.js +601 -0
  37. package/dist/{chunk-B4NF3OLW.js → chunk-PQBJBVSW.js} +56 -2
  38. package/dist/{chunk-T4X42QXC.js → chunk-Q6O7ZLO2.js} +0 -59
  39. package/dist/{chunk-FZQCRGUU.js → chunk-TINSRYXQ.js} +24 -3
  40. package/dist/{chunk-CROPZ75A.js → chunk-UPJNTSVM.js} +24 -3
  41. package/dist/chunk-YZFATT7X.js +9 -0
  42. package/dist/{chunk-Z2S2HIV5.js → chunk-ZL4AHY4X.js} +2 -2
  43. package/dist/cli/neuroverse.cjs +5287 -740
  44. package/dist/cli/neuroverse.js +69 -13
  45. package/dist/cli/plan.cjs +1554 -0
  46. package/dist/cli/plan.d.cts +20 -0
  47. package/dist/cli/plan.d.ts +20 -0
  48. package/dist/cli/plan.js +346 -0
  49. package/dist/cli/run.cjs +1716 -0
  50. package/dist/cli/run.d.cts +20 -0
  51. package/dist/cli/run.d.ts +20 -0
  52. package/dist/cli/run.js +143 -0
  53. package/dist/{configure-ai-46JVG56I.js → configure-ai-TK67ZWZL.js} +5 -2
  54. package/dist/{derive-6NAEWLM5.js → derive-TLIV4OOU.js} +6 -4
  55. package/dist/doctor-V72UM2TC.js +170 -0
  56. package/dist/{explain-3B3VB6TL.js → explain-IDCRWMPX.js} +2 -1
  57. package/dist/{guard-67Y66P3I.js → guard-WA3FCCIO.js} +20 -6
  58. package/dist/{guard-contract-D_RQz9kt.d.ts → guard-contract-D-2LQInm.d.cts} +144 -2
  59. package/dist/{guard-contract-D_RQz9kt.d.cts → guard-contract-D-2LQInm.d.ts} +144 -2
  60. package/dist/guard-engine-D7X4CVAE.js +10 -0
  61. package/dist/{impact-CHERK3O6.js → impact-BWULZ5RP.js} +5 -3
  62. package/dist/{improve-YG6I6ERG.js → improve-GPUBKTEA.js} +4 -3
  63. package/dist/index.cjs +2095 -89
  64. package/dist/index.d.cts +466 -12
  65. package/dist/index.d.ts +466 -12
  66. package/dist/index.js +70 -20
  67. package/dist/{init-Z66T6TDI.js → init-PKPIYHYE.js} +2 -0
  68. package/dist/mcp-server-YUOQP4M5.js +13 -0
  69. package/dist/model-adapter-BB7G4MFI.js +11 -0
  70. package/dist/playground-CBXMAW2B.js +550 -0
  71. package/dist/redteam-SSNABQ7W.js +357 -0
  72. package/dist/session-MWRBTCYX.js +14 -0
  73. package/dist/{simulate-ETHHINZ4.js → simulate-VDOYQFRO.js} +2 -1
  74. package/dist/test-3GZSG5FR.js +217 -0
  75. package/dist/{trace-3YODSSIP.js → trace-TM4Z7G73.js} +4 -2
  76. package/dist/{validate-UVE6GKQU.js → validate-LLBWVPGV.js} +15 -6
  77. package/dist/validate-engine-UIABSIHD.js +7 -0
  78. package/dist/{world-WLNHL5XC.js → world-LAXO6DOX.js} +87 -7
  79. package/dist/world-loader-HMPTOEA2.js +9 -0
  80. package/package.json +19 -5
  81. package/dist/validate-engine-657D75OG.js +0 -6
  82. /package/dist/{chunk-M3TZFGHO.js → chunk-JZPQGIKR.js} +0 -0
@@ -1,20 +1,34 @@
1
1
  import {
2
- loadWorld
3
- } from "./chunk-M3TZFGHO.js";
2
+ describeActiveWorld,
3
+ getActiveWorldName,
4
+ listWorlds,
5
+ resolveWorldPath,
6
+ setActiveWorld
7
+ } from "./chunk-AKW5YVCE.js";
4
8
  import {
5
9
  validateWorld
6
- } from "./chunk-O5OMJMIE.js";
10
+ } from "./chunk-7P3S7MAY.js";
11
+ import {
12
+ loadWorld
13
+ } from "./chunk-JZPQGIKR.js";
14
+ import "./chunk-YZFATT7X.js";
7
15
 
8
16
  // src/cli/world.ts
9
17
  var USAGE = `
10
18
  neuroverse world \u2014 World management
11
19
 
12
20
  Usage:
13
- neuroverse world status <path> Show world identity and health
21
+ neuroverse world list List available worlds
22
+ neuroverse world use <name> Set the active world
23
+ neuroverse world current Show which world is active and why
24
+ neuroverse world status [path|name] Show world identity and health
14
25
  neuroverse world diff <path1> <path2> Compare two world versions
15
26
  neuroverse world snapshot <path> Save a timestamped snapshot
16
27
  neuroverse world rollback <path> Restore the previous snapshot
17
28
 
29
+ Environment:
30
+ NEUROVERSE_WORLD=<name> Override active world (for CI/agents)
31
+
18
32
  Options:
19
33
  --json Output as JSON
20
34
  `.trim();
@@ -249,6 +263,55 @@ async function worldRollback(worldPath) {
249
263
  process.stdout.write(`Backup saved: ${backupDir}
250
264
  `);
251
265
  }
266
+ function worldList(json) {
267
+ const worlds = listWorlds();
268
+ if (json) {
269
+ process.stdout.write(JSON.stringify({ worlds, activeWorld: getActiveWorldName() }, null, 2) + "\n");
270
+ return;
271
+ }
272
+ if (worlds.length === 0) {
273
+ process.stdout.write("No worlds found.\n");
274
+ process.stdout.write("Run `neuroverse build <input.md>` to create one.\n");
275
+ return;
276
+ }
277
+ const lines = [];
278
+ lines.push("AVAILABLE WORLDS");
279
+ lines.push("\u2500".repeat(40));
280
+ for (const w of worlds) {
281
+ const marker = w.active ? "\u2192" : " ";
282
+ const activeLabel = w.active ? " (active)" : "";
283
+ lines.push(` ${marker} ${w.name}${activeLabel}`);
284
+ }
285
+ const envWorld = process.env.NEUROVERSE_WORLD;
286
+ if (envWorld) {
287
+ lines.push("");
288
+ lines.push(` env: NEUROVERSE_WORLD=${envWorld}`);
289
+ }
290
+ lines.push("");
291
+ lines.push("Switch: neuroverse world use <name>");
292
+ process.stdout.write(lines.join("\n") + "\n");
293
+ }
294
+ function worldUse(name) {
295
+ setActiveWorld(name);
296
+ process.stdout.write(`Active world: ${name}
297
+ `);
298
+ }
299
+ function worldCurrent(json) {
300
+ const info = describeActiveWorld();
301
+ if (json) {
302
+ process.stdout.write(JSON.stringify(info ?? { name: null, source: null }, null, 2) + "\n");
303
+ return;
304
+ }
305
+ if (!info) {
306
+ process.stdout.write("No active world.\n");
307
+ process.stdout.write("Set one with: neuroverse world use <name>\n");
308
+ return;
309
+ }
310
+ process.stdout.write(`Active world: ${info.name}
311
+ `);
312
+ process.stdout.write(`Source: ${info.source}
313
+ `);
314
+ }
252
315
  async function main(argv = process.argv.slice(2)) {
253
316
  const { subcommand, paths, flags } = parseArgs(argv);
254
317
  if (flags.help || !subcommand) {
@@ -256,12 +319,29 @@ async function main(argv = process.argv.slice(2)) {
256
319
  process.exit(0);
257
320
  }
258
321
  switch (subcommand) {
259
- case "status": {
322
+ case "list":
323
+ case "ls": {
324
+ return worldList(!!flags.json);
325
+ }
326
+ case "use": {
260
327
  if (!paths[0]) {
261
- process.stderr.write("Usage: neuroverse world status <path>\n");
328
+ process.stderr.write("Usage: neuroverse world use <name>\n");
329
+ process.exit(1);
330
+ }
331
+ return worldUse(paths[0]);
332
+ }
333
+ case "current": {
334
+ return worldCurrent(!!flags.json);
335
+ }
336
+ case "status": {
337
+ const ref = paths[0];
338
+ const resolved = ref ? resolveWorldPath(ref) : resolveWorldPath();
339
+ if (!resolved) {
340
+ process.stderr.write("Usage: neuroverse world status <path|name>\n");
341
+ process.stderr.write("Or set an active world: neuroverse world use <name>\n");
262
342
  process.exit(1);
263
343
  }
264
- return worldStatus(paths[0], !!flags.json);
344
+ return worldStatus(resolved, !!flags.json);
265
345
  }
266
346
  case "diff": {
267
347
  if (!paths[0] || !paths[1]) {
@@ -0,0 +1,9 @@
1
+ import {
2
+ loadWorld,
3
+ loadWorldFromDirectory
4
+ } from "./chunk-JZPQGIKR.js";
5
+ import "./chunk-YZFATT7X.js";
6
+ export {
7
+ loadWorld,
8
+ loadWorldFromDirectory
9
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@neuroverseos/governance",
3
- "version": "0.1.5",
4
- "description": "Deterministic governance engine for AI agents — evaluate events against world definitions with full audit trace",
3
+ "version": "0.2.1",
4
+ "description": "Deterministic governance engine for AI agents — enforce worlds (permanent rules) and plans (mission constraints) with full audit trace",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./dist/index.cjs",
@@ -37,6 +37,11 @@
37
37
  "types": "./dist/adapters/express.d.ts",
38
38
  "import": "./dist/adapters/express.js",
39
39
  "require": "./dist/adapters/express.cjs"
40
+ },
41
+ "./plan": {
42
+ "types": "./dist/index.d.ts",
43
+ "import": "./dist/index.js",
44
+ "require": "./dist/index.cjs"
40
45
  }
41
46
  },
42
47
  "bin": {
@@ -49,7 +54,7 @@
49
54
  "README.md"
50
55
  ],
51
56
  "scripts": {
52
- "build": "tsup src/index.ts src/cli/neuroverse.ts src/adapters/index.ts src/adapters/langchain.ts src/adapters/openai.ts src/adapters/openclaw.ts src/adapters/express.ts --format esm,cjs --dts --clean && cp src/worlds/derivation-world.nv-world.md dist/worlds/derivation-world.nv-world.md",
57
+ "build": "tsup src/index.ts src/cli/neuroverse.ts src/cli/plan.ts src/cli/run.ts src/adapters/index.ts src/adapters/langchain.ts src/adapters/openai.ts src/adapters/openclaw.ts src/adapters/express.ts --format esm,cjs --dts --clean && cp src/worlds/derivation-world.nv-world.md dist/worlds/derivation-world.nv-world.md",
53
58
  "prebuild": "mkdir -p dist/worlds",
54
59
  "dev": "tsup src/index.ts src/cli/neuroverse.ts --format esm,cjs --dts --watch",
55
60
  "test": "vitest run",
@@ -71,11 +76,20 @@
71
76
  "ai-agents",
72
77
  "compliance",
73
78
  "audit",
74
- "world-engine"
79
+ "world-engine",
80
+ "plan-enforcement",
81
+ "agent-governance",
82
+ "ai-safety",
83
+ "openclaw-plugin",
84
+ "langchain-plugin",
85
+ "drift-prevention",
86
+ "mcp",
87
+ "mcp-server",
88
+ "model-context-protocol"
75
89
  ],
76
90
  "repository": {
77
91
  "type": "git",
78
- "url": "https://github.com/neuroverseos/neuroverseos-governance.git"
92
+ "url": "https://github.com/NeuroverseOS/Neuroverseos-governance.git"
79
93
  },
80
94
  "engines": {
81
95
  "node": ">=18"
@@ -1,6 +0,0 @@
1
- import {
2
- validateWorld
3
- } from "./chunk-O5OMJMIE.js";
4
- export {
5
- validateWorld
6
- };
File without changes