@neuroverseos/governance 0.3.0 → 0.3.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 (105) hide show
  1. package/README.md +20 -0
  2. package/package.json +16 -3
  3. package/policies/content-moderation-rules.txt +8 -0
  4. package/policies/marketing-rules.txt +8 -0
  5. package/policies/science-research-rules.txt +11 -0
  6. package/policies/social-media-rules.txt +7 -0
  7. package/policies/strict-rules.txt +8 -0
  8. package/policies/trading-rules.txt +8 -0
  9. package/simulate.html +1899 -0
  10. package/dist/adapters/autoresearch.cjs +0 -196
  11. package/dist/adapters/autoresearch.d.cts +0 -103
  12. package/dist/adapters/autoresearch.d.ts +0 -103
  13. package/dist/adapters/autoresearch.js +0 -7
  14. package/dist/adapters/express.cjs +0 -1114
  15. package/dist/adapters/express.d.cts +0 -66
  16. package/dist/adapters/express.d.ts +0 -66
  17. package/dist/adapters/express.js +0 -12
  18. package/dist/adapters/index.cjs +0 -1669
  19. package/dist/adapters/index.d.cts +0 -6
  20. package/dist/adapters/index.d.ts +0 -6
  21. package/dist/adapters/index.js +0 -46
  22. package/dist/adapters/langchain.cjs +0 -1155
  23. package/dist/adapters/langchain.d.cts +0 -89
  24. package/dist/adapters/langchain.d.ts +0 -89
  25. package/dist/adapters/langchain.js +0 -16
  26. package/dist/adapters/openai.cjs +0 -1185
  27. package/dist/adapters/openai.d.cts +0 -99
  28. package/dist/adapters/openai.d.ts +0 -99
  29. package/dist/adapters/openai.js +0 -16
  30. package/dist/adapters/openclaw.cjs +0 -1177
  31. package/dist/adapters/openclaw.d.cts +0 -99
  32. package/dist/adapters/openclaw.d.ts +0 -99
  33. package/dist/adapters/openclaw.js +0 -16
  34. package/dist/bootstrap-GXVDZNF7.js +0 -114
  35. package/dist/build-P42YFKQV.js +0 -339
  36. package/dist/chunk-2NICNKOM.js +0 -100
  37. package/dist/chunk-2PQU3VAN.js +0 -131
  38. package/dist/chunk-4A7LISES.js +0 -324
  39. package/dist/chunk-4JRYGIO7.js +0 -727
  40. package/dist/chunk-4NGDRRQH.js +0 -10
  41. package/dist/chunk-4QXB6PEO.js +0 -232
  42. package/dist/chunk-6CZSKEY5.js +0 -164
  43. package/dist/chunk-7P3S7MAY.js +0 -1090
  44. package/dist/chunk-A5W4GNQO.js +0 -130
  45. package/dist/chunk-AKW5YVCE.js +0 -96
  46. package/dist/chunk-BUWWN2NX.js +0 -192
  47. package/dist/chunk-COT5XS4V.js +0 -109
  48. package/dist/chunk-ER62HNGF.js +0 -139
  49. package/dist/chunk-FYS2CBUW.js +0 -304
  50. package/dist/chunk-GR6DGCZ2.js +0 -340
  51. package/dist/chunk-I3RRAYK2.js +0 -11
  52. package/dist/chunk-JZPQGIKR.js +0 -79
  53. package/dist/chunk-MWDQ4MJB.js +0 -11
  54. package/dist/chunk-NF5POFCI.js +0 -622
  55. package/dist/chunk-OGL7QXZS.js +0 -608
  56. package/dist/chunk-OT6PXH54.js +0 -61
  57. package/dist/chunk-PDOZHZWL.js +0 -225
  58. package/dist/chunk-Q6O7ZLO2.js +0 -62
  59. package/dist/chunk-QPASI2BR.js +0 -187
  60. package/dist/chunk-T5EUJQE5.js +0 -172
  61. package/dist/chunk-XPDMYECO.js +0 -642
  62. package/dist/chunk-YZFATT7X.js +0 -9
  63. package/dist/cli/neuroverse.cjs +0 -11448
  64. package/dist/cli/neuroverse.d.cts +0 -1
  65. package/dist/cli/neuroverse.d.ts +0 -1
  66. package/dist/cli/neuroverse.js +0 -196
  67. package/dist/cli/plan.cjs +0 -1599
  68. package/dist/cli/plan.d.cts +0 -20
  69. package/dist/cli/plan.d.ts +0 -20
  70. package/dist/cli/plan.js +0 -361
  71. package/dist/cli/run.cjs +0 -1746
  72. package/dist/cli/run.d.cts +0 -20
  73. package/dist/cli/run.d.ts +0 -20
  74. package/dist/cli/run.js +0 -143
  75. package/dist/configure-ai-TK67ZWZL.js +0 -132
  76. package/dist/derive-TLIV4OOU.js +0 -152
  77. package/dist/doctor-XPDLEYXN.js +0 -171
  78. package/dist/explain-IDCRWMPX.js +0 -70
  79. package/dist/guard-RV65TT4L.js +0 -96
  80. package/dist/guard-contract-WZx__PmU.d.cts +0 -709
  81. package/dist/guard-contract-WZx__PmU.d.ts +0 -709
  82. package/dist/guard-engine-JLTUARGU.js +0 -10
  83. package/dist/impact-XPECYRLH.js +0 -59
  84. package/dist/improve-GPUBKTEA.js +0 -85
  85. package/dist/index.cjs +0 -6273
  86. package/dist/index.d.cts +0 -1616
  87. package/dist/index.d.ts +0 -1616
  88. package/dist/index.js +0 -379
  89. package/dist/infer-world-7GVZWFX4.js +0 -543
  90. package/dist/init-PKPIYHYE.js +0 -144
  91. package/dist/init-world-VWMQZQC7.js +0 -223
  92. package/dist/mcp-server-FPVSU32Z.js +0 -13
  93. package/dist/model-adapter-BB7G4MFI.js +0 -11
  94. package/dist/playground-E664U4T6.js +0 -550
  95. package/dist/redteam-Z7WREJ44.js +0 -357
  96. package/dist/session-EKTRSR7C.js +0 -14
  97. package/dist/simulate-VDOYQFRO.js +0 -108
  98. package/dist/test-OGXJK4QU.js +0 -217
  99. package/dist/trace-JVF67VR3.js +0 -166
  100. package/dist/validate-LLBWVPGV.js +0 -81
  101. package/dist/validate-engine-UIABSIHD.js +0 -7
  102. package/dist/world-LAXO6DOX.js +0 -378
  103. package/dist/world-loader-HMPTOEA2.js +0 -9
  104. package/dist/worlds/autoresearch.nv-world.md +0 -230
  105. package/dist/worlds/derivation-world.nv-world.md +0 -278
