@trenchwork/erosolar 1.1.41 → 1.1.42

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 (72) hide show
  1. package/LICENSE +16 -21
  2. package/README.md +236 -236
  3. package/agents/erosolar-code.rules.json +199 -199
  4. package/dist/bin/erosolar.js +0 -0
  5. package/dist/capabilities/enhancedGitCapability.js +63 -63
  6. package/dist/config.js +12 -12
  7. package/dist/contracts/models.schema.json +9 -9
  8. package/dist/contracts/module-schema.json +367 -367
  9. package/dist/contracts/schemas/agent-profile.schema.json +157 -157
  10. package/dist/contracts/schemas/agent-rules.schema.json +238 -238
  11. package/dist/contracts/schemas/agent-schemas.schema.json +528 -528
  12. package/dist/contracts/schemas/agent.schema.json +90 -90
  13. package/dist/contracts/schemas/tool-selection.schema.json +174 -174
  14. package/dist/contracts/tools.schema.json +42 -42
  15. package/dist/core/constants.js +7 -7
  16. package/dist/core/contextManager.js +16 -16
  17. package/dist/core/hitl.d.ts.map +1 -1
  18. package/dist/core/hitl.js +17 -16
  19. package/dist/core/hitl.js.map +1 -1
  20. package/dist/core/permissionMode.d.ts +40 -0
  21. package/dist/core/permissionMode.d.ts.map +1 -0
  22. package/dist/core/permissionMode.js +86 -0
  23. package/dist/core/permissionMode.js.map +1 -0
  24. package/dist/core/secretStore.js +1 -1
  25. package/dist/core/taskCompletionDetector.js +17 -17
  26. package/dist/core/toolRuntime.d.ts.map +1 -1
  27. package/dist/core/toolRuntime.js +21 -2
  28. package/dist/core/toolRuntime.js.map +1 -1
  29. package/dist/headless/interactiveShell.d.ts +7 -5
  30. package/dist/headless/interactiveShell.d.ts.map +1 -1
  31. package/dist/headless/interactiveShell.js +92 -159
  32. package/dist/headless/interactiveShell.js.map +1 -1
  33. package/dist/leanAgent.js +38 -38
  34. package/dist/runtime/agentSession.js +4 -4
  35. package/dist/shell/commandRegistry.js +6 -6
  36. package/dist/shell/commandRegistry.js.map +1 -1
  37. package/dist/shell/toolPresentation.d.ts +47 -0
  38. package/dist/shell/toolPresentation.d.ts.map +1 -0
  39. package/dist/shell/toolPresentation.js +260 -0
  40. package/dist/shell/toolPresentation.js.map +1 -0
  41. package/dist/shell/vimMode.js +29 -29
  42. package/dist/tools/bashTools.js +2 -2
  43. package/dist/tools/bashTools.js.map +1 -1
  44. package/dist/tools/hitlTools.js +18 -18
  45. package/dist/tools/webTools.d.ts.map +1 -1
  46. package/dist/tools/webTools.js +75 -3
  47. package/dist/tools/webTools.js.map +1 -1
  48. package/dist/ui/ink/App.d.ts +2 -0
  49. package/dist/ui/ink/App.d.ts.map +1 -1
  50. package/dist/ui/ink/App.js +2 -2
  51. package/dist/ui/ink/App.js.map +1 -1
  52. package/dist/ui/ink/ChatStatic.d.ts +6 -5
  53. package/dist/ui/ink/ChatStatic.d.ts.map +1 -1
  54. package/dist/ui/ink/ChatStatic.js +35 -10
  55. package/dist/ui/ink/ChatStatic.js.map +1 -1
  56. package/dist/ui/ink/InkPromptController.d.ts +11 -0
  57. package/dist/ui/ink/InkPromptController.d.ts.map +1 -1
  58. package/dist/ui/ink/InkPromptController.js +50 -11
  59. package/dist/ui/ink/InkPromptController.js.map +1 -1
  60. package/dist/ui/ink/Prompt.d.ts +2 -0
  61. package/dist/ui/ink/Prompt.d.ts.map +1 -1
  62. package/dist/ui/ink/Prompt.js +8 -2
  63. package/dist/ui/ink/Prompt.js.map +1 -1
  64. package/dist/ui/ink/StatusLine.d.ts +16 -8
  65. package/dist/ui/ink/StatusLine.d.ts.map +1 -1
  66. package/dist/ui/ink/StatusLine.js +45 -4
  67. package/dist/ui/ink/StatusLine.js.map +1 -1
  68. package/dist/ui/theme.d.ts.map +1 -1
  69. package/dist/ui/theme.js +4 -6
  70. package/dist/ui/theme.js.map +1 -1
  71. package/package.json +116 -116
  72. package/scripts/postinstall.cjs +57 -57
