@neuroverseos/governance 0.2.3 → 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 (118) hide show
  1. package/package.json +4 -2
  2. package/policies/content-moderation-rules.txt +8 -0
  3. package/policies/marketing-rules.txt +8 -0
  4. package/policies/science-research-rules.txt +11 -0
  5. package/policies/social-media-rules.txt +7 -0
  6. package/policies/strict-rules.txt +8 -0
  7. package/policies/trading-rules.txt +8 -0
  8. package/simulate.html +1899 -0
  9. package/dist/adapters/autoresearch.cjs +0 -196
  10. package/dist/adapters/autoresearch.d.cts +0 -103
  11. package/dist/adapters/autoresearch.d.ts +0 -103
  12. package/dist/adapters/autoresearch.js +0 -7
  13. package/dist/adapters/deep-agents.cjs +0 -1472
  14. package/dist/adapters/deep-agents.d.cts +0 -181
  15. package/dist/adapters/deep-agents.d.ts +0 -181
  16. package/dist/adapters/deep-agents.js +0 -17
  17. package/dist/adapters/express.cjs +0 -1196
  18. package/dist/adapters/express.d.cts +0 -66
  19. package/dist/adapters/express.d.ts +0 -66
  20. package/dist/adapters/express.js +0 -12
  21. package/dist/adapters/index.cjs +0 -2038
  22. package/dist/adapters/index.d.cts +0 -8
  23. package/dist/adapters/index.d.ts +0 -8
  24. package/dist/adapters/index.js +0 -68
  25. package/dist/adapters/langchain.cjs +0 -1259
  26. package/dist/adapters/langchain.d.cts +0 -89
  27. package/dist/adapters/langchain.d.ts +0 -89
  28. package/dist/adapters/langchain.js +0 -17
  29. package/dist/adapters/openai.cjs +0 -1289
  30. package/dist/adapters/openai.d.cts +0 -99
  31. package/dist/adapters/openai.d.ts +0 -99
  32. package/dist/adapters/openai.js +0 -17
  33. package/dist/adapters/openclaw.cjs +0 -1281
  34. package/dist/adapters/openclaw.d.cts +0 -99
  35. package/dist/adapters/openclaw.d.ts +0 -99
  36. package/dist/adapters/openclaw.js +0 -17
  37. package/dist/bootstrap-GXVDZNF7.js +0 -114
  38. package/dist/build-X5MZY4IA.js +0 -339
  39. package/dist/chunk-4L6OPKMQ.js +0 -100
  40. package/dist/chunk-4NGDRRQH.js +0 -10
  41. package/dist/chunk-5U2MQO5P.js +0 -57
  42. package/dist/chunk-6BB55YJI.js +0 -113
  43. package/dist/chunk-6CZSKEY5.js +0 -164
  44. package/dist/chunk-7P3S7MAY.js +0 -1090
  45. package/dist/chunk-A5W4GNQO.js +0 -130
  46. package/dist/chunk-AF2VX4AL.js +0 -363
  47. package/dist/chunk-AKW5YVCE.js +0 -96
  48. package/dist/chunk-BMOXICAB.js +0 -340
  49. package/dist/chunk-BQZMOEML.js +0 -43
  50. package/dist/chunk-D2UCV5AK.js +0 -326
  51. package/dist/chunk-EVDJUSZ2.js +0 -91
  52. package/dist/chunk-FYS2CBUW.js +0 -304
  53. package/dist/chunk-I3RRAYK2.js +0 -11
  54. package/dist/chunk-IZSO75NZ.js +0 -792
  55. package/dist/chunk-JCKSW2PZ.js +0 -304
  56. package/dist/chunk-JZPQGIKR.js +0 -79
  57. package/dist/chunk-KTFTTLTP.js +0 -246
  58. package/dist/chunk-MH7BT4VH.js +0 -15
  59. package/dist/chunk-ORJ3NOE6.js +0 -622
  60. package/dist/chunk-OT6PXH54.js +0 -61
  61. package/dist/chunk-Q6O7ZLO2.js +0 -62
  62. package/dist/chunk-QLPTHTVB.js +0 -253
  63. package/dist/chunk-REXY4LUL.js +0 -226
  64. package/dist/chunk-T5EUJQE5.js +0 -172
  65. package/dist/chunk-TTBKTF3P.js +0 -608
  66. package/dist/chunk-XPDMYECO.js +0 -642
  67. package/dist/chunk-YZFATT7X.js +0 -9
  68. package/dist/chunk-ZIVQNSZU.js +0 -119
  69. package/dist/chunk-ZJTDUCC2.js +0 -194
  70. package/dist/cli/neuroverse.cjs +0 -12564
  71. package/dist/cli/neuroverse.d.cts +0 -1
  72. package/dist/cli/neuroverse.d.ts +0 -1
  73. package/dist/cli/neuroverse.js +0 -208
  74. package/dist/cli/plan.cjs +0 -1686
  75. package/dist/cli/plan.d.cts +0 -20
  76. package/dist/cli/plan.d.ts +0 -20
  77. package/dist/cli/plan.js +0 -353
  78. package/dist/cli/run.cjs +0 -1945
  79. package/dist/cli/run.d.cts +0 -20
  80. package/dist/cli/run.d.ts +0 -20
  81. package/dist/cli/run.js +0 -143
  82. package/dist/configure-ai-TK67ZWZL.js +0 -132
  83. package/dist/decision-flow-LETV5NWY.js +0 -61
  84. package/dist/derive-7365SUFU.js +0 -152
  85. package/dist/doctor-QYISMKEL.js +0 -173
  86. package/dist/equity-penalties-63FGB3I2.js +0 -244
  87. package/dist/explain-A2EWI2OL.js +0 -51
  88. package/dist/guard-3BWL3IGH.js +0 -92
  89. package/dist/guard-contract-C9_zKbzd.d.cts +0 -821
  90. package/dist/guard-contract-C9_zKbzd.d.ts +0 -821
  91. package/dist/guard-engine-QFMIBWJY.js +0 -10
  92. package/dist/impact-UB6DXKSX.js +0 -59
  93. package/dist/improve-XZA57GER.js +0 -66
  94. package/dist/index.cjs +0 -6821
  95. package/dist/index.d.cts +0 -1829
  96. package/dist/index.d.ts +0 -1829
  97. package/dist/index.js +0 -430
  98. package/dist/infer-world-7GVZWFX4.js +0 -543
  99. package/dist/init-PKPIYHYE.js +0 -144
  100. package/dist/init-world-VWMQZQC7.js +0 -223
  101. package/dist/mcp-server-XWQZXNW7.js +0 -13
  102. package/dist/model-adapter-BB7G4MFI.js +0 -11
  103. package/dist/playground-ADWZORNV.js +0 -550
  104. package/dist/redteam-JRQ7FD2F.js +0 -357
  105. package/dist/session-MMYX5YCF.js +0 -15
  106. package/dist/shared--Q8wPBVN.d.ts +0 -60
  107. package/dist/shared-HpAG90PX.d.cts +0 -60
  108. package/dist/shared-U2QFV7JH.js +0 -16
  109. package/dist/simulate-GMIFFXYV.js +0 -83
  110. package/dist/test-JBBZ65X4.js +0 -217
  111. package/dist/trace-3MYWIDEF.js +0 -166
  112. package/dist/validate-LLBWVPGV.js +0 -81
  113. package/dist/validate-engine-UIABSIHD.js +0 -7
  114. package/dist/world-BFJCIQSH.js +0 -378
  115. package/dist/world-loader-HMPTOEA2.js +0 -9
  116. package/dist/worlds/autoresearch.nv-world.md +0 -230
  117. package/dist/worlds/coding-agent.nv-world.md +0 -211
  118. package/dist/worlds/derivation-world.nv-world.md +0 -278