@@ -1,70 +0,0 @@
1
- import {
2
- explainWorld,
3
- renderExplainText
4
- } from "./chunk-BUWWN2NX.js";
5
- import {
6
- loadWorld
7
- } from "./chunk-JZPQGIKR.js";
8
- import "./chunk-YZFATT7X.js";
9
-
10
- // src/cli/explain.ts
11
- function parseArgs(argv) {
12
- let worldPath = "";
13
- let json = false;
14
- for (let i = 0; i < argv.length; i++) {
15
- const arg = argv[i];
16
- if (arg === "--json") {
17
- json = true;
18
- } else if (!arg.startsWith("--") && !worldPath) {
19
- worldPath = arg;
20
- }
21
- }
22
- if (!worldPath) {
23
- throw new Error("Usage: neuroverse explain <world-path-or-id>");
24
- }
25
- return { worldPath, json };
26
- }
27
- async function resolveWorldPath(input) {
28
- const { stat } = await import("fs/promises");
29
- try {
30
- const info = await stat(input);
31
- if (info.isDirectory()) return input;
32
- } catch {
33
- }
34
- const neuroversePath = `.neuroverse/worlds/${input}`;
35
- try {
36
- const info = await stat(neuroversePath);
37
- if (info.isDirectory()) return neuroversePath;
38
- } catch {
39
- }
40
- throw new Error(
41
- `World not found: "${input}"
42
- Tried:
43
- ${input}
44
- ${neuroversePath}
45
-
46
- Build a world first: neuroverse build <input.md>`
47
- );
48
- }
49
- async function main(argv = process.argv.slice(2)) {
50
- try {
51
- const args = parseArgs(argv);
52
- const resolvedPath = await resolveWorldPath(args.worldPath);
53
- const world = await loadWorld(resolvedPath);
54
- const explanation = explainWorld(world);
55
- if (args.json) {
56
- process.stdout.write(JSON.stringify(explanation, null, 2) + "\n");
57
- } else {
58
- process.stderr.write("\n");
59
- process.stderr.write(renderExplainText(explanation));
60
- }
61
- process.exit(0);
62
- } catch (e) {
63
- process.stderr.write(`${e instanceof Error ? e.message : String(e)}
64
- `);
65
- process.exit(1);
66
- }
67
- }
68
- export {
69
- main
70
- };
@@ -1,96 +0,0 @@
1
- import {
2
- GUARD_EXIT_CODES
3
- } from "./chunk-MWDQ4MJB.js";
4
- import {
5
- describeActiveWorld,
6
- resolveWorldPath
7
- } from "./chunk-AKW5YVCE.js";
8
- import {
9
- evaluateGuard
10
- } from "./chunk-4JRYGIO7.js";
11
- import "./chunk-4QXB6PEO.js";
12
- import {
13
- loadWorld
14
- } from "./chunk-JZPQGIKR.js";
15
- import "./chunk-YZFATT7X.js";
16
-
17
- // src/cli/guard.ts
18
- function parseArgs(argv) {
19
- let worldPath = "";
20
- let trace = false;
21
- let level;
22
- for (let i = 0; i < argv.length; i++) {
23
- const arg = argv[i];
24
- if (arg === "--world" && i + 1 < argv.length) {
25
- worldPath = argv[++i];
26
- } else if (arg === "--trace") {
27
- trace = true;
28
- } else if (arg === "--level" && i + 1 < argv.length) {
29
- const val = argv[++i];
30
- if (val === "basic" || val === "standard" || val === "strict") {
31
- level = val;
32
- } else {
33
- throw new Error(`Invalid level: "${val}". Must be basic, standard, or strict.`);
34
- }
35
- }
36
- }
37
- return { worldPath, trace, level };
38
- }
39
- async function readStdin() {
40
- const chunks = [];
41
- for await (const chunk of process.stdin) {
42
- chunks.push(chunk);
43
- }
44
- return Buffer.concat(chunks).toString("utf-8");
45
- }
46
- async function main(argv = process.argv.slice(2)) {
47
- try {
48
- const args = parseArgs(argv);
49
- const worldPath = resolveWorldPath(args.worldPath);
50
- if (!worldPath) {
51
- throw new Error(
52
- "No world specified. Use --world <path>, set NEUROVERSE_WORLD, or run `neuroverse world use <name>`"
53
- );
54
- }
55
- const worldInfo = describeActiveWorld(args.worldPath);
56
- if (worldInfo) {
57
- process.stderr.write(`Using world: ${worldInfo.name}
58
- `);
59
- }
60
- const input = await readStdin();
61
- if (!input.trim()) {
62
- const errorResult = {
63
- error: "No input on stdin. Pipe a JSON GuardEvent.",
64
- usage: `echo '{"intent":"..."}' | neuroverse guard --world <path>`
65
- };
66
- process.stdout.write(JSON.stringify(errorResult, null, 2) + "\n");
67
- process.exit(GUARD_EXIT_CODES.ERROR);
68
- }
69
- let event;
70
- try {
71
- event = JSON.parse(input);
72
- } catch (e) {
73
- const errorResult = { error: "Invalid JSON on stdin", detail: String(e) };
74
- process.stdout.write(JSON.stringify(errorResult, null, 2) + "\n");
75
- process.exit(GUARD_EXIT_CODES.ERROR);
76
- }
77
- if (!event.intent) {
78
- const errorResult = { error: 'GuardEvent must have an "intent" field' };
79
- process.stdout.write(JSON.stringify(errorResult, null, 2) + "\n");
80
- process.exit(GUARD_EXIT_CODES.ERROR);
81
- }
82
- const world = await loadWorld(worldPath);
83
- const options = { trace: args.trace, level: args.level };
84
- const verdict = evaluateGuard(event, world, options);
85
- process.stdout.write(JSON.stringify(verdict, null, 2) + "\n");
86
- const exitCode = GUARD_EXIT_CODES[verdict.status];
87
- process.exit(exitCode);
88
- } catch (e) {
89
- const errorResult = { error: "Guard evaluation failed", detail: String(e) };
90
- process.stderr.write(JSON.stringify(errorResult, null, 2) + "\n");
91
- process.exit(GUARD_EXIT_CODES.ERROR);
92
- }
93
- }
94
- export {
95
- main
96
- };