@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,89 +0,0 @@
1
- import { G as GuardEvent, a as GuardVerdict, b as GuardEngineOptions, P as PlanDefinition, W as WorldDefinition, c as PlanProgress } from '../guard-contract-C9_zKbzd.cjs';
2
- import { G as GovernanceBlockedError$1 } from '../shared-HpAG90PX.cjs';
3
-
4
- /**
5
- * NeuroVerse Adapter — LangChain
6
- *
7
- * Wraps the governance engine as a LangChain tool-calling middleware.
8
- * Intercepts tool invocations and evaluates them against a world definition
9
- * before allowing execution to proceed.
10
- *
11
- * Usage:
12
- * import { createNeuroVerseCallbackHandler } from 'neuroverse-governance/adapters/langchain';
13
- *
14
- * const handler = await createNeuroVerseCallbackHandler('./world/', {
15
- * onBlock: (verdict) => console.log('Blocked:', verdict.reason),
16
- * onPause: (verdict) => requestHumanApproval(verdict),
17
- * });
18
- *
19
- * const agent = new AgentExecutor({ ..., callbacks: [handler] });
20
- */
21
-
22
- interface NeuroVerseHandlerOptions {
23
- /** Include full evaluation trace in verdicts. Default: false. */
24
- trace?: boolean;
25
- /** Enforcement level override. */
26
- level?: 'basic' | 'standard' | 'strict';
27
- /** Called when an action is blocked. */
28
- onBlock?: (verdict: GuardVerdict, event: GuardEvent) => void;
29
- /** Called when an action requires approval. Return true to allow. */
30
- onPause?: (verdict: GuardVerdict, event: GuardEvent) => Promise<boolean> | boolean;
31
- /** Called for every evaluation (logging hook). */
32
- onEvaluate?: (verdict: GuardVerdict, event: GuardEvent) => void;
33
- /** Map a tool call to a GuardEvent. Override for custom tool shapes. */
34
- mapToolCall?: (toolName: string, toolInput: Record<string, unknown>) => GuardEvent;
35
- /** Active plan overlay for task-scoped governance. */
36
- plan?: PlanDefinition;
37
- /** Called when plan progress changes. */
38
- onPlanProgress?: (progress: PlanProgress) => void;
39
- /** Called when all plan steps are completed. */
40
- onPlanComplete?: () => void;
41
- }
42
- declare class GovernanceBlockedError extends GovernanceBlockedError$1 {
43
- readonly event: GuardEvent;
44
- constructor(verdict: GuardVerdict, event: GuardEvent);
45
- }
46
- /**
47
- * A LangChain-compatible callback handler that evaluates tool calls
48
- * against a NeuroVerse world definition.
49
- *
50
- * Implements the BaseCallbackHandler interface shape so it can be
51
- * passed directly into LangChain's callbacks array.
52
- */
53
- declare class NeuroVerseCallbackHandler {
54
- readonly name = "NeuroVerseGovernance";
55
- private world;
56
- private options;
57
- engineOptions: GuardEngineOptions;
58
- private mapToolCall;
59
- activePlan?: PlanDefinition;
60
- constructor(world: WorldDefinition, options?: NeuroVerseHandlerOptions);
61
- /**
62
- * Called before a tool is executed.
63
- * Evaluates the tool call against the governance world.
64
- *
65
- * @throws GovernanceBlockedError if the action is BLOCKED
66
- * @throws GovernanceBlockedError if the action is PAUSED and onPause returns false
67
- */
68
- handleToolStart(tool: {
69
- name: string;
70
- }, input: string): Promise<void>;
71
- }
72
- /**
73
- * Create a NeuroVerse callback handler from a world path.
74
- *
75
- * @param worldPath - Path to world directory or .nv-world.zip
76
- * @param options - Handler configuration
77
- * @returns A callback handler ready to plug into LangChain
78
- */
79
- declare function createNeuroVerseCallbackHandler(worldPath: string, options?: NeuroVerseHandlerOptions): Promise<NeuroVerseCallbackHandler>;
80
- /**
81
- * Create a NeuroVerse callback handler from a pre-loaded world.
82
- *
83
- * @param world - A loaded WorldDefinition
84
- * @param options - Handler configuration
85
- * @returns A callback handler ready to plug into LangChain
86
- */
87
- declare function createNeuroVerseCallbackHandlerFromWorld(world: WorldDefinition, options?: NeuroVerseHandlerOptions): NeuroVerseCallbackHandler;
88
-
89
- export { GovernanceBlockedError, NeuroVerseCallbackHandler, type NeuroVerseHandlerOptions, createNeuroVerseCallbackHandler, createNeuroVerseCallbackHandlerFromWorld };
@@ -1,89 +0,0 @@
1
- import { G as GuardEvent, a as GuardVerdict, b as GuardEngineOptions, P as PlanDefinition, W as WorldDefinition, c as PlanProgress } from '../guard-contract-C9_zKbzd.js';
2
- import { G as GovernanceBlockedError$1 } from '../shared--Q8wPBVN.js';
3
-
4
- /**
5
- * NeuroVerse Adapter — LangChain
6
- *
7
- * Wraps the governance engine as a LangChain tool-calling middleware.
8
- * Intercepts tool invocations and evaluates them against a world definition
9
- * before allowing execution to proceed.
10
- *
11
- * Usage:
12
- * import { createNeuroVerseCallbackHandler } from 'neuroverse-governance/adapters/langchain';
13
- *
14
- * const handler = await createNeuroVerseCallbackHandler('./world/', {
15
- * onBlock: (verdict) => console.log('Blocked:', verdict.reason),
16
- * onPause: (verdict) => requestHumanApproval(verdict),
17
- * });
18
- *
19
- * const agent = new AgentExecutor({ ..., callbacks: [handler] });
20
- */
21
-
22
- interface NeuroVerseHandlerOptions {
23
- /** Include full evaluation trace in verdicts. Default: false. */
24
- trace?: boolean;
25
- /** Enforcement level override. */
26
- level?: 'basic' | 'standard' | 'strict';
27
- /** Called when an action is blocked. */
28
- onBlock?: (verdict: GuardVerdict, event: GuardEvent) => void;
29
- /** Called when an action requires approval. Return true to allow. */
30
- onPause?: (verdict: GuardVerdict, event: GuardEvent) => Promise<boolean> | boolean;
31
- /** Called for every evaluation (logging hook). */
32
- onEvaluate?: (verdict: GuardVerdict, event: GuardEvent) => void;
33
- /** Map a tool call to a GuardEvent. Override for custom tool shapes. */
34
- mapToolCall?: (toolName: string, toolInput: Record<string, unknown>) => GuardEvent;
35
- /** Active plan overlay for task-scoped governance. */
36
- plan?: PlanDefinition;
37
- /** Called when plan progress changes. */
38
- onPlanProgress?: (progress: PlanProgress) => void;
39
- /** Called when all plan steps are completed. */
40
- onPlanComplete?: () => void;
41
- }
42
- declare class GovernanceBlockedError extends GovernanceBlockedError$1 {
43
- readonly event: GuardEvent;
44
- constructor(verdict: GuardVerdict, event: GuardEvent);
45
- }
46
- /**
47
- * A LangChain-compatible callback handler that evaluates tool calls
48
- * against a NeuroVerse world definition.
49
- *
50
- * Implements the BaseCallbackHandler interface shape so it can be
51
- * passed directly into LangChain's callbacks array.
52
- */
53
- declare class NeuroVerseCallbackHandler {
54
- readonly name = "NeuroVerseGovernance";
55
- private world;
56
- private options;
57
- engineOptions: GuardEngineOptions;
58
- private mapToolCall;
59
- activePlan?: PlanDefinition;
60
- constructor(world: WorldDefinition, options?: NeuroVerseHandlerOptions);
61
- /**
62
- * Called before a tool is executed.
63
- * Evaluates the tool call against the governance world.
64
- *
65
- * @throws GovernanceBlockedError if the action is BLOCKED
66
- * @throws GovernanceBlockedError if the action is PAUSED and onPause returns false
67
- */
68
- handleToolStart(tool: {
69
- name: string;
70
- }, input: string): Promise<void>;
71
- }
72
- /**
73
- * Create a NeuroVerse callback handler from a world path.
74
- *
75
- * @param worldPath - Path to world directory or .nv-world.zip
76
- * @param options - Handler configuration
77
- * @returns A callback handler ready to plug into LangChain
78
- */
79
- declare function createNeuroVerseCallbackHandler(worldPath: string, options?: NeuroVerseHandlerOptions): Promise<NeuroVerseCallbackHandler>;
80
- /**
81
- * Create a NeuroVerse callback handler from a pre-loaded world.
82
- *
83
- * @param world - A loaded WorldDefinition
84
- * @param options - Handler configuration
85
- * @returns A callback handler ready to plug into LangChain
86
- */
87
- declare function createNeuroVerseCallbackHandlerFromWorld(world: WorldDefinition, options?: NeuroVerseHandlerOptions): NeuroVerseCallbackHandler;
88
-
89
- export { GovernanceBlockedError, NeuroVerseCallbackHandler, type NeuroVerseHandlerOptions, createNeuroVerseCallbackHandler, createNeuroVerseCallbackHandlerFromWorld };
@@ -1,17 +0,0 @@
1
- import {
2
- GovernanceBlockedError,
3
- NeuroVerseCallbackHandler,
4
- createNeuroVerseCallbackHandler,
5
- createNeuroVerseCallbackHandlerFromWorld
6
- } from "../chunk-EVDJUSZ2.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
- NeuroVerseCallbackHandler,
15
- createNeuroVerseCallbackHandler,
16
- createNeuroVerseCallbackHandlerFromWorld
17
- };