@@ -1,99 +0,0 @@
1
- import { a as GuardVerdict, G as GuardEvent, P as PlanDefinition, c as PlanProgress, b as GuardEngineOptions, W as WorldDefinition } from '../guard-contract-C9_zKbzd.cjs';
2
- import { G as GovernanceBlockedError$1 } from '../shared-HpAG90PX.cjs';
3
-
4
- /**
5
- * NeuroVerse Adapter — OpenAI
6
- *
7
- * Wraps the governance engine as middleware for OpenAI function calling.
8
- * Evaluates function/tool calls against a world definition before execution.
9
- *
10
- * Usage:
11
- * import { createGovernedToolExecutor } from 'neuroverse-governance/adapters/openai';
12
- *
13
- * const executor = await createGovernedToolExecutor('./world/');
14
- *
15
- * // In your tool execution loop:
16
- * for (const toolCall of message.tool_calls) {
17
- * const result = await executor.execute(toolCall, myToolRunner);
18
- * }
19
- */
20
-
21
- /** Shape of an OpenAI tool call (from chat completions response). */
22
- interface OpenAIToolCall {
23
- id: string;
24
- type: 'function';
25
- function: {
26
- name: string;
27
- arguments: string;
28
- };
29
- }
30
- /** Result of a governed tool execution. */
31
- interface GovernedToolResult {
32
- tool_call_id: string;
33
- role: 'tool';
34
- content: string;
35
- /** The governance verdict for this tool call. */
36
- _verdict: GuardVerdict;
37
- }
38
- interface GovernedExecutorOptions {
39
- /** Include full evaluation trace in verdicts. Default: false. */
40
- trace?: boolean;
41
- /** Enforcement level override. */
42
- level?: 'basic' | 'standard' | 'strict';
43
- /** Called for every evaluation (logging hook). */
44
- onEvaluate?: (verdict: GuardVerdict, event: GuardEvent) => void;
45
- /** Custom mapping from function call to GuardEvent. */
46
- mapFunctionCall?: (name: string, args: Record<string, unknown>) => GuardEvent;
47
- /** Message returned to the model when a tool call is blocked. */
48
- blockMessage?: (verdict: GuardVerdict) => string;
49
- /** Active plan overlay for task-scoped governance. */
50
- plan?: PlanDefinition;
51
- /** Called when plan progress changes. */
52
- onPlanProgress?: (progress: PlanProgress) => void;
53
- /** Called when all plan steps are completed. */
54
- onPlanComplete?: () => void;
55
- }
56
- declare class GovernanceBlockedError extends GovernanceBlockedError$1 {
57
- readonly toolCallId: string;
58
- constructor(verdict: GuardVerdict, toolCallId: string);
59
- }
60
- /**
61
- * Wraps tool execution with NeuroVerse governance.
62
- * Evaluates each function call before allowing the tool runner to execute.
63
- */
64
- declare class GovernedToolExecutor {
65
- private world;
66
- private options;
67
- engineOptions: GuardEngineOptions;
68
- private mapFn;
69
- private blockMsg;
70
- activePlan?: PlanDefinition;
71
- constructor(world: WorldDefinition, options?: GovernedExecutorOptions);
72
- /**
73
- * Evaluate a single tool call against governance rules.
74
- * Returns the verdict without executing the tool.
75
- */
76
- evaluate(toolCall: OpenAIToolCall): GuardVerdict;
77
- /**
78
- * Execute a tool call with governance enforcement.
79
- *
80
- * If ALLOW: runs the tool and returns the result.
81
- * If BLOCK: returns a blocked message (no execution).
82
- * If PAUSE: throws — caller must handle approval flow.
83
- *
84
- * @param toolCall - The OpenAI tool call to evaluate
85
- * @param runner - The actual tool execution function
86
- * @returns A tool result message ready for the OpenAI API
87
- */
88
- execute(toolCall: OpenAIToolCall, runner: (name: string, args: Record<string, unknown>) => Promise<string>): Promise<GovernedToolResult>;
89
- }
90
- /**
91
- * Create a governed tool executor from a world path.
92
- */
93
- declare function createGovernedToolExecutor(worldPath: string, options?: GovernedExecutorOptions): Promise<GovernedToolExecutor>;
94
- /**
95
- * Create a governed tool executor from a pre-loaded world.
96
- */
97
- declare function createGovernedToolExecutorFromWorld(world: WorldDefinition, options?: GovernedExecutorOptions): GovernedToolExecutor;
98
-
99
- export { GovernanceBlockedError, type GovernedExecutorOptions, GovernedToolExecutor, type GovernedToolResult, type OpenAIToolCall, createGovernedToolExecutor, createGovernedToolExecutorFromWorld };
@@ -1,99 +0,0 @@
1
- import { a as GuardVerdict, G as GuardEvent, P as PlanDefinition, c as PlanProgress, b as GuardEngineOptions, W as WorldDefinition } from '../guard-contract-C9_zKbzd.js';
2
- import { G as GovernanceBlockedError$1 } from '../shared--Q8wPBVN.js';
3
-
4
- /**
5
- * NeuroVerse Adapter — OpenAI
6
- *
7
- * Wraps the governance engine as middleware for OpenAI function calling.
8
- * Evaluates function/tool calls against a world definition before execution.
9
- *
10
- * Usage:
11
- * import { createGovernedToolExecutor } from 'neuroverse-governance/adapters/openai';
12
- *
13
- * const executor = await createGovernedToolExecutor('./world/');
14
- *
15
- * // In your tool execution loop:
16
- * for (const toolCall of message.tool_calls) {
17
- * const result = await executor.execute(toolCall, myToolRunner);
18
- * }
19
- */
20
-
21
- /** Shape of an OpenAI tool call (from chat completions response). */
22
- interface OpenAIToolCall {
23
- id: string;
24
- type: 'function';
25
- function: {
26
- name: string;
27
- arguments: string;
28
- };
29
- }
30
- /** Result of a governed tool execution. */
31
- interface GovernedToolResult {
32
- tool_call_id: string;
33
- role: 'tool';
34
- content: string;
35
- /** The governance verdict for this tool call. */
36
- _verdict: GuardVerdict;
37
- }
38
- interface GovernedExecutorOptions {
39
- /** Include full evaluation trace in verdicts. Default: false. */
40
- trace?: boolean;
41
- /** Enforcement level override. */
42
- level?: 'basic' | 'standard' | 'strict';
43
- /** Called for every evaluation (logging hook). */
44
- onEvaluate?: (verdict: GuardVerdict, event: GuardEvent) => void;
45
- /** Custom mapping from function call to GuardEvent. */
46
- mapFunctionCall?: (name: string, args: Record<string, unknown>) => GuardEvent;
47
- /** Message returned to the model when a tool call is blocked. */
48
- blockMessage?: (verdict: GuardVerdict) => string;
49
- /** Active plan overlay for task-scoped governance. */
50
- plan?: PlanDefinition;
51
- /** Called when plan progress changes. */
52
- onPlanProgress?: (progress: PlanProgress) => void;
53
- /** Called when all plan steps are completed. */
54
- onPlanComplete?: () => void;
55
- }
56
- declare class GovernanceBlockedError extends GovernanceBlockedError$1 {
57
- readonly toolCallId: string;
58
- constructor(verdict: GuardVerdict, toolCallId: string);
59
- }
60
- /**
61
- * Wraps tool execution with NeuroVerse governance.
62
- * Evaluates each function call before allowing the tool runner to execute.
63
- */
64
- declare class GovernedToolExecutor {
65
- private world;
66
- private options;
67
- engineOptions: GuardEngineOptions;
68
- private mapFn;
69
- private blockMsg;
70
- activePlan?: PlanDefinition;
71
- constructor(world: WorldDefinition, options?: GovernedExecutorOptions);
72
- /**
73
- * Evaluate a single tool call against governance rules.
74
- * Returns the verdict without executing the tool.
75
- */
76
- evaluate(toolCall: OpenAIToolCall): GuardVerdict;
77
- /**
78
- * Execute a tool call with governance enforcement.
79
- *
80
- * If ALLOW: runs the tool and returns the result.
81
- * If BLOCK: returns a blocked message (no execution).
82
- * If PAUSE: throws — caller must handle approval flow.
83
- *
84
- * @param toolCall - The OpenAI tool call to evaluate
85
- * @param runner - The actual tool execution function
86
- * @returns A tool result message ready for the OpenAI API
87
- */
88
- execute(toolCall: OpenAIToolCall, runner: (name: string, args: Record<string, unknown>) => Promise<string>): Promise<GovernedToolResult>;
89
- }
90
- /**
91
- * Create a governed tool executor from a world path.
92
- */
93
- declare function createGovernedToolExecutor(worldPath: string, options?: GovernedExecutorOptions): Promise<GovernedToolExecutor>;
94
- /**
95
- * Create a governed tool executor from a pre-loaded world.
96
- */
97
- declare function createGovernedToolExecutorFromWorld(world: WorldDefinition, options?: GovernedExecutorOptions): GovernedToolExecutor;
98
-
99
- export { GovernanceBlockedError, type GovernedExecutorOptions, GovernedToolExecutor, type GovernedToolResult, type OpenAIToolCall, createGovernedToolExecutor, createGovernedToolExecutorFromWorld };
@@ -1,17 +0,0 @@
1
- import {
2
- GovernanceBlockedError,
3
- GovernedToolExecutor,
4
- createGovernedToolExecutor,
5
- createGovernedToolExecutorFromWorld
6
- } from "../chunk-ZIVQNSZU.js";
7
- import "../chunk-5U2MQO5P.js";
8
- import "../chunk-IZSO75NZ.js";
9
- import "../chunk-QLPTHTVB.js";
10
- import "../chunk-JZPQGIKR.js";
11
- import "../chunk-YZFATT7X.js";
12
- export {
13
- GovernanceBlockedError,
14
- GovernedToolExecutor,
15
- createGovernedToolExecutor,
16
- createGovernedToolExecutorFromWorld
17
- };