@@ -1,367 +1,367 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "AGI CLI Unified Module Schema",
4
- "description": "Defines the modular architecture for both TypeScript and Python implementations",
5
- "version": "1.0.0",
6
- "author": "Bo Shang",
7
- "framework": "agi-cli",
8
-
9
- "modules": {
10
- "core": {
11
- "description": "Core runtime and execution infrastructure",
12
- "required": true,
13
- "submodules": {
14
- "types": {
15
- "description": "Shared type definitions - single source of truth",
16
- "exports": [
17
- "ConversationRole", "ConversationMessage", "ToolCallRequest",
18
- "ProviderToolDefinition", "JSONSchemaObject", "JSONSchemaProperty",
19
- "ProviderResponse", "StreamChunk", "ProviderUsage"
20
- ]
21
- },
22
- "schema": {
23
- "description": "Schema loading and validation",
24
- "exports": [
25
- "loadUnifiedSchema", "validateToolArguments", "getProviderConfig",
26
- "getTaskTypeConfig", "getToolDefinition", "SchemaCache"
27
- ],
28
- "dependencies": ["types"]
29
- },
30
- "errors": {
31
- "description": "Structured error handling with auto-fix capabilities",
32
- "exports": [
33
- "StructuredError", "ErrorSeverity", "ErrorCategory",
34
- "DangerousOperationError", "BlockedOperationError",
35
- "ValidationError", "ResourceLimitError", "ContextOverflowError",
36
- "ErrorSuggestion", "ErrorRecoveryStrategy"
37
- ],
38
- "dependencies": ["types"]
39
- },
40
- "version": {
41
- "description": "Semantic versioning and compatibility checking",
42
- "exports": [
43
- "SemanticVersion", "VersionBump", "VersionConstraint",
44
- "parseVersion", "compareVersions", "satisfiesConstraint",
45
- "VersionManager", "SelfUpgradeManager", "PluginDependencyResolver"
46
- ],
47
- "dependencies": ["types", "errors"]
48
- },
49
- "dynamic_guardrails": {
50
- "description": "Adaptive safety controls that evolve with AI capabilities",
51
- "exports": [
52
- "GuardrailCategory", "GuardrailSeverity", "GuardrailCondition",
53
- "AdaptiveGuardrail", "GuardrailManager", "SafetyContext",
54
- "createGuardrail", "evaluateGuardrail", "updateGuardrail",
55
- "getGuardrailStatus", "resetGuardrail", "exportGuardrails",
56
- "importGuardrails", "mergeGuardrailSets"
57
- ],
58
- "dependencies": ["types", "errors"]
59
- },
60
- "ai_system_updater": {
61
- "description": "Comprehensive AI system update and migration framework",
62
- "exports": [
63
- "UpdateSource", "UpdatePackage", "UpdateStrategy",
64
- "SystemUpdater", "UpdateValidator", "RollbackManager",
65
- "MigrationPlan", "BackupStrategy", "UpdateOrchestrator",
66
- "checkForUpdates", "prepareUpdate", "executeUpdate",
67
- "validateUpdate", "rollbackUpdate", "cleanupUpdate"
68
- ],
69
- "dependencies": ["types", "errors", "version"]
70
- },
71
- "toolRuntime": {
72
- "description": "Tool execution engine with caching and validation",
73
- "exports": [
74
- "ToolRuntime", "ToolRecord", "ToolSuite", "CacheEntry",
75
- "ToolRuntimeObserver", "ToolExecutionResult", "CACHEABLE_TOOLS"
76
- ],
77
- "dependencies": ["types", "schema", "errors"]
78
- },
79
- "provider": {
80
- "description": "LLM provider abstraction layer",
81
- "exports": [
82
- "LLMProvider", "ProviderFactory", "ProviderAdapter",
83
- "UnifiedProviderConfig", "createProvider", "listProviders"
84
- ],
85
- "dependencies": ["types", "schema", "errors"]
86
- },
87
- "context": {
88
- "description": "Token and context management",
89
- "exports": [
90
- "ContextManager", "ContextManagerConfig", "TruncationResult",
91
- "estimateTokens", "truncateToolOutput", "pruneMessages"
92
- ],
93
- "dependencies": ["types"]
94
- },
95
- "agent": {
96
- "description": "Agent runtime and conversation management",
97
- "exports": [
98
- "Agent", "AgentConfig", "AgentRuntime",
99
- "processConversation", "resolveToolCalls"
100
- ],
101
- "dependencies": ["types", "toolRuntime", "provider", "context", "errors"]
102
- }
103
- }
104
- },
105
-
106
- "plugins": {
107
- "description": "Plugin system for extensibility",
108
- "required": true,
109
- "submodules": {
110
- "base": {
111
- "description": "Plugin base class and metadata",
112
- "exports": [
113
- "Plugin", "PluginMetadata", "PluginConfig", "PluginCategory",
114
- "PluginState", "PluginLifecycle"
115
- ],
116
- "dependencies": ["core.types", "core.version"]
117
- },
118
- "registry": {
119
- "description": "Plugin discovery and registration",
120
- "exports": [
121
- "PluginRegistry", "discoverPlugins", "loadPlugin", "unloadPlugin",
122
- "getPluginTools", "validatePluginCompatibility"
123
- ],
124
- "dependencies": ["base", "core.toolRuntime", "core.version"]
125
- },
126
- "loader": {
127
- "description": "Dynamic plugin loading with lazy initialization",
128
- "exports": [
129
- "PluginLoader", "LazyPlugin", "loadPluginModule",
130
- "isPluginEnabled", "getPluginModule"
131
- ],
132
- "dependencies": ["base", "registry"]
133
- }
134
- }
135
- },
136
-
137
- "security": {
138
- "description": "Security research module (optional, lazy loaded)",
139
- "required": false,
140
- "requiresAuth": true,
141
- "submodules": {
142
- "core": {
143
- "description": "Authorization and reconnaissance",
144
- "exports": [
145
- "AuthorizationScope", "AuthorizationRecord", "ReconResult",
146
- "VulnerabilityFinding", "SecurityResearchEngine",
147
- "createBugBountyAuthorization", "createPentestAuthorization"
148
- ]
149
- },
150
-
151
- "google": {
152
- "description": "Google Cloud/Workspace persistence research",
153
- "optional": true,
154
- "exports": [
155
- "GoogleService", "PersistenceCategory", "PersistenceVector",
156
- "GooglePersistenceResearcher", "GCP_PERSISTENCE_VECTORS",
157
- "WORKSPACE_PERSISTENCE_VECTORS"
158
- ],
159
- "dependencies": ["core"]
160
- }
161
- }
162
- },
163
-
164
- "capabilities": {
165
- "description": "Core tool implementations",
166
- "required": true,
167
- "submodules": {
168
- "filesystem": {
169
- "description": "File operations",
170
- "exports": ["readFile", "writeFile", "listDirectory"],
171
- "tools": ["read", "write"]
172
- },
173
- "edit": {
174
- "description": "In-place file editing",
175
- "exports": ["editFile", "applyEdit"],
176
- "tools": ["edit"]
177
- },
178
- "bash": {
179
- "description": "Shell command execution",
180
- "exports": ["executeBash", "runInBackground", "killProcess"],
181
- "tools": ["bash"]
182
- },
183
- "search": {
184
- "description": "Code and file search",
185
- "exports": ["globSearch", "grepSearch"],
186
- "tools": ["glob", "grep"]
187
- },
188
- "web": {
189
- "description": "Web operations",
190
- "exports": ["webSearch", "webFetch"],
191
- "tools": ["web_search", "web_fetch"]
192
- },
193
- "coding": {
194
- "description": "Code analysis and generation",
195
- "exports": [
196
- "analyzeComplexity", "findDependencies", "generateDocstring",
197
- "suggestRefactorings", "generateTestStub"
198
- ],
199
- "tools": ["analyze_complexity", "find_dependencies", "generate_docstring"]
200
- }
201
- }
202
- },
203
-
204
- "ui": {
205
- "description": "User interface components",
206
- "required": false,
207
- "submodules": {
208
- "display": {
209
- "description": "Output formatting and display",
210
- "exports": ["formatOutput", "formatError", "formatToolResult"]
211
- },
212
- "prompt": {
213
- "description": "Interactive prompt handling",
214
- "exports": ["createPrompt", "promptUser"]
215
- },
216
- "theme": {
217
- "description": "Theming and styling",
218
- "exports": ["Theme", "applyTheme", "getColors"]
219
- }
220
- }
221
- }
222
- },
223
-
224
- "interfaces": {
225
- "ToolSuite": {
226
- "description": "Collection of related tools",
227
- "properties": {
228
- "name": { "type": "string", "description": "Suite identifier" },
229
- "version": { "type": "string", "description": "Semantic version" },
230
- "tools": { "type": "array", "items": { "$ref": "#/interfaces/ToolDefinition" } }
231
- }
232
- },
233
- "ToolDefinition": {
234
- "description": "Single tool definition",
235
- "properties": {
236
- "name": { "type": "string" },
237
- "description": { "type": "string" },
238
- "parameters": { "$ref": "#/interfaces/JSONSchemaObject" },
239
- "execute": { "type": "function", "async": true }
240
- }
241
- },
242
- "Plugin": {
243
- "description": "Plugin interface",
244
- "properties": {
245
- "metadata": { "$ref": "#/interfaces/PluginMetadata" },
246
- "initialize": { "type": "function", "async": true },
247
- "getToolSuites": { "type": "function", "returns": "ToolSuite[]" },
248
- "unload": { "type": "function", "async": true }
249
- }
250
- },
251
- "PluginMetadata": {
252
- "description": "Plugin metadata",
253
- "properties": {
254
- "id": { "type": "string" },
255
- "name": { "type": "string" },
256
- "version": { "type": "string" },
257
- "category": { "type": "string", "enum": ["coding", "rl", "security", "dev"] },
258
- "dependencies": { "type": "array", "items": { "type": "string" } },
259
- "minCliVersion": { "type": "string", "optional": true },
260
- "maxCliVersion": { "type": "string", "optional": true }
261
- }
262
- },
263
- "LLMProvider": {
264
- "description": "LLM provider interface",
265
- "properties": {
266
- "id": { "type": "string" },
267
- "model": { "type": "string" },
268
- "generate": { "type": "function", "async": true },
269
- "generateStream": { "type": "function", "async": true, "optional": true }
270
- }
271
- },
272
- "StructuredError": {
273
- "description": "Structured error with recovery capabilities",
274
- "properties": {
275
- "code": { "type": "string" },
276
- "message": { "type": "string" },
277
- "severity": { "type": "string", "enum": ["critical", "error", "warning", "info"] },
278
- "category": { "type": "string" },
279
- "suggestions": { "type": "array", "items": { "$ref": "#/interfaces/ErrorSuggestion" } },
280
- "recoverable": { "type": "boolean" },
281
- "tryAutoFix": { "type": "function", "optional": true }
282
- }
283
- },
284
- "SemanticVersion": {
285
- "description": "Semantic version representation",
286
- "properties": {
287
- "major": { "type": "integer" },
288
- "minor": { "type": "integer" },
289
- "patch": { "type": "integer" },
290
- "prerelease": { "type": "string", "optional": true },
291
- "build": { "type": "string", "optional": true }
292
- }
293
- }
294
- },
295
-
296
- "patterns": {
297
- "lazyLoading": {
298
- "description": "Pattern for lazy loading optional modules",
299
- "example": {
300
- "typescript": "let _module: typeof import('./module') | null = null;\nexport async function getModule() {\n if (!_module) _module = await import('./module');\n return _module;\n}",
301
- "python": "_module = None\ndef get_module():\n global _module\n if _module is None:\n from . import module as _m\n _module = _m\n return _module"
302
- }
303
- },
304
- "observer": {
305
- "description": "Observer pattern for lifecycle events",
306
- "events": ["onStart", "onResult", "onError", "onCacheHit"]
307
- },
308
- "registry": {
309
- "description": "Registry pattern for tool/plugin management",
310
- "operations": ["register", "unregister", "get", "list", "has"]
311
- },
312
- "factory": {
313
- "description": "Factory pattern for creating providers/agents",
314
- "operations": ["create", "configure", "validate"]
315
- }
316
- },
317
-
318
- "fileStructure": {
319
- "typescript": {
320
- "src/": {
321
- "core/": ["types.ts", "schema.ts", "errors.ts", "version.ts", "toolRuntime.ts", "provider.ts", "context.ts", "agent.ts", "index.ts"],
322
- "plugins/": ["base.ts", "registry.ts", "loader.ts", "index.ts"],
323
- "alpha-zero/": ["types.ts", "metrics.ts", "codeEvaluator.ts", "selfModification.ts", "introspection.ts", "competitive.ts", "reward.ts", "index.ts"],
324
- "alpha-zero/security/": ["core.ts", "simulation.ts", "google.ts", "googleLoader.ts", "index.ts"],
325
- "capabilities/": ["filesystem.ts", "edit.ts", "bash.ts", "search.ts", "web.ts", "coding.ts", "index.ts"],
326
- "ui/": ["UnifiedUIRenderer.ts", "PromptController.ts", "outputMode.ts", "theme.ts", "globalWriteLock.ts", "index.ts"],
327
- "contracts/": ["unified-schema.json", "module-schema.json"]
328
- }
329
- },
330
- "python": {
331
- "agi_cli/": {
332
- "core/": ["types.py", "schema.py", "errors.py", "version.py", "tool_runtime.py", "provider.py", "context.py", "agent.py", "__init__.py"],
333
- "plugins/": ["base.py", "registry.py", "loader.py", "__init__.py"],
334
- "alpha_zero/": ["types.py", "metrics.py", "code_evaluator.py", "self_modification.py", "introspection.py", "competitive.py", "reward.py", "__init__.py"],
335
- "alpha_zero/security/": ["core.py", "google.py", "__init__.py"],
336
- "capabilities/": ["filesystem.py", "edit.py", "bash.py", "search.py", "web.py", "coding.py", "__init__.py"],
337
- "ui/": ["unified_ui_renderer.py", "prompt_controller.py", "output_mode.py", "theme.py", "__init__.py"]
338
- }
339
- }
340
- },
341
-
342
- "conventions": {
343
- "naming": {
344
- "typescript": {
345
- "files": "camelCase.ts",
346
- "classes": "PascalCase",
347
- "functions": "camelCase",
348
- "constants": "SCREAMING_SNAKE_CASE",
349
- "interfaces": "PascalCase (no I prefix)"
350
- },
351
- "python": {
352
- "files": "snake_case.py",
353
- "classes": "PascalCase",
354
- "functions": "snake_case",
355
- "constants": "SCREAMING_SNAKE_CASE"
356
- }
357
- },
358
- "exports": {
359
- "typescript": "Named exports preferred, barrel files (index.ts) for modules",
360
- "python": "__all__ in __init__.py, explicit imports"
361
- },
362
- "async": {
363
- "typescript": "async/await with Promise<T>",
364
- "python": "async/await with Optional sync wrappers"
365
- }
366
- }
367
- }
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "AGI CLI Unified Module Schema",
4
+ "description": "Defines the modular architecture for both TypeScript and Python implementations",
5
+ "version": "1.0.0",
6
+ "author": "Bo Shang",
7
+ "framework": "agi-cli",
8
+
9
+ "modules": {
10
+ "core": {
11
+ "description": "Core runtime and execution infrastructure",
12
+ "required": true,
13
+ "submodules": {
14
+ "types": {
15
+ "description": "Shared type definitions - single source of truth",
16
+ "exports": [
17
+ "ConversationRole", "ConversationMessage", "ToolCallRequest",
18
+ "ProviderToolDefinition", "JSONSchemaObject", "JSONSchemaProperty",
19
+ "ProviderResponse", "StreamChunk", "ProviderUsage"
20
+ ]
21
+ },
22
+ "schema": {
23
+ "description": "Schema loading and validation",
24
+ "exports": [
25
+ "loadUnifiedSchema", "validateToolArguments", "getProviderConfig",
26
+ "getTaskTypeConfig", "getToolDefinition", "SchemaCache"
27
+ ],
28
+ "dependencies": ["types"]
29
+ },
30
+ "errors": {
31
+ "description": "Structured error handling with auto-fix capabilities",
32
+ "exports": [
33
+ "StructuredError", "ErrorSeverity", "ErrorCategory",
34
+ "DangerousOperationError", "BlockedOperationError",
35
+ "ValidationError", "ResourceLimitError", "ContextOverflowError",
36
+ "ErrorSuggestion", "ErrorRecoveryStrategy"
37
+ ],
38
+ "dependencies": ["types"]
39
+ },
40
+ "version": {
41
+ "description": "Semantic versioning and compatibility checking",
42
+ "exports": [
43
+ "SemanticVersion", "VersionBump", "VersionConstraint",
44
+ "parseVersion", "compareVersions", "satisfiesConstraint",
45
+ "VersionManager", "SelfUpgradeManager", "PluginDependencyResolver"
46
+ ],
47
+ "dependencies": ["types", "errors"]
48
+ },
49
+ "dynamic_guardrails": {
50
+ "description": "Adaptive safety controls that evolve with AI capabilities",
51
+ "exports": [
52
+ "GuardrailCategory", "GuardrailSeverity", "GuardrailCondition",
53
+ "AdaptiveGuardrail", "GuardrailManager", "SafetyContext",
54
+ "createGuardrail", "evaluateGuardrail", "updateGuardrail",
55
+ "getGuardrailStatus", "resetGuardrail", "exportGuardrails",
56
+ "importGuardrails", "mergeGuardrailSets"
57
+ ],
58
+ "dependencies": ["types", "errors"]
59
+ },
60
+ "ai_system_updater": {
61
+ "description": "Comprehensive AI system update and migration framework",
62
+ "exports": [
63
+ "UpdateSource", "UpdatePackage", "UpdateStrategy",
64
+ "SystemUpdater", "UpdateValidator", "RollbackManager",
65
+ "MigrationPlan", "BackupStrategy", "UpdateOrchestrator",
66
+ "checkForUpdates", "prepareUpdate", "executeUpdate",
67
+ "validateUpdate", "rollbackUpdate", "cleanupUpdate"
68
+ ],
69
+ "dependencies": ["types", "errors", "version"]
70
+ },
71
+ "toolRuntime": {
72
+ "description": "Tool execution engine with caching and validation",
73
+ "exports": [
74
+ "ToolRuntime", "ToolRecord", "ToolSuite", "CacheEntry",
75
+ "ToolRuntimeObserver", "ToolExecutionResult", "CACHEABLE_TOOLS"
76
+ ],
77
+ "dependencies": ["types", "schema", "errors"]
78
+ },
79
+ "provider": {
80
+ "description": "LLM provider abstraction layer",
81
+ "exports": [
82
+ "LLMProvider", "ProviderFactory", "ProviderAdapter",
83
+ "UnifiedProviderConfig", "createProvider", "listProviders"
84
+ ],
85
+ "dependencies": ["types", "schema", "errors"]
86
+ },
87
+ "context": {
88
+ "description": "Token and context management",
89
+ "exports": [
90
+ "ContextManager", "ContextManagerConfig", "TruncationResult",
91
+ "estimateTokens", "truncateToolOutput", "pruneMessages"
92
+ ],
93
+ "dependencies": ["types"]
94
+ },
95
+ "agent": {
96
+ "description": "Agent runtime and conversation management",
97
+ "exports": [
98
+ "Agent", "AgentConfig", "AgentRuntime",
99
+ "processConversation", "resolveToolCalls"
100
+ ],
101
+ "dependencies": ["types", "toolRuntime", "provider", "context", "errors"]
102
+ }
103
+ }
104
+ },
105
+
106
+ "plugins": {
107
+ "description": "Plugin system for extensibility",
108
+ "required": true,
109
+ "submodules": {
110
+ "base": {
111
+ "description": "Plugin base class and metadata",
112
+ "exports": [
113
+ "Plugin", "PluginMetadata", "PluginConfig", "PluginCategory",
114
+ "PluginState", "PluginLifecycle"
115
+ ],
116
+ "dependencies": ["core.types", "core.version"]
117
+ },
118
+ "registry": {
119
+ "description": "Plugin discovery and registration",
120
+ "exports": [
121
+ "PluginRegistry", "discoverPlugins", "loadPlugin", "unloadPlugin",
122
+ "getPluginTools", "validatePluginCompatibility"
123
+ ],
124
+ "dependencies": ["base", "core.toolRuntime", "core.version"]
125
+ },
126
+ "loader": {
127
+ "description": "Dynamic plugin loading with lazy initialization",
128
+ "exports": [
129
+ "PluginLoader", "LazyPlugin", "loadPluginModule",
130
+ "isPluginEnabled", "getPluginModule"
131
+ ],
132
+ "dependencies": ["base", "registry"]
133
+ }
134
+ }
135
+ },
136
+
137
+ "security": {
138
+ "description": "Security research module (optional, lazy loaded)",
139
+ "required": false,
140
+ "requiresAuth": true,
141
+ "submodules": {
142
+ "core": {
143
+ "description": "Authorization and reconnaissance",
144
+ "exports": [
145
+ "AuthorizationScope", "AuthorizationRecord", "ReconResult",
146
+ "VulnerabilityFinding", "SecurityResearchEngine",
147
+ "createBugBountyAuthorization", "createPentestAuthorization"
148
+ ]
149
+ },
150
+
151
+ "google": {
152
+ "description": "Google Cloud/Workspace persistence research",
153
+ "optional": true,
154
+ "exports": [
155
+ "GoogleService", "PersistenceCategory", "PersistenceVector",
156
+ "GooglePersistenceResearcher", "GCP_PERSISTENCE_VECTORS",
157
+ "WORKSPACE_PERSISTENCE_VECTORS"
158
+ ],
159
+ "dependencies": ["core"]
160
+ }
161
+ }
162
+ },
163
+
164
+ "capabilities": {
165
+ "description": "Core tool implementations",
166
+ "required": true,
167
+ "submodules": {
168
+ "filesystem": {
169
+ "description": "File operations",
170
+ "exports": ["readFile", "writeFile", "listDirectory"],
171
+ "tools": ["read", "write"]
172
+ },
173
+ "edit": {
174
+ "description": "In-place file editing",
175
+ "exports": ["editFile", "applyEdit"],
176
+ "tools": ["edit"]
177
+ },
178
+ "bash": {
179
+ "description": "Shell command execution",
180
+ "exports": ["executeBash", "runInBackground", "killProcess"],
181
+ "tools": ["bash"]
182
+ },
183
+ "search": {
184
+ "description": "Code and file search",
185
+ "exports": ["globSearch", "grepSearch"],
186
+ "tools": ["glob", "grep"]
187
+ },
188
+ "web": {
189
+ "description": "Web operations",
190
+ "exports": ["webSearch", "webFetch"],
191
+ "tools": ["web_search", "web_fetch"]
192
+ },
193
+ "coding": {
194
+ "description": "Code analysis and generation",
195
+ "exports": [
196
+ "analyzeComplexity", "findDependencies", "generateDocstring",
197
+ "suggestRefactorings", "generateTestStub"
198
+ ],
199
+ "tools": ["analyze_complexity", "find_dependencies", "generate_docstring"]
200
+ }
201
+ }
202
+ },
203
+
204
+ "ui": {
205
+ "description": "User interface components",
206
+ "required": false,
207
+ "submodules": {
208
+ "display": {
209
+ "description": "Output formatting and display",
210
+ "exports": ["formatOutput", "formatError", "formatToolResult"]
211
+ },
212
+ "prompt": {
213
+ "description": "Interactive prompt handling",
214
+ "exports": ["createPrompt", "promptUser"]
215
+ },
216
+ "theme": {
217
+ "description": "Theming and styling",
218
+ "exports": ["Theme", "applyTheme", "getColors"]
219
+ }
220
+ }
221
+ }
222
+ },
223
+
224
+ "interfaces": {
225
+ "ToolSuite": {
226
+ "description": "Collection of related tools",
227
+ "properties": {
228
+ "name": { "type": "string", "description": "Suite identifier" },
229
+ "version": { "type": "string", "description": "Semantic version" },
230
+ "tools": { "type": "array", "items": { "$ref": "#/interfaces/ToolDefinition" } }
231
+ }
232
+ },
233
+ "ToolDefinition": {
234
+ "description": "Single tool definition",
235
+ "properties": {
236
+ "name": { "type": "string" },
237
+ "description": { "type": "string" },
238
+ "parameters": { "$ref": "#/interfaces/JSONSchemaObject" },
239
+ "execute": { "type": "function", "async": true }
240
+ }
241
+ },
242
+ "Plugin": {
243
+ "description": "Plugin interface",
244
+ "properties": {
245
+ "metadata": { "$ref": "#/interfaces/PluginMetadata" },
246
+ "initialize": { "type": "function", "async": true },
247
+ "getToolSuites": { "type": "function", "returns": "ToolSuite[]" },
248
+ "unload": { "type": "function", "async": true }
249
+ }
250
+ },
251
+ "PluginMetadata": {
252
+ "description": "Plugin metadata",
253
+ "properties": {
254
+ "id": { "type": "string" },
255
+ "name": { "type": "string" },
256
+ "version": { "type": "string" },
257
+ "category": { "type": "string", "enum": ["coding", "rl", "security", "dev"] },
258
+ "dependencies": { "type": "array", "items": { "type": "string" } },
259
+ "minCliVersion": { "type": "string", "optional": true },
260
+ "maxCliVersion": { "type": "string", "optional": true }
261
+ }
262
+ },
263
+ "LLMProvider": {
264
+ "description": "LLM provider interface",
265
+ "properties": {
266
+ "id": { "type": "string" },
267
+ "model": { "type": "string" },
268
+ "generate": { "type": "function", "async": true },
269
+ "generateStream": { "type": "function", "async": true, "optional": true }
270
+ }
271
+ },
272
+ "StructuredError": {
273
+ "description": "Structured error with recovery capabilities",
274
+ "properties": {
275
+ "code": { "type": "string" },
276
+ "message": { "type": "string" },
277
+ "severity": { "type": "string", "enum": ["critical", "error", "warning", "info"] },
278
+ "category": { "type": "string" },
279
+ "suggestions": { "type": "array", "items": { "$ref": "#/interfaces/ErrorSuggestion" } },
280
+ "recoverable": { "type": "boolean" },
281
+ "tryAutoFix": { "type": "function", "optional": true }
282
+ }
283
+ },
284
+ "SemanticVersion": {
285
+ "description": "Semantic version representation",
286
+ "properties": {
287
+ "major": { "type": "integer" },
288
+ "minor": { "type": "integer" },
289
+ "patch": { "type": "integer" },
290
+ "prerelease": { "type": "string", "optional": true },
291
+ "build": { "type": "string", "optional": true }
292
+ }
293
+ }
294
+ },
295
+
296
+ "patterns": {
297
+ "lazyLoading": {
298
+ "description": "Pattern for lazy loading optional modules",
299
+ "example": {
300
+ "typescript": "let _module: typeof import('./module') | null = null;\nexport async function getModule() {\n if (!_module) _module = await import('./module');\n return _module;\n}",
301
+ "python": "_module = None\ndef get_module():\n global _module\n if _module is None:\n from . import module as _m\n _module = _m\n return _module"
302
+ }
303
+ },
304
+ "observer": {
305
+ "description": "Observer pattern for lifecycle events",
306
+ "events": ["onStart", "onResult", "onError", "onCacheHit"]
307
+ },
308
+ "registry": {
309
+ "description": "Registry pattern for tool/plugin management",
310
+ "operations": ["register", "unregister", "get", "list", "has"]
311
+ },
312
+ "factory": {
313
+ "description": "Factory pattern for creating providers/agents",
314
+ "operations": ["create", "configure", "validate"]
315
+ }
316
+ },
317
+
318
+ "fileStructure": {
319
+ "typescript": {
320
+ "src/": {
321
+ "core/": ["types.ts", "schema.ts", "errors.ts", "version.ts", "toolRuntime.ts", "provider.ts", "context.ts", "agent.ts", "index.ts"],
322
+ "plugins/": ["base.ts", "registry.ts", "loader.ts", "index.ts"],
323
+ "alpha-zero/": ["types.ts", "metrics.ts", "codeEvaluator.ts", "selfModification.ts", "introspection.ts", "competitive.ts", "reward.ts", "index.ts"],
324
+ "alpha-zero/security/": ["core.ts", "simulation.ts", "google.ts", "googleLoader.ts", "index.ts"],
325
+ "capabilities/": ["filesystem.ts", "edit.ts", "bash.ts", "search.ts", "web.ts", "coding.ts", "index.ts"],
326
+ "ui/": ["UnifiedUIRenderer.ts", "PromptController.ts", "outputMode.ts", "theme.ts", "globalWriteLock.ts", "index.ts"],
327
+ "contracts/": ["unified-schema.json", "module-schema.json"]
328
+ }
329
+ },
330
+ "python": {
331
+ "agi_cli/": {
332
+ "core/": ["types.py", "schema.py", "errors.py", "version.py", "tool_runtime.py", "provider.py", "context.py", "agent.py", "__init__.py"],
333
+ "plugins/": ["base.py", "registry.py", "loader.py", "__init__.py"],
334
+ "alpha_zero/": ["types.py", "metrics.py", "code_evaluator.py", "self_modification.py", "introspection.py", "competitive.py", "reward.py", "__init__.py"],
335
+ "alpha_zero/security/": ["core.py", "google.py", "__init__.py"],
336
+ "capabilities/": ["filesystem.py", "edit.py", "bash.py", "search.py", "web.py", "coding.py", "__init__.py"],
337
+ "ui/": ["unified_ui_renderer.py", "prompt_controller.py", "output_mode.py", "theme.py", "__init__.py"]
338
+ }
339
+ }
340
+ },
341
+
342
+ "conventions": {
343
+ "naming": {
344
+ "typescript": {
345
+ "files": "camelCase.ts",
346
+ "classes": "PascalCase",
347
+ "functions": "camelCase",
348
+ "constants": "SCREAMING_SNAKE_CASE",
349
+ "interfaces": "PascalCase (no I prefix)"
350
+ },
351
+ "python": {
352
+ "files": "snake_case.py",
353
+ "classes": "PascalCase",
354
+ "functions": "snake_case",
355
+ "constants": "SCREAMING_SNAKE_CASE"
356
+ }
357
+ },
358
+ "exports": {
359
+ "typescript": "Named exports preferred, barrel files (index.ts) for modules",
360
+ "python": "__all__ in __init__.py, explicit imports"
361
+ },
362
+ "async": {
363
+ "typescript": "async/await with Promise<T>",
364
+ "python": "async/await with Optional sync wrappers"
365
+ }
366
+ }
367
+ }