genesis-ai-cli 7.4.5

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 (227) hide show
  1. package/.env.example +78 -0
  2. package/README.md +282 -0
  3. package/dist/src/active-inference/actions.d.ts +75 -0
  4. package/dist/src/active-inference/actions.js +250 -0
  5. package/dist/src/active-inference/autonomous-loop.d.ts +103 -0
  6. package/dist/src/active-inference/autonomous-loop.js +289 -0
  7. package/dist/src/active-inference/core.d.ts +85 -0
  8. package/dist/src/active-inference/core.js +555 -0
  9. package/dist/src/active-inference/demo-autonomous-loop.d.ts +8 -0
  10. package/dist/src/active-inference/demo-autonomous-loop.js +338 -0
  11. package/dist/src/active-inference/demo-value-integration.d.ts +8 -0
  12. package/dist/src/active-inference/demo-value-integration.js +174 -0
  13. package/dist/src/active-inference/index.d.ts +32 -0
  14. package/dist/src/active-inference/index.js +88 -0
  15. package/dist/src/active-inference/integration.d.ts +114 -0
  16. package/dist/src/active-inference/integration.js +698 -0
  17. package/dist/src/active-inference/memory-integration.d.ts +51 -0
  18. package/dist/src/active-inference/memory-integration.js +232 -0
  19. package/dist/src/active-inference/observations.d.ts +67 -0
  20. package/dist/src/active-inference/observations.js +147 -0
  21. package/dist/src/active-inference/test-active-inference.d.ts +8 -0
  22. package/dist/src/active-inference/test-active-inference.js +320 -0
  23. package/dist/src/active-inference/test-value-integration.d.ts +6 -0
  24. package/dist/src/active-inference/test-value-integration.js +168 -0
  25. package/dist/src/active-inference/types.d.ts +150 -0
  26. package/dist/src/active-inference/types.js +59 -0
  27. package/dist/src/active-inference/value-integration.d.ts +164 -0
  28. package/dist/src/active-inference/value-integration.js +459 -0
  29. package/dist/src/agents/base-agent.d.ts +53 -0
  30. package/dist/src/agents/base-agent.js +178 -0
  31. package/dist/src/agents/builder.d.ts +67 -0
  32. package/dist/src/agents/builder.js +537 -0
  33. package/dist/src/agents/critic.d.ts +35 -0
  34. package/dist/src/agents/critic.js +322 -0
  35. package/dist/src/agents/ethicist.d.ts +54 -0
  36. package/dist/src/agents/ethicist.js +393 -0
  37. package/dist/src/agents/explorer.d.ts +26 -0
  38. package/dist/src/agents/explorer.js +216 -0
  39. package/dist/src/agents/feeling.d.ts +41 -0
  40. package/dist/src/agents/feeling.js +320 -0
  41. package/dist/src/agents/index.d.ts +111 -0
  42. package/dist/src/agents/index.js +222 -0
  43. package/dist/src/agents/memory.d.ts +69 -0
  44. package/dist/src/agents/memory.js +404 -0
  45. package/dist/src/agents/message-bus.d.ts +88 -0
  46. package/dist/src/agents/message-bus.js +267 -0
  47. package/dist/src/agents/narrator.d.ts +90 -0
  48. package/dist/src/agents/narrator.js +473 -0
  49. package/dist/src/agents/planner.d.ts +38 -0
  50. package/dist/src/agents/planner.js +341 -0
  51. package/dist/src/agents/predictor.d.ts +73 -0
  52. package/dist/src/agents/predictor.js +506 -0
  53. package/dist/src/agents/sensor.d.ts +88 -0
  54. package/dist/src/agents/sensor.js +377 -0
  55. package/dist/src/agents/test-agents.d.ts +6 -0
  56. package/dist/src/agents/test-agents.js +73 -0
  57. package/dist/src/agents/types.d.ts +194 -0
  58. package/dist/src/agents/types.js +7 -0
  59. package/dist/src/brain/index.d.ts +185 -0
  60. package/dist/src/brain/index.js +843 -0
  61. package/dist/src/brain/trace.d.ts +91 -0
  62. package/dist/src/brain/trace.js +327 -0
  63. package/dist/src/brain/types.d.ts +165 -0
  64. package/dist/src/brain/types.js +51 -0
  65. package/dist/src/cli/chat.d.ts +237 -0
  66. package/dist/src/cli/chat.js +1959 -0
  67. package/dist/src/cli/dispatcher.d.ts +182 -0
  68. package/dist/src/cli/dispatcher.js +718 -0
  69. package/dist/src/cli/human-loop.d.ts +170 -0
  70. package/dist/src/cli/human-loop.js +543 -0
  71. package/dist/src/cli/index.d.ts +12 -0
  72. package/dist/src/cli/index.js +28 -0
  73. package/dist/src/cli/interactive.d.ts +141 -0
  74. package/dist/src/cli/interactive.js +757 -0
  75. package/dist/src/cli/ui.d.ts +205 -0
  76. package/dist/src/cli/ui.js +632 -0
  77. package/dist/src/consciousness/attention-schema.d.ts +154 -0
  78. package/dist/src/consciousness/attention-schema.js +432 -0
  79. package/dist/src/consciousness/global-workspace.d.ts +149 -0
  80. package/dist/src/consciousness/global-workspace.js +422 -0
  81. package/dist/src/consciousness/index.d.ts +186 -0
  82. package/dist/src/consciousness/index.js +476 -0
  83. package/dist/src/consciousness/phi-calculator.d.ts +119 -0
  84. package/dist/src/consciousness/phi-calculator.js +445 -0
  85. package/dist/src/consciousness/phi-decisions.d.ts +169 -0
  86. package/dist/src/consciousness/phi-decisions.js +383 -0
  87. package/dist/src/consciousness/phi-monitor.d.ts +153 -0
  88. package/dist/src/consciousness/phi-monitor.js +465 -0
  89. package/dist/src/consciousness/types.d.ts +260 -0
  90. package/dist/src/consciousness/types.js +44 -0
  91. package/dist/src/daemon/dream-mode.d.ts +115 -0
  92. package/dist/src/daemon/dream-mode.js +470 -0
  93. package/dist/src/daemon/index.d.ts +162 -0
  94. package/dist/src/daemon/index.js +542 -0
  95. package/dist/src/daemon/maintenance.d.ts +139 -0
  96. package/dist/src/daemon/maintenance.js +549 -0
  97. package/dist/src/daemon/process.d.ts +82 -0
  98. package/dist/src/daemon/process.js +442 -0
  99. package/dist/src/daemon/scheduler.d.ts +90 -0
  100. package/dist/src/daemon/scheduler.js +494 -0
  101. package/dist/src/daemon/types.d.ts +213 -0
  102. package/dist/src/daemon/types.js +50 -0
  103. package/dist/src/epistemic/index.d.ts +74 -0
  104. package/dist/src/epistemic/index.js +225 -0
  105. package/dist/src/grounding/epistemic-stack.d.ts +100 -0
  106. package/dist/src/grounding/epistemic-stack.js +408 -0
  107. package/dist/src/grounding/feedback.d.ts +98 -0
  108. package/dist/src/grounding/feedback.js +276 -0
  109. package/dist/src/grounding/index.d.ts +123 -0
  110. package/dist/src/grounding/index.js +224 -0
  111. package/dist/src/grounding/verifier.d.ts +149 -0
  112. package/dist/src/grounding/verifier.js +484 -0
  113. package/dist/src/healing/detector.d.ts +110 -0
  114. package/dist/src/healing/detector.js +436 -0
  115. package/dist/src/healing/fixer.d.ts +138 -0
  116. package/dist/src/healing/fixer.js +572 -0
  117. package/dist/src/healing/index.d.ts +23 -0
  118. package/dist/src/healing/index.js +43 -0
  119. package/dist/src/hooks/index.d.ts +135 -0
  120. package/dist/src/hooks/index.js +317 -0
  121. package/dist/src/index.d.ts +23 -0
  122. package/dist/src/index.js +1266 -0
  123. package/dist/src/kernel/index.d.ts +155 -0
  124. package/dist/src/kernel/index.js +795 -0
  125. package/dist/src/kernel/invariants.d.ts +153 -0
  126. package/dist/src/kernel/invariants.js +355 -0
  127. package/dist/src/kernel/test-kernel.d.ts +6 -0
  128. package/dist/src/kernel/test-kernel.js +108 -0
  129. package/dist/src/kernel/test-real-mcp.d.ts +10 -0
  130. package/dist/src/kernel/test-real-mcp.js +295 -0
  131. package/dist/src/llm/index.d.ts +146 -0
  132. package/dist/src/llm/index.js +428 -0
  133. package/dist/src/llm/router.d.ts +136 -0
  134. package/dist/src/llm/router.js +510 -0
  135. package/dist/src/mcp/index.d.ts +85 -0
  136. package/dist/src/mcp/index.js +657 -0
  137. package/dist/src/mcp/resilient.d.ts +139 -0
  138. package/dist/src/mcp/resilient.js +417 -0
  139. package/dist/src/memory/cache.d.ts +118 -0
  140. package/dist/src/memory/cache.js +356 -0
  141. package/dist/src/memory/cognitive-workspace.d.ts +231 -0
  142. package/dist/src/memory/cognitive-workspace.js +521 -0
  143. package/dist/src/memory/consolidation.d.ts +99 -0
  144. package/dist/src/memory/consolidation.js +443 -0
  145. package/dist/src/memory/episodic.d.ts +114 -0
  146. package/dist/src/memory/episodic.js +394 -0
  147. package/dist/src/memory/forgetting.d.ts +134 -0
  148. package/dist/src/memory/forgetting.js +324 -0
  149. package/dist/src/memory/index.d.ts +211 -0
  150. package/dist/src/memory/index.js +367 -0
  151. package/dist/src/memory/indexer.d.ts +123 -0
  152. package/dist/src/memory/indexer.js +479 -0
  153. package/dist/src/memory/procedural.d.ts +136 -0
  154. package/dist/src/memory/procedural.js +479 -0
  155. package/dist/src/memory/semantic.d.ts +132 -0
  156. package/dist/src/memory/semantic.js +497 -0
  157. package/dist/src/memory/types.d.ts +193 -0
  158. package/dist/src/memory/types.js +15 -0
  159. package/dist/src/orchestrator.d.ts +65 -0
  160. package/dist/src/orchestrator.js +317 -0
  161. package/dist/src/persistence/index.d.ts +257 -0
  162. package/dist/src/persistence/index.js +763 -0
  163. package/dist/src/pipeline/executor.d.ts +51 -0
  164. package/dist/src/pipeline/executor.js +695 -0
  165. package/dist/src/pipeline/index.d.ts +7 -0
  166. package/dist/src/pipeline/index.js +11 -0
  167. package/dist/src/self-production.d.ts +67 -0
  168. package/dist/src/self-production.js +205 -0
  169. package/dist/src/subagents/executor.d.ts +58 -0
  170. package/dist/src/subagents/executor.js +283 -0
  171. package/dist/src/subagents/index.d.ts +37 -0
  172. package/dist/src/subagents/index.js +53 -0
  173. package/dist/src/subagents/registry.d.ts +23 -0
  174. package/dist/src/subagents/registry.js +167 -0
  175. package/dist/src/subagents/types.d.ts +79 -0
  176. package/dist/src/subagents/types.js +14 -0
  177. package/dist/src/tools/bash.d.ts +139 -0
  178. package/dist/src/tools/bash.js +583 -0
  179. package/dist/src/tools/edit.d.ts +125 -0
  180. package/dist/src/tools/edit.js +424 -0
  181. package/dist/src/tools/git.d.ts +179 -0
  182. package/dist/src/tools/git.js +504 -0
  183. package/dist/src/tools/index.d.ts +21 -0
  184. package/dist/src/tools/index.js +163 -0
  185. package/dist/src/types.d.ts +145 -0
  186. package/dist/src/types.js +7 -0
  187. package/dist/src/world-model/decoder.d.ts +163 -0
  188. package/dist/src/world-model/decoder.js +517 -0
  189. package/dist/src/world-model/digital-twin.d.ts +219 -0
  190. package/dist/src/world-model/digital-twin.js +695 -0
  191. package/dist/src/world-model/encoder.d.ts +141 -0
  192. package/dist/src/world-model/encoder.js +564 -0
  193. package/dist/src/world-model/index.d.ts +221 -0
  194. package/dist/src/world-model/index.js +772 -0
  195. package/dist/src/world-model/predictor.d.ts +161 -0
  196. package/dist/src/world-model/predictor.js +681 -0
  197. package/dist/src/world-model/test-value-jepa.d.ts +8 -0
  198. package/dist/src/world-model/test-value-jepa.js +430 -0
  199. package/dist/src/world-model/types.d.ts +341 -0
  200. package/dist/src/world-model/types.js +69 -0
  201. package/dist/src/world-model/value-jepa.d.ts +247 -0
  202. package/dist/src/world-model/value-jepa.js +622 -0
  203. package/dist/test/brain.test.d.ts +11 -0
  204. package/dist/test/brain.test.js +358 -0
  205. package/dist/test/cli/dispatcher.test.d.ts +4 -0
  206. package/dist/test/cli/dispatcher.test.js +332 -0
  207. package/dist/test/cli/human-loop.test.d.ts +4 -0
  208. package/dist/test/cli/human-loop.test.js +270 -0
  209. package/dist/test/grounding/feedback.test.d.ts +4 -0
  210. package/dist/test/grounding/feedback.test.js +462 -0
  211. package/dist/test/grounding/verifier.test.d.ts +4 -0
  212. package/dist/test/grounding/verifier.test.js +442 -0
  213. package/dist/test/grounding.test.d.ts +6 -0
  214. package/dist/test/grounding.test.js +246 -0
  215. package/dist/test/healing/detector.test.d.ts +4 -0
  216. package/dist/test/healing/detector.test.js +266 -0
  217. package/dist/test/healing/fixer.test.d.ts +4 -0
  218. package/dist/test/healing/fixer.test.js +369 -0
  219. package/dist/test/integration.test.d.ts +5 -0
  220. package/dist/test/integration.test.js +290 -0
  221. package/dist/test/tools/bash.test.d.ts +4 -0
  222. package/dist/test/tools/bash.test.js +348 -0
  223. package/dist/test/tools/edit.test.d.ts +4 -0
  224. package/dist/test/tools/edit.test.js +350 -0
  225. package/dist/test/tools/git.test.d.ts +4 -0
  226. package/dist/test/tools/git.test.js +350 -0
  227. package/package.json +60 -0
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ /**
3
+ * Genesis Tools Module
4
+ *
5
+ * Local tool capabilities:
6
+ * - Bash: Secure command execution
7
+ * - Edit: Diff-based file editing
8
+ * - Git: Native git operations
9
+ */
10
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ var desc = Object.getOwnPropertyDescriptor(m, k);
13
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
+ desc = { enumerable: true, get: function() { return m[k]; } };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }) : (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ o[k2] = m[k];
20
+ }));
21
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
22
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.toolRegistry = void 0;
26
+ __exportStar(require("./bash.js"), exports);
27
+ __exportStar(require("./edit.js"), exports);
28
+ __exportStar(require("./git.js"), exports);
29
+ // Will be populated as tools are added
30
+ exports.toolRegistry = new Map();
31
+ // Register bash tool
32
+ const bash_js_1 = require("./bash.js");
33
+ exports.toolRegistry.set('bash', {
34
+ name: 'bash',
35
+ description: 'Execute shell commands in a secure sandbox',
36
+ execute: async (params) => {
37
+ const command = params.command;
38
+ const options = params.options;
39
+ return (0, bash_js_1.getBashTool)().execute(command, options);
40
+ },
41
+ validate: (params) => {
42
+ const command = params.command;
43
+ if (!command) {
44
+ return { valid: false, reason: 'Missing command parameter' };
45
+ }
46
+ const result = (0, bash_js_1.getBashTool)().validate(command);
47
+ return { valid: result.valid, reason: result.reason };
48
+ },
49
+ });
50
+ // Register edit tool
51
+ const edit_js_1 = require("./edit.js");
52
+ exports.toolRegistry.set('edit', {
53
+ name: 'edit',
54
+ description: 'Edit files using diff-based replacement',
55
+ execute: async (params) => {
56
+ return (0, edit_js_1.getEditTool)().edit({
57
+ file_path: params.file_path,
58
+ old_string: params.old_string,
59
+ new_string: params.new_string,
60
+ replace_all: params.replace_all,
61
+ });
62
+ },
63
+ validate: (params) => {
64
+ const file_path = params.file_path;
65
+ const old_string = params.old_string;
66
+ const new_string = params.new_string;
67
+ if (!file_path)
68
+ return { valid: false, reason: 'Missing file_path parameter' };
69
+ if (!old_string)
70
+ return { valid: false, reason: 'Missing old_string parameter' };
71
+ if (new_string === undefined)
72
+ return { valid: false, reason: 'Missing new_string parameter' };
73
+ return (0, edit_js_1.getEditTool)().validatePath(file_path);
74
+ },
75
+ });
76
+ exports.toolRegistry.set('write', {
77
+ name: 'write',
78
+ description: 'Write content to a file',
79
+ execute: async (params) => {
80
+ const { file_path, content, backup } = params;
81
+ return (0, edit_js_1.getEditTool)().write({
82
+ file_path: file_path,
83
+ content: content,
84
+ backup: backup,
85
+ });
86
+ },
87
+ validate: (params) => {
88
+ const { file_path, content } = params;
89
+ if (!file_path)
90
+ return { valid: false, reason: 'Missing file_path parameter' };
91
+ if (content === undefined)
92
+ return { valid: false, reason: 'Missing content parameter' };
93
+ return (0, edit_js_1.getEditTool)().validatePath(file_path);
94
+ },
95
+ });
96
+ // Register git tools
97
+ const git_js_1 = require("./git.js");
98
+ exports.toolRegistry.set('git_status', {
99
+ name: 'git_status',
100
+ description: 'Get git repository status',
101
+ execute: async (params) => {
102
+ return (0, git_js_1.getGitTool)().status(params.cwd);
103
+ },
104
+ });
105
+ exports.toolRegistry.set('git_diff', {
106
+ name: 'git_diff',
107
+ description: 'Get diff of changes',
108
+ execute: async (params) => {
109
+ return (0, git_js_1.getGitTool)().diff({
110
+ staged: params.staged,
111
+ file: params.file,
112
+ }, params.cwd);
113
+ },
114
+ });
115
+ exports.toolRegistry.set('git_log', {
116
+ name: 'git_log',
117
+ description: 'Get commit history',
118
+ execute: async (params) => {
119
+ return (0, git_js_1.getGitTool)().log({
120
+ count: params.count,
121
+ oneline: params.oneline,
122
+ }, params.cwd);
123
+ },
124
+ });
125
+ exports.toolRegistry.set('git_add', {
126
+ name: 'git_add',
127
+ description: 'Stage files for commit',
128
+ execute: async (params) => {
129
+ const files = params.files;
130
+ if (!files || files.length === 0) {
131
+ return { success: false, error: 'No files specified' };
132
+ }
133
+ return (0, git_js_1.getGitTool)().add(files, params.cwd);
134
+ },
135
+ });
136
+ exports.toolRegistry.set('git_commit', {
137
+ name: 'git_commit',
138
+ description: 'Create a commit',
139
+ execute: async (params) => {
140
+ const message = params.message;
141
+ if (!message) {
142
+ return { success: false, error: 'Missing commit message' };
143
+ }
144
+ return (0, git_js_1.getGitTool)().commit({
145
+ message,
146
+ addSignature: params.addSignature,
147
+ files: params.files,
148
+ }, params.cwd);
149
+ },
150
+ });
151
+ exports.toolRegistry.set('git_push', {
152
+ name: 'git_push',
153
+ description: 'Push to remote (requires confirmation)',
154
+ execute: async (params) => {
155
+ return (0, git_js_1.getGitTool)().push({
156
+ remote: params.remote,
157
+ branch: params.branch,
158
+ setUpstream: params.setUpstream,
159
+ force: params.force,
160
+ confirmed: params.confirmed,
161
+ }, params.cwd);
162
+ },
163
+ });
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Genesis - System Creator Types
3
+ *
4
+ * Core type definitions for MCP orchestration
5
+ */
6
+ /**
7
+ * Names of all 13 MCP servers available to Genesis.
8
+ * Renamed from MCPServer to avoid conflict with MCPServerState interface.
9
+ */
10
+ export type MCPServerName = 'filesystem' | 'github' | 'openai' | 'memory' | 'gemini' | 'context7' | 'arxiv' | 'semantic-scholar' | 'wolfram' | 'firecrawl' | 'exa' | 'brave-search' | 'stability-ai';
11
+ /** @deprecated Use MCPServerName instead */
12
+ export type MCPServer = MCPServerName;
13
+ export interface MCPCapability {
14
+ server: MCPServerName;
15
+ category: 'knowledge' | 'creation' | 'research' | 'visual' | 'storage';
16
+ tools: string[];
17
+ description: string;
18
+ }
19
+ export interface SystemSpec {
20
+ name: string;
21
+ description: string;
22
+ type: 'autopoietic' | 'agent' | 'multi-agent' | 'service' | 'custom';
23
+ features: string[];
24
+ constraints?: string[];
25
+ inspirations?: string[];
26
+ }
27
+ export interface GeneratedSystem {
28
+ spec: SystemSpec;
29
+ research: ResearchResult;
30
+ architecture: Architecture;
31
+ code: GeneratedCode;
32
+ visuals: Visual[];
33
+ repo?: string;
34
+ }
35
+ export interface ResearchResult {
36
+ papers: Paper[];
37
+ documentation: Documentation[];
38
+ codeExamples: CodeExample[];
39
+ webResults: WebResult[];
40
+ insights: string[];
41
+ }
42
+ export interface Paper {
43
+ title: string;
44
+ authors: string[];
45
+ year: number;
46
+ source: 'arxiv' | 'semantic-scholar';
47
+ url: string;
48
+ summary: string;
49
+ relevance: number;
50
+ }
51
+ export interface Documentation {
52
+ library: string;
53
+ source: 'context7';
54
+ content: string;
55
+ examples: string[];
56
+ }
57
+ export interface CodeExample {
58
+ source: 'exa' | 'github';
59
+ language: string;
60
+ code: string;
61
+ description: string;
62
+ }
63
+ export interface WebResult {
64
+ source: 'gemini' | 'brave-search' | 'firecrawl';
65
+ title: string;
66
+ url: string;
67
+ content: string;
68
+ }
69
+ export interface Architecture {
70
+ components: Component[];
71
+ relations: Relation[];
72
+ invariants: string[];
73
+ operations: Operation[];
74
+ events: EventType[];
75
+ }
76
+ export interface Component {
77
+ id: string;
78
+ name: string;
79
+ type: 'core' | 'service' | 'adapter' | 'util';
80
+ description: string;
81
+ dependencies: string[];
82
+ }
83
+ export interface Relation {
84
+ from: string;
85
+ to: string;
86
+ type: 'uses' | 'extends' | 'implements' | 'triggers';
87
+ }
88
+ export interface Operation {
89
+ id: string;
90
+ name: string;
91
+ description: string;
92
+ inputs: Parameter[];
93
+ outputs: Parameter[];
94
+ complexity: number;
95
+ }
96
+ export interface Parameter {
97
+ name: string;
98
+ type: string;
99
+ required: boolean;
100
+ }
101
+ export interface EventType {
102
+ name: string;
103
+ payload: Record<string, string>;
104
+ }
105
+ export interface GeneratedCode {
106
+ files: CodeFile[];
107
+ language: 'typescript' | 'python' | 'rust';
108
+ framework?: string;
109
+ tests: CodeFile[];
110
+ }
111
+ export interface CodeFile {
112
+ path: string;
113
+ content: string;
114
+ description: string;
115
+ }
116
+ export interface Visual {
117
+ type: 'architecture' | 'concept' | 'flow' | 'logo';
118
+ prompt: string;
119
+ path: string;
120
+ }
121
+ export interface KnowledgeEntity {
122
+ name: string;
123
+ type: string;
124
+ observations: string[];
125
+ }
126
+ export interface KnowledgeRelation {
127
+ from: string;
128
+ to: string;
129
+ relationType: string;
130
+ }
131
+ export type PipelineStage = 'research' | 'design' | 'generate' | 'visualize' | 'persist' | 'publish';
132
+ export interface PipelineResult<T> {
133
+ stage: PipelineStage;
134
+ success: boolean;
135
+ data?: T;
136
+ error?: string;
137
+ duration: number;
138
+ mcpsUsed: MCPServerName[];
139
+ }
140
+ export interface PipelineConfig {
141
+ stages: PipelineStage[];
142
+ parallel: boolean;
143
+ verbose: boolean;
144
+ dryRun: boolean;
145
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Genesis - System Creator Types
4
+ *
5
+ * Core type definitions for MCP orchestration
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,163 @@
1
+ /**
2
+ * Genesis 6.0 - Latent State Decoder
3
+ *
4
+ * Decodes latent states back to interpretable representations.
5
+ *
6
+ * Capabilities:
7
+ * - Decode to text descriptions
8
+ * - Decode to structured state
9
+ * - Decode to feature maps
10
+ * - Interpolate between states
11
+ *
12
+ * The decoder is the inverse of the encoder, allowing the system
13
+ * to generate human-readable outputs from internal representations.
14
+ *
15
+ * Architecture:
16
+ * - Modality-specific decoders
17
+ * - Feature extraction
18
+ * - Narrative generation
19
+ *
20
+ * References:
21
+ * - VAE Decoders (Kingma & Welling, 2014)
22
+ * - VQ-VAE (van den Oord et al., 2017)
23
+ *
24
+ * Usage:
25
+ * ```typescript
26
+ * import { createLatentDecoder } from './world-model/decoder.js';
27
+ *
28
+ * const decoder = createLatentDecoder();
29
+ *
30
+ * // Decode to text
31
+ * const description = decoder.decodeToText(latentState);
32
+ *
33
+ * // Decode to structured state
34
+ * const state = decoder.decodeToState(latentState);
35
+ *
36
+ * // Interpolate between states
37
+ * const interpolated = decoder.interpolate(stateA, stateB, 0.5);
38
+ * ```
39
+ */
40
+ import { Modality, LatentState, LatentFeature } from './types.js';
41
+ export interface DecodedOutput {
42
+ id: string;
43
+ sourceState: string;
44
+ modality: Modality;
45
+ output: unknown;
46
+ confidence: number;
47
+ timestamp: Date;
48
+ }
49
+ export interface TextDecoding extends DecodedOutput {
50
+ modality: 'text';
51
+ output: string;
52
+ keywords: string[];
53
+ sentiment: number;
54
+ }
55
+ export interface StateDecoding extends DecodedOutput {
56
+ modality: 'state';
57
+ output: Record<string, unknown>;
58
+ numericFields: string[];
59
+ categoricalFields: string[];
60
+ }
61
+ export interface FeatureDecoding extends DecodedOutput {
62
+ modality: 'state';
63
+ output: LatentFeature[];
64
+ topActivations: number[];
65
+ }
66
+ export interface DecoderConfig {
67
+ outputDim: number;
68
+ vocabularySize: number;
69
+ maxTextLength: number;
70
+ featureThreshold: number;
71
+ interpolationSteps: number;
72
+ }
73
+ export declare const DEFAULT_DECODER_CONFIG: DecoderConfig;
74
+ export type DecoderEventType = 'decoded_text' | 'decoded_state' | 'decoded_features' | 'interpolated' | 'error';
75
+ export type DecoderEventHandler = (event: {
76
+ type: DecoderEventType;
77
+ data?: unknown;
78
+ }) => void;
79
+ export declare class LatentDecoder {
80
+ private config;
81
+ private eventHandlers;
82
+ private decodingCount;
83
+ private interpolationCount;
84
+ constructor(config?: Partial<DecoderConfig>);
85
+ /**
86
+ * Decode latent state to text description
87
+ */
88
+ decodeToText(state: LatentState): TextDecoding;
89
+ /**
90
+ * Extract keywords from vector
91
+ */
92
+ private vectorToKeywords;
93
+ /**
94
+ * Calculate sentiment from vector
95
+ */
96
+ private calculateSentiment;
97
+ /**
98
+ * Generate natural language description
99
+ */
100
+ private generateDescription;
101
+ /**
102
+ * Decode latent state to structured state
103
+ */
104
+ decodeToState(state: LatentState): StateDecoding;
105
+ /**
106
+ * Convert sigmoid value to range
107
+ */
108
+ private sigmoidToRange;
109
+ /**
110
+ * Decode to feature representation
111
+ */
112
+ decodeToFeatures(state: LatentState): FeatureDecoding;
113
+ /**
114
+ * Group related features
115
+ */
116
+ private groupFeatures;
117
+ /**
118
+ * Interpolate between two latent states
119
+ */
120
+ interpolate(stateA: LatentState, stateB: LatentState, t: number): LatentState;
121
+ /**
122
+ * Generate interpolation sequence
123
+ */
124
+ interpolateSequence(stateA: LatentState, stateB: LatentState, steps?: number): LatentState[];
125
+ /**
126
+ * Spherical interpolation (SLERP) for better interpolation on unit sphere
127
+ */
128
+ slerp(stateA: LatentState, stateB: LatentState, t: number): LatentState;
129
+ /**
130
+ * Get indices of dominant (highest absolute) values
131
+ */
132
+ private getDominantIndices;
133
+ /**
134
+ * Normalize vector
135
+ */
136
+ private normalize;
137
+ /**
138
+ * Compare two latent states
139
+ */
140
+ compare(stateA: LatentState, stateB: LatentState): {
141
+ similarity: number;
142
+ distance: number;
143
+ divergentDimensions: number[];
144
+ commonFeatures: string[];
145
+ };
146
+ /**
147
+ * Analyze latent state structure
148
+ */
149
+ analyze(state: LatentState): {
150
+ sparsity: number;
151
+ dominantRegion: string;
152
+ clusterAssignment: number;
153
+ anomalyScore: number;
154
+ };
155
+ on(handler: DecoderEventHandler): () => void;
156
+ private emit;
157
+ stats(): {
158
+ decodingCount: number;
159
+ interpolationCount: number;
160
+ };
161
+ getConfig(): DecoderConfig;
162
+ }
163
+ export declare function createLatentDecoder(config?: Partial<DecoderConfig>): LatentDecoder;