@vishal_20/basetree 1.0.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 (149) hide show
  1. package/.env.example +10 -0
  2. package/README.md +369 -0
  3. package/dist/agents/alignmentAgent.js +68 -0
  4. package/dist/agents/governanceOrchestrator.js +152 -0
  5. package/dist/agents/planet/climateAgent.js +39 -0
  6. package/dist/agents/planet/diplomacyAgent.js +52 -0
  7. package/dist/agents/planet/discoveryAgent.js +41 -0
  8. package/dist/agents/planet/economicAgent.js +64 -0
  9. package/dist/agents/planet/educationAgent.js +41 -0
  10. package/dist/agents/planet/governanceCouncilAgent.js +76 -0
  11. package/dist/agents/planet/healthcareAgent.js +42 -0
  12. package/dist/agents/planet/infrastructureAgent.js +49 -0
  13. package/dist/agents/planet/planetAgent.js +5 -0
  14. package/dist/agents/planet/riskStabilityAgent.js +84 -0
  15. package/dist/agents/planet/urbanSystemsAgent.js +42 -0
  16. package/dist/agents/policyAgent.js +31 -0
  17. package/dist/agents/promptGenomeAgent.js +120 -0
  18. package/dist/agents/reasoningOptimizerAgent.js +72 -0
  19. package/dist/agents/regressionAgent.js +162 -0
  20. package/dist/agents/reinforcementLearnerAgent.js +108 -0
  21. package/dist/agents/riskEvaluationAgent.js +131 -0
  22. package/dist/agents/rollbackAgent.js +53 -0
  23. package/dist/agents/stabilityAgent.js +90 -0
  24. package/dist/agents/strategyMutationAgent.js +74 -0
  25. package/dist/agents/systemIntrospectionAgent.js +274 -0
  26. package/dist/agents/upgradeExecutorAgent.js +146 -0
  27. package/dist/agents/upgradePlannerAgent.js +80 -0
  28. package/dist/agents/venture/businessModelAgent.js +81 -0
  29. package/dist/agents/venture/growthAgent.js +82 -0
  30. package/dist/agents/venture/ideationAgent.js +89 -0
  31. package/dist/agents/venture/investorAgent.js +90 -0
  32. package/dist/agents/venture/legalAgent.js +112 -0
  33. package/dist/agents/venture/marketResearchAgent.js +80 -0
  34. package/dist/agents/venture/productAgent.js +96 -0
  35. package/dist/agents/venture/revenueAgent.js +63 -0
  36. package/dist/agents/venture/validationAgent.js +189 -0
  37. package/dist/bootstrap.js +200 -0
  38. package/dist/cli.js +453 -0
  39. package/dist/cognitiveGraph/cognitiveGraphEngine.js +180 -0
  40. package/dist/cognitiveGraph/graphStore.js +81 -0
  41. package/dist/cognitiveGraph/reasoningStreamBus.js +190 -0
  42. package/dist/config/config.js +76 -0
  43. package/dist/core/agent/AdaptivePlanner.js +49 -0
  44. package/dist/core/agent/AutoFixEngine.js +37 -0
  45. package/dist/core/agent/ExecutorAgent.js +79 -0
  46. package/dist/core/agent/LearningMemoryAgent.js +67 -0
  47. package/dist/core/agent/MemoryAgent.js +35 -0
  48. package/dist/core/agent/MetaCognitionAgent.js +38 -0
  49. package/dist/core/agent/PlannerAgent.js +59 -0
  50. package/dist/core/agent/ReflectionLoop.js +34 -0
  51. package/dist/core/agent/ReviewerAgent.js +34 -0
  52. package/dist/core/agent/VerificationAgent.js +20 -0
  53. package/dist/core/agent/specialists/SpecializedAgents.js +43 -0
  54. package/dist/core/ai/GeminiProvider.js +113 -0
  55. package/dist/core/ai/listModels.js +73 -0
  56. package/dist/core/monitor/PerformanceMonitor.js +18 -0
  57. package/dist/core/swarm/AgentSwarm.js +56 -0
  58. package/dist/core/swarm/ReasoningBus.js +26 -0
  59. package/dist/core/swarm/SwarmOrchestrator.js +36 -0
  60. package/dist/discovery/experimentOrchestrator.js +75 -0
  61. package/dist/discovery/hypothesisEngine.js +79 -0
  62. package/dist/discovery/knowledgeSynthesizer.js +83 -0
  63. package/dist/discovery/simulationPipeline.js +57 -0
  64. package/dist/experiments/experimentationEngine.js +174 -0
  65. package/dist/index.js +67 -0
  66. package/dist/kernel/eventBus.js +89 -0
  67. package/dist/kernel/kernel.js +146 -0
  68. package/dist/llm/tokenEfficiencyOptimizer.js +91 -0
  69. package/dist/memory/civilizationMemory.js +147 -0
  70. package/dist/memory/globalVectorMemory.js +87 -0
  71. package/dist/mesh/crossOrgProtocol.js +110 -0
  72. package/dist/mesh/globalReasoningBus.js +99 -0
  73. package/dist/observability/businessDashboard.js +103 -0
  74. package/dist/observability/businessMetrics.js +105 -0
  75. package/dist/observability/cognitiveMetrics.js +119 -0
  76. package/dist/observability/failureSurfaceMapper.js +135 -0
  77. package/dist/observability/metricsCollector.js +94 -0
  78. package/dist/observability/planetaryDashboard.js +97 -0
  79. package/dist/observability/planetaryMetrics.js +127 -0
  80. package/dist/observability/reportRenderer.js +100 -0
  81. package/dist/performance/memoryProfiler.js +107 -0
  82. package/dist/performance/profiler.js +130 -0
  83. package/dist/pipelines/evolvePipeline.js +150 -0
  84. package/dist/pipelines/governanceReviewPipeline.js +68 -0
  85. package/dist/pipelines/introspectPipeline.js +73 -0
  86. package/dist/pipelines/venture/growPipeline.js +51 -0
  87. package/dist/pipelines/venture/launchPipeline.js +55 -0
  88. package/dist/pipelines/venture/monetizePipeline.js +46 -0
  89. package/dist/pipelines/venture/shutdownPipeline.js +40 -0
  90. package/dist/pipelines/venture/startupPipeline.js +145 -0
  91. package/dist/pipelines/venture/validatePipeline.js +40 -0
  92. package/dist/planet/controlPlane.js +131 -0
  93. package/dist/planet/executionEngine.js +142 -0
  94. package/dist/planet/globalTypes.js +5 -0
  95. package/dist/planet/regionManager.js +114 -0
  96. package/dist/quality/codeQualityAuditor.js +161 -0
  97. package/dist/safety/containmentProtocols.js +87 -0
  98. package/dist/safety/integrityChecker.js +110 -0
  99. package/dist/safety/kernelGuard.js +57 -0
  100. package/dist/safety/killSwitch.js +100 -0
  101. package/dist/safety/planetaryKernel.js +92 -0
  102. package/dist/safety/policyEngine.js +129 -0
  103. package/dist/safety/rollbackManager.js +141 -0
  104. package/dist/safety/sandbox.js +143 -0
  105. package/dist/server/mindmapServer.js +102 -0
  106. package/dist/state/distributedState.js +241 -0
  107. package/dist/state/fileStateStore.js +264 -0
  108. package/dist/state/snapshotter.js +96 -0
  109. package/dist/state/stateStore.js +5 -0
  110. package/dist/tools/FileTools.js +25 -0
  111. package/dist/tools/GitTools.js +16 -0
  112. package/dist/tools/ShellTools.js +24 -0
  113. package/dist/types/architecture.js +5 -0
  114. package/dist/types/core.js +35 -0
  115. package/dist/types/governance.js +5 -0
  116. package/dist/types/venture.js +5 -0
  117. package/dist/ui/App.js +32 -0
  118. package/dist/ui/animation/AnimationEngine.js +117 -0
  119. package/dist/ui/animation/Easing.js +61 -0
  120. package/dist/ui/cli.js +50 -0
  121. package/dist/ui/command/ActionPreview.js +47 -0
  122. package/dist/ui/command/CommandPalette.js +55 -0
  123. package/dist/ui/command/NaturalLanguageBar.js +77 -0
  124. package/dist/ui/emotion/AnimationSequences.js +59 -0
  125. package/dist/ui/emotion/EmotionalUXEngine.js +86 -0
  126. package/dist/ui/integration/BackendAdapter.js +50 -0
  127. package/dist/ui/integration/WebSocketAdapter.js +90 -0
  128. package/dist/ui/intelligence/AdaptiveUIEngine.js +75 -0
  129. package/dist/ui/intelligence/UserBehaviorTracker.js +88 -0
  130. package/dist/ui/layout/LayoutEngine.js +115 -0
  131. package/dist/ui/mindmap/CognitiveMindmapRenderer.js +53 -0
  132. package/dist/ui/mindmap/EdgeRenderer.js +35 -0
  133. package/dist/ui/mindmap/GraphLayout.js +137 -0
  134. package/dist/ui/mindmap/MindmapControls.js +53 -0
  135. package/dist/ui/mindmap/NodeRenderer.js +53 -0
  136. package/dist/ui/modes/CognitiveMode.js +31 -0
  137. package/dist/ui/modes/CommandMode.js +6 -0
  138. package/dist/ui/modes/GovernanceMode.js +6 -0
  139. package/dist/ui/modes/MissionControlMode.js +6 -0
  140. package/dist/ui/modes/ModeManager.js +67 -0
  141. package/dist/ui/modes/ObservatoryMode.js +10 -0
  142. package/dist/ui/modes/TimelineMode.js +27 -0
  143. package/dist/ui/terminalOS.js +180 -0
  144. package/dist/ui/theme/ThemeEngine.js +164 -0
  145. package/dist/ui/visual/ColorGradient.js +91 -0
  146. package/dist/ui/visual/Typography.js +128 -0
  147. package/dist/ui/visual/UnicodeRenderer.js +86 -0
  148. package/dist/venture/ventureMemory.js +62 -0
  149. package/package.json +70 -0
@@ -0,0 +1,189 @@
1
+ /**
2
+ * Validation Agent for BASETREE V6
3
+ * Landing pages, surveys, A/B testing for validation
4
+ */
5
+ import { getKernel } from '../../kernel/kernel.js';
6
+ import { FileTools } from '../../tools/FileTools.js';
7
+ import { randomUUID } from 'crypto';
8
+ import { join } from 'path';
9
+ export class ValidationAgent {
10
+ kernel = getKernel();
11
+ async createValidationExperiment(venture) {
12
+ const experimentId = `exp_${randomUUID()}`;
13
+ const venturePath = join('ventures', venture.slug);
14
+ // Create landing page variants
15
+ const variantA = await this.generateLandingPage(venture, 'A', {
16
+ headline: venture.generatedIdea.solution,
17
+ cta: 'Get Started',
18
+ style: 'modern',
19
+ });
20
+ const variantB = await this.generateLandingPage(venture, 'B', {
21
+ headline: `Solve ${venture.generatedIdea.problem}`,
22
+ cta: 'Try Now',
23
+ style: 'minimal',
24
+ });
25
+ // Save landing pages
26
+ await FileTools.writeFile(join(venturePath, 'landing', 'variant-a.html'), variantA);
27
+ await FileTools.writeFile(join(venturePath, 'landing', 'variant-b.html'), variantB);
28
+ const experiment = {
29
+ id: experimentId,
30
+ ventureId: venture.id,
31
+ type: 'landing_page',
32
+ hypothesis: `Testing two landing page variants to determine which converts better`,
33
+ variants: [
34
+ {
35
+ id: 'variant_a',
36
+ name: 'Variant A - Solution Focused',
37
+ description: 'Emphasizes the solution with modern design',
38
+ trafficShare: 0.5,
39
+ metrics: {
40
+ visitors: 0,
41
+ signups: 0,
42
+ conversions: 0,
43
+ revenue: 0,
44
+ },
45
+ },
46
+ {
47
+ id: 'variant_b',
48
+ name: 'Variant B - Problem Focused',
49
+ description: 'Emphasizes the problem with minimal design',
50
+ trafficShare: 0.5,
51
+ metrics: {
52
+ visitors: 0,
53
+ signups: 0,
54
+ conversions: 0,
55
+ revenue: 0,
56
+ },
57
+ },
58
+ ],
59
+ createdAt: new Date(),
60
+ status: 'pending',
61
+ };
62
+ await this.kernel.getStateStore().saveExperiment(experiment);
63
+ await this.kernel.getStateStore().updateVenture(venture.id, {
64
+ experimentIds: [...venture.experimentIds, experimentId],
65
+ });
66
+ return experiment;
67
+ }
68
+ async generateLandingPage(venture, variant, options) {
69
+ return `<!DOCTYPE html>
70
+ <html lang="en">
71
+ <head>
72
+ <meta charset="UTF-8">
73
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
74
+ <title>${venture.idea}</title>
75
+ <style>
76
+ * {
77
+ margin: 0;
78
+ padding: 0;
79
+ box-sizing: border-box;
80
+ }
81
+ body {
82
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
83
+ line-height: 1.6;
84
+ color: #333;
85
+ ${options.style === 'minimal' ? 'background: #fff;' : 'background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);'}
86
+ }
87
+ .container {
88
+ max-width: 1200px;
89
+ margin: 0 auto;
90
+ padding: 2rem;
91
+ }
92
+ header {
93
+ text-align: center;
94
+ padding: 4rem 0;
95
+ ${options.style === 'minimal' ? 'color: #333;' : 'color: #fff;'}
96
+ }
97
+ h1 {
98
+ font-size: 3rem;
99
+ margin-bottom: 1rem;
100
+ font-weight: 700;
101
+ }
102
+ .subtitle {
103
+ font-size: 1.25rem;
104
+ margin-bottom: 2rem;
105
+ opacity: 0.9;
106
+ }
107
+ .cta-button {
108
+ display: inline-block;
109
+ padding: 1rem 2rem;
110
+ background: ${options.style === 'minimal' ? '#667eea' : '#fff'};
111
+ color: ${options.style === 'minimal' ? '#fff' : '#667eea'};
112
+ text-decoration: none;
113
+ border-radius: 8px;
114
+ font-size: 1.1rem;
115
+ font-weight: 600;
116
+ transition: transform 0.2s;
117
+ }
118
+ .cta-button:hover {
119
+ transform: translateY(-2px);
120
+ }
121
+ .features {
122
+ display: grid;
123
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
124
+ gap: 2rem;
125
+ margin-top: 4rem;
126
+ ${options.style === 'minimal' ? 'color: #333;' : 'color: #fff;'}
127
+ }
128
+ .feature {
129
+ padding: 1.5rem;
130
+ ${options.style === 'minimal' ? 'background: #f5f5f5; border-radius: 8px;' : 'background: rgba(255,255,255,0.1); border-radius: 8px;'}
131
+ }
132
+ .feature h3 {
133
+ margin-bottom: 0.5rem;
134
+ }
135
+ footer {
136
+ text-align: center;
137
+ margin-top: 4rem;
138
+ padding: 2rem 0;
139
+ ${options.style === 'minimal' ? 'color: #666;' : 'color: rgba(255,255,255,0.8);'}
140
+ }
141
+ </style>
142
+ </head>
143
+ <body>
144
+ <div class="container">
145
+ <header>
146
+ <h1>${options.headline}</h1>
147
+ <p class="subtitle">${venture.generatedIdea.problem}</p>
148
+ <a href="#signup" class="cta-button" onclick="trackEvent('click_cta', '${variant}')">${options.cta}</a>
149
+ </header>
150
+
151
+ <div class="features">
152
+ <div class="feature">
153
+ <h3>Problem Solved</h3>
154
+ <p>${venture.generatedIdea.problem}</p>
155
+ </div>
156
+ <div class="feature">
157
+ <h3>Our Solution</h3>
158
+ <p>${venture.generatedIdea.solution}</p>
159
+ </div>
160
+ <div class="feature">
161
+ <h3>For You</h3>
162
+ <p>${venture.generatedIdea.targetCustomer}</p>
163
+ </div>
164
+ </div>
165
+
166
+ <footer>
167
+ <p>&copy; ${new Date().getFullYear()} ${venture.idea}. All rights reserved.</p>
168
+ </footer>
169
+ </div>
170
+
171
+ <script>
172
+ function trackEvent(event, variant) {
173
+ // Track events for experiment
174
+ fetch('/api/track', {
175
+ method: 'POST',
176
+ headers: { 'Content-Type': 'application/json' },
177
+ body: JSON.stringify({ event, variant, experimentId: '${venture.experimentIds[0] || ''}' })
178
+ }).catch(console.error);
179
+ }
180
+
181
+ // Track page view
182
+ window.addEventListener('load', () => {
183
+ trackEvent('page_view', '${variant}');
184
+ });
185
+ </script>
186
+ </body>
187
+ </html>`;
188
+ }
189
+ }
@@ -0,0 +1,200 @@
1
+ /**
2
+ * Bootstrap for BASETREE V5/V6
3
+ * Registers all agents and pipelines with the kernel
4
+ */
5
+ import { getKernel } from './kernel/kernel.js';
6
+ import { EvolvePipeline } from './pipelines/evolvePipeline.js';
7
+ import { IntrospectPipeline } from './pipelines/introspectPipeline.js';
8
+ import { GovernanceReviewPipeline } from './pipelines/governanceReviewPipeline.js';
9
+ // V6 Venture agents and pipelines
10
+ import { StartupPipeline } from './pipelines/venture/startupPipeline.js';
11
+ import { ValidatePipeline } from './pipelines/venture/validatePipeline.js';
12
+ import { LaunchPipeline } from './pipelines/venture/launchPipeline.js';
13
+ import { GrowPipeline } from './pipelines/venture/growPipeline.js';
14
+ import { MonetizePipeline } from './pipelines/venture/monetizePipeline.js';
15
+ import { ShutdownPipeline } from './pipelines/venture/shutdownPipeline.js';
16
+ export async function bootstrap() {
17
+ const kernel = getKernel();
18
+ // Register agents
19
+ kernel.registerAgent({
20
+ id: 'system-introspection-agent',
21
+ name: 'System Introspection Agent',
22
+ });
23
+ kernel.registerAgent({
24
+ id: 'policy-agent',
25
+ name: 'Policy Agent',
26
+ });
27
+ kernel.registerAgent({
28
+ id: 'stability-agent',
29
+ name: 'Stability Agent',
30
+ });
31
+ kernel.registerAgent({
32
+ id: 'alignment-agent',
33
+ name: 'Alignment Agent',
34
+ });
35
+ kernel.registerAgent({
36
+ id: 'risk-evaluation-agent',
37
+ name: 'Risk Evaluation Agent',
38
+ });
39
+ kernel.registerAgent({
40
+ id: 'governance-orchestrator',
41
+ name: 'Governance Orchestrator',
42
+ });
43
+ kernel.registerAgent({
44
+ id: 'upgrade-planner-agent',
45
+ name: 'Upgrade Planner Agent',
46
+ });
47
+ kernel.registerAgent({
48
+ id: 'upgrade-executor-agent',
49
+ name: 'Upgrade Executor Agent',
50
+ });
51
+ kernel.registerAgent({
52
+ id: 'regression-agent',
53
+ name: 'Regression Agent',
54
+ });
55
+ kernel.registerAgent({
56
+ id: 'rollback-agent',
57
+ name: 'Rollback Agent',
58
+ });
59
+ kernel.registerAgent({
60
+ id: 'reasoning-optimizer-agent',
61
+ name: 'Reasoning Optimizer Agent',
62
+ });
63
+ kernel.registerAgent({
64
+ id: 'strategy-mutation-agent',
65
+ name: 'Strategy Mutation Agent',
66
+ });
67
+ kernel.registerAgent({
68
+ id: 'prompt-genome-agent',
69
+ name: 'Prompt Genome Agent',
70
+ });
71
+ kernel.registerAgent({
72
+ id: 'reinforcement-learner-agent',
73
+ name: 'Reinforcement Learner Agent',
74
+ });
75
+ // V6 Venture Agents
76
+ kernel.registerAgent({
77
+ id: 'ideation-agent',
78
+ name: 'Ideation Agent',
79
+ });
80
+ kernel.registerAgent({
81
+ id: 'market-research-agent',
82
+ name: 'Market Research Agent',
83
+ });
84
+ kernel.registerAgent({
85
+ id: 'validation-agent',
86
+ name: 'Validation Agent',
87
+ });
88
+ kernel.registerAgent({
89
+ id: 'business-model-agent',
90
+ name: 'Business Model Agent',
91
+ });
92
+ kernel.registerAgent({
93
+ id: 'product-agent',
94
+ name: 'Product Agent',
95
+ });
96
+ kernel.registerAgent({
97
+ id: 'growth-agent',
98
+ name: 'Growth Agent',
99
+ });
100
+ kernel.registerAgent({
101
+ id: 'revenue-agent',
102
+ name: 'Revenue Agent',
103
+ });
104
+ kernel.registerAgent({
105
+ id: 'legal-agent',
106
+ name: 'Legal Agent',
107
+ });
108
+ kernel.registerAgent({
109
+ id: 'investor-agent',
110
+ name: 'Investor Agent',
111
+ });
112
+ // Register pipelines
113
+ const evolvePipeline = new EvolvePipeline();
114
+ kernel.registerPipeline({
115
+ id: 'evolve',
116
+ name: 'Evolve Pipeline',
117
+ run: async (...args) => {
118
+ const options = args[0] || {};
119
+ return evolvePipeline.run(options);
120
+ },
121
+ });
122
+ const introspectPipeline = new IntrospectPipeline();
123
+ kernel.registerPipeline({
124
+ id: 'introspect',
125
+ name: 'Introspect Pipeline',
126
+ run: async (...args) => {
127
+ const options = args[0] || {};
128
+ return introspectPipeline.run(options);
129
+ },
130
+ });
131
+ const governancePipeline = new GovernanceReviewPipeline();
132
+ kernel.registerPipeline({
133
+ id: 'governance',
134
+ name: 'Governance Review Pipeline',
135
+ run: async (...args) => {
136
+ const options = args[0] || {};
137
+ return governancePipeline.run(options);
138
+ },
139
+ });
140
+ // V6 Venture Pipelines
141
+ const startupPipeline = new StartupPipeline();
142
+ kernel.registerPipeline({
143
+ id: 'startup',
144
+ name: 'Startup Pipeline',
145
+ run: async (...args) => {
146
+ const idea = args[0];
147
+ return startupPipeline.run(idea);
148
+ },
149
+ });
150
+ const validatePipeline = new ValidatePipeline();
151
+ kernel.registerPipeline({
152
+ id: 'validate',
153
+ name: 'Validate Pipeline',
154
+ run: async (...args) => {
155
+ const ventureId = args[0];
156
+ return validatePipeline.run(ventureId);
157
+ },
158
+ });
159
+ const launchPipeline = new LaunchPipeline();
160
+ kernel.registerPipeline({
161
+ id: 'launch',
162
+ name: 'Launch Pipeline',
163
+ run: async (...args) => {
164
+ const ventureId = args[0];
165
+ return launchPipeline.run(ventureId);
166
+ },
167
+ });
168
+ const growPipeline = new GrowPipeline();
169
+ kernel.registerPipeline({
170
+ id: 'grow',
171
+ name: 'Grow Pipeline',
172
+ run: async (...args) => {
173
+ const ventureId = args[0];
174
+ return growPipeline.run(ventureId);
175
+ },
176
+ });
177
+ const monetizePipeline = new MonetizePipeline();
178
+ kernel.registerPipeline({
179
+ id: 'monetize',
180
+ name: 'Monetize Pipeline',
181
+ run: async (...args) => {
182
+ const ventureId = args[0];
183
+ return monetizePipeline.run(ventureId);
184
+ },
185
+ });
186
+ const shutdownPipeline = new ShutdownPipeline();
187
+ kernel.registerPipeline({
188
+ id: 'shutdown',
189
+ name: 'Shutdown Pipeline',
190
+ run: async (...args) => {
191
+ const ventureId = args[0];
192
+ // For CLI, reason comes from options object
193
+ const options = args[1] || {};
194
+ const reason = options.reason || 'Business decision';
195
+ return shutdownPipeline.run(ventureId, reason);
196
+ },
197
+ });
198
+ // Initialize kernel
199
+ await kernel.initialize();
200
+ }