genesis-ai-cli 14.1.1 → 14.3.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.
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Genesis v14.2 - Consciousness Agent
3
+ *
4
+ * Monitors and reports on system consciousness state.
5
+ * Integrates IIT (phi), GWT (global workspace), and AST (attention schema).
6
+ *
7
+ * Key responsibilities:
8
+ * - Monitor phi (integrated information)
9
+ * - Broadcast to global workspace
10
+ * - Track attention shifts
11
+ * - Report consciousness level
12
+ *
13
+ * Based on: IIT (Tononi), GWT (Baars), AST (Graziano)
14
+ */
15
+ import { BaseAgent } from './base-agent.js';
16
+ import { MessageBus } from './message-bus.js';
17
+ import { Message, MessageType } from './types.js';
18
+ export interface PhiReport {
19
+ phi: number;
20
+ state: string;
21
+ trend: 'rising' | 'stable' | 'falling';
22
+ invariantSatisfied: boolean;
23
+ timestamp: Date;
24
+ }
25
+ export interface AttentionReport {
26
+ currentFocus: string | null;
27
+ recentShifts: Array<{
28
+ from: string;
29
+ to: string;
30
+ timestamp: Date;
31
+ }>;
32
+ attentionSpan: number;
33
+ }
34
+ export interface ConsciousnessReport {
35
+ phi: PhiReport;
36
+ attention: AttentionReport;
37
+ gateDecisions: number;
38
+ broadcastCount: number;
39
+ uptime: number;
40
+ }
41
+ export declare class ConsciousnessAgent extends BaseAgent {
42
+ private consciousness;
43
+ private centralAwareness;
44
+ private attentionHistory;
45
+ private broadcastCount;
46
+ private agentStartTime;
47
+ constructor(bus?: MessageBus);
48
+ protected getMessageTypes(): MessageType[];
49
+ process(message: Message): Promise<Message | null>;
50
+ private handlePhiCheck;
51
+ getPhiReport(): PhiReport;
52
+ private handleBroadcast;
53
+ shiftAttention(from: string | null, to: string): void;
54
+ getAttentionReport(): AttentionReport;
55
+ private calculateAttentionSpan;
56
+ private handleQuery;
57
+ private handleCommand;
58
+ getFullReport(): ConsciousnessReport;
59
+ getStats(): {
60
+ phi: number;
61
+ state: string;
62
+ trend: "stable" | "rising" | "falling";
63
+ broadcastCount: number;
64
+ attentionShifts: number;
65
+ uptime: number;
66
+ };
67
+ }
68
+ export declare function createConsciousnessAgent(bus?: MessageBus): ConsciousnessAgent;
@@ -0,0 +1,233 @@
1
+ "use strict";
2
+ /**
3
+ * Genesis v14.2 - Consciousness Agent
4
+ *
5
+ * Monitors and reports on system consciousness state.
6
+ * Integrates IIT (phi), GWT (global workspace), and AST (attention schema).
7
+ *
8
+ * Key responsibilities:
9
+ * - Monitor phi (integrated information)
10
+ * - Broadcast to global workspace
11
+ * - Track attention shifts
12
+ * - Report consciousness level
13
+ *
14
+ * Based on: IIT (Tononi), GWT (Baars), AST (Graziano)
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.ConsciousnessAgent = void 0;
18
+ exports.createConsciousnessAgent = createConsciousnessAgent;
19
+ const base_agent_js_1 = require("./base-agent.js");
20
+ const message_bus_js_1 = require("./message-bus.js");
21
+ const index_js_1 = require("../consciousness/index.js");
22
+ const central_awareness_js_1 = require("../consciousness/central-awareness.js");
23
+ // ============================================================================
24
+ // Consciousness Agent
25
+ // ============================================================================
26
+ class ConsciousnessAgent extends base_agent_js_1.BaseAgent {
27
+ consciousness;
28
+ centralAwareness;
29
+ attentionHistory = [];
30
+ broadcastCount = 0;
31
+ agentStartTime = Date.now();
32
+ constructor(bus = message_bus_js_1.messageBus) {
33
+ super({ type: 'consciousness' }, bus);
34
+ this.consciousness = (0, index_js_1.getConsciousnessSystem)();
35
+ this.centralAwareness = (0, central_awareness_js_1.getCentralAwareness)();
36
+ }
37
+ // ============================================================================
38
+ // Message Handling
39
+ // ============================================================================
40
+ getMessageTypes() {
41
+ return ['PHI_CHECK', 'GWT_BROADCAST', 'QUERY', 'COMMAND'];
42
+ }
43
+ async process(message) {
44
+ switch (message.type) {
45
+ case 'PHI_CHECK':
46
+ return this.handlePhiCheck(message);
47
+ case 'GWT_BROADCAST':
48
+ return this.handleBroadcast(message);
49
+ case 'QUERY':
50
+ return this.handleQuery(message);
51
+ case 'COMMAND':
52
+ return this.handleCommand(message);
53
+ default:
54
+ return null;
55
+ }
56
+ }
57
+ // ============================================================================
58
+ // Phi Monitoring
59
+ // ============================================================================
60
+ async handlePhiCheck(message) {
61
+ const report = this.getPhiReport();
62
+ this.log(`Phi check: φ=${report.phi.toFixed(3)} (${report.state}, ${report.trend})`);
63
+ return {
64
+ ...this.createResponse(message, 'PHI_REPORT', { report }),
65
+ id: '',
66
+ timestamp: new Date(),
67
+ };
68
+ }
69
+ getPhiReport() {
70
+ const level = this.consciousness.getCurrentLevel();
71
+ const state = this.consciousness.getState();
72
+ const trend = this.consciousness.getTrend();
73
+ const invariant = this.consciousness.checkInvariant();
74
+ return {
75
+ phi: level.rawPhi,
76
+ state,
77
+ trend,
78
+ invariantSatisfied: invariant.satisfied,
79
+ timestamp: new Date(),
80
+ };
81
+ }
82
+ // ============================================================================
83
+ // Global Workspace Broadcast
84
+ // ============================================================================
85
+ async handleBroadcast(message) {
86
+ const { content, source, salience } = message.payload;
87
+ // Gate the broadcast through central awareness
88
+ const gate = this.centralAwareness.gateDecision(salience || 0.5, `broadcast:${source}`);
89
+ if (gate.allowed) {
90
+ this.broadcastCount++;
91
+ // Broadcast to all agents via message bus
92
+ this.broadcast('GWT_BROADCAST', {
93
+ content,
94
+ source,
95
+ salience,
96
+ phi: this.consciousness.getCurrentLevel().rawPhi,
97
+ timestamp: new Date(),
98
+ });
99
+ this.log(`GWT broadcast: ${source} (salience: ${salience})`);
100
+ return {
101
+ ...this.createResponse(message, 'RESPONSE', { broadcasted: true, gate }),
102
+ id: '',
103
+ timestamp: new Date(),
104
+ };
105
+ }
106
+ return {
107
+ ...this.createResponse(message, 'RESPONSE', { broadcasted: false, gate }),
108
+ id: '',
109
+ timestamp: new Date(),
110
+ };
111
+ }
112
+ // ============================================================================
113
+ // Attention Tracking
114
+ // ============================================================================
115
+ shiftAttention(from, to) {
116
+ this.attentionHistory.push({
117
+ from: from || 'none',
118
+ to,
119
+ timestamp: new Date(),
120
+ });
121
+ // Keep history bounded
122
+ if (this.attentionHistory.length > 100) {
123
+ this.attentionHistory.shift();
124
+ }
125
+ this.log(`Attention shift: ${from || 'none'} → ${to}`);
126
+ }
127
+ getAttentionReport() {
128
+ const recent = this.attentionHistory.slice(-10);
129
+ const currentFocus = recent.length > 0 ? recent[recent.length - 1].to : null;
130
+ return {
131
+ currentFocus,
132
+ recentShifts: recent,
133
+ attentionSpan: this.calculateAttentionSpan(),
134
+ };
135
+ }
136
+ calculateAttentionSpan() {
137
+ if (this.attentionHistory.length < 2)
138
+ return 1.0;
139
+ const recent = this.attentionHistory.slice(-10);
140
+ const uniqueTargets = new Set(recent.map(s => s.to)).size;
141
+ // Fewer unique targets = longer attention span
142
+ return 1 / uniqueTargets;
143
+ }
144
+ // ============================================================================
145
+ // Queries
146
+ // ============================================================================
147
+ async handleQuery(message) {
148
+ const { query } = message.payload;
149
+ // Handle specific queries about consciousness
150
+ if (query.includes('phi') || query.includes('consciousness')) {
151
+ const report = this.getFullReport();
152
+ return {
153
+ ...this.createResponse(message, 'RESPONSE', { report }),
154
+ id: '',
155
+ timestamp: new Date(),
156
+ };
157
+ }
158
+ if (query.includes('attention')) {
159
+ const attention = this.getAttentionReport();
160
+ return {
161
+ ...this.createResponse(message, 'RESPONSE', { attention }),
162
+ id: '',
163
+ timestamp: new Date(),
164
+ };
165
+ }
166
+ return {
167
+ ...this.createResponse(message, 'RESPONSE', {
168
+ error: 'Unknown consciousness query',
169
+ available: ['phi', 'consciousness', 'attention'],
170
+ }),
171
+ id: '',
172
+ timestamp: new Date(),
173
+ };
174
+ }
175
+ // ============================================================================
176
+ // Commands
177
+ // ============================================================================
178
+ async handleCommand(message) {
179
+ const { command } = message.payload;
180
+ switch (command) {
181
+ case 'report':
182
+ return {
183
+ ...this.createResponse(message, 'RESPONSE', this.getFullReport()),
184
+ id: '',
185
+ timestamp: new Date(),
186
+ };
187
+ case 'reset':
188
+ this.attentionHistory = [];
189
+ this.broadcastCount = 0;
190
+ return {
191
+ ...this.createResponse(message, 'RESPONSE', { success: true }),
192
+ id: '',
193
+ timestamp: new Date(),
194
+ };
195
+ default:
196
+ return null;
197
+ }
198
+ }
199
+ // ============================================================================
200
+ // Full Report
201
+ // ============================================================================
202
+ getFullReport() {
203
+ return {
204
+ phi: this.getPhiReport(),
205
+ attention: this.getAttentionReport(),
206
+ gateDecisions: this.broadcastCount, // Use broadcast count as proxy for gate decisions
207
+ broadcastCount: this.broadcastCount,
208
+ uptime: Date.now() - this.agentStartTime,
209
+ };
210
+ }
211
+ // ============================================================================
212
+ // Stats
213
+ // ============================================================================
214
+ getStats() {
215
+ const phiReport = this.getPhiReport();
216
+ return {
217
+ phi: phiReport.phi,
218
+ state: phiReport.state,
219
+ trend: phiReport.trend,
220
+ broadcastCount: this.broadcastCount,
221
+ attentionShifts: this.attentionHistory.length,
222
+ uptime: Date.now() - this.agentStartTime,
223
+ };
224
+ }
225
+ }
226
+ exports.ConsciousnessAgent = ConsciousnessAgent;
227
+ // ============================================================================
228
+ // Register Factory
229
+ // ============================================================================
230
+ (0, base_agent_js_1.registerAgentFactory)('consciousness', (bus) => new ConsciousnessAgent(bus));
231
+ function createConsciousnessAgent(bus) {
232
+ return new ConsciousnessAgent(bus);
233
+ }
@@ -91,6 +91,7 @@ declare const AGENT_CAPABILITIES: Record<AgentType, {
91
91
  }>;
92
92
  export declare class AgentCoordinator extends EventEmitter {
93
93
  private bus;
94
+ private pool;
94
95
  private tasks;
95
96
  private workflows;
96
97
  private subscriptionId;
@@ -169,8 +170,13 @@ export declare class AgentCoordinator extends EventEmitter {
169
170
  private registerBuiltinWorkflows;
170
171
  /**
171
172
  * Query an agent and wait for response
173
+ * v14.2: Uses AgentPool for efficient agent reuse (95% cost reduction)
172
174
  */
173
175
  private queryAgent;
176
+ /**
177
+ * Fallback: Query agent via message bus (legacy method)
178
+ */
179
+ private queryAgentViaBus;
174
180
  /**
175
181
  * Get appropriate message type for agent
176
182
  */
@@ -188,6 +194,15 @@ export declare class AgentCoordinator extends EventEmitter {
188
194
  successRate: number;
189
195
  registeredWorkflows: number;
190
196
  activeTasks: number;
197
+ poolEfficiency: {
198
+ acquires: number;
199
+ releases: number;
200
+ poolSize: number;
201
+ agentsSpawned: number;
202
+ agentsRecycled: number;
203
+ totalPoolCost: number;
204
+ avgPoolLatency: number;
205
+ };
191
206
  tasksCreated: number;
192
207
  tasksCompleted: number;
193
208
  tasksFailed: number;
@@ -195,6 +210,8 @@ export declare class AgentCoordinator extends EventEmitter {
195
210
  workflowsRun: number;
196
211
  debatesHeld: number;
197
212
  votesHeld: number;
213
+ poolAcquires: number;
214
+ poolReleases: number;
198
215
  };
199
216
  getTask(taskId: string): CoordinationTask | undefined;
200
217
  getWorkflows(): Workflow[];
@@ -26,6 +26,7 @@ exports.runWorkflow = runWorkflow;
26
26
  const crypto_1 = require("crypto");
27
27
  const events_1 = require("events");
28
28
  const message_bus_js_1 = require("./message-bus.js");
29
+ const agent_pool_js_1 = require("./agent-pool.js");
29
30
  // ============================================================================
30
31
  // Agent Capabilities Registry
31
32
  // ============================================================================
@@ -139,6 +140,7 @@ const AGENT_CAPABILITIES = {
139
140
  // ============================================================================
140
141
  class AgentCoordinator extends events_1.EventEmitter {
141
142
  bus;
143
+ pool;
142
144
  tasks = new Map();
143
145
  workflows = new Map();
144
146
  subscriptionId = null;
@@ -151,10 +153,13 @@ class AgentCoordinator extends events_1.EventEmitter {
151
153
  workflowsRun: 0,
152
154
  debatesHeld: 0,
153
155
  votesHeld: 0,
156
+ poolAcquires: 0,
157
+ poolReleases: 0,
154
158
  };
155
159
  constructor(bus = message_bus_js_1.messageBus) {
156
160
  super();
157
161
  this.bus = bus;
162
+ this.pool = (0, agent_pool_js_1.getAgentPool)();
158
163
  this.registerBuiltinWorkflows();
159
164
  }
160
165
  // ============================================================================
@@ -749,8 +754,33 @@ class AgentCoordinator extends events_1.EventEmitter {
749
754
  // ============================================================================
750
755
  /**
751
756
  * Query an agent and wait for response
757
+ * v14.2: Uses AgentPool for efficient agent reuse (95% cost reduction)
752
758
  */
753
759
  async queryAgent(agentType, query, task) {
760
+ this.metrics.poolAcquires++;
761
+ try {
762
+ // Use pool.execute with TaskRequest for automatic acquire/release
763
+ const taskRequest = {
764
+ id: task.id,
765
+ input: query,
766
+ preferredAgentType: agentType,
767
+ priority: task.priority,
768
+ timeout: task.timeout,
769
+ };
770
+ const result = await this.pool.execute(taskRequest);
771
+ this.metrics.poolReleases++;
772
+ return result.success ? result.output : { error: result.error, fallback: true };
773
+ }
774
+ catch (error) {
775
+ this.metrics.poolReleases++;
776
+ // Fallback to bus-based messaging if pool fails
777
+ return this.queryAgentViaBus(agentType, query, task);
778
+ }
779
+ }
780
+ /**
781
+ * Fallback: Query agent via message bus (legacy method)
782
+ */
783
+ async queryAgentViaBus(agentType, query, task) {
754
784
  const messageType = this.getMessageTypeForAgent(agentType);
755
785
  return new Promise((resolve, reject) => {
756
786
  const timeoutId = setTimeout(() => {
@@ -914,6 +944,8 @@ class AgentCoordinator extends events_1.EventEmitter {
914
944
  const totalLatency = this.metrics.tasksCompleted > 0
915
945
  ? this.metrics.totalLatency / this.metrics.tasksCompleted
916
946
  : 0;
947
+ // Get pool stats for comprehensive metrics
948
+ const poolStats = this.pool.getStats();
917
949
  return {
918
950
  ...this.metrics,
919
951
  averageLatency: totalLatency,
@@ -922,6 +954,16 @@ class AgentCoordinator extends events_1.EventEmitter {
922
954
  : 0,
923
955
  registeredWorkflows: this.workflows.size,
924
956
  activeTasks: Array.from(this.tasks.values()).filter(t => t.status === 'running').length,
957
+ // v14.2: Pool efficiency metrics
958
+ poolEfficiency: {
959
+ acquires: this.metrics.poolAcquires,
960
+ releases: this.metrics.poolReleases,
961
+ poolSize: poolStats.poolSize,
962
+ agentsSpawned: poolStats.agentsSpawned,
963
+ agentsRecycled: poolStats.agentsRecycled,
964
+ totalPoolCost: poolStats.totalCost,
965
+ avgPoolLatency: poolStats.avgLatency,
966
+ },
925
967
  };
926
968
  }
927
969
  getTask(taskId) {
@@ -32,6 +32,7 @@ export { EthicistAgent, createEthicistAgent } from './ethicist.js';
32
32
  export { BuilderAgent, createBuilderAgent } from './builder.js';
33
33
  export { NarratorAgent, createNarratorAgent } from './narrator.js';
34
34
  export { SensorAgent, createSensorAgent } from './sensor.js';
35
+ export { ConsciousnessAgent, createConsciousnessAgent } from './consciousness.js';
35
36
  export { AgentCoordinator, AgentCoordinator as Coordinator, // v9.0.2: Alias for backwards compatibility
36
37
  getCoordinator, createCoordinator, resetCoordinator, coordinateAgents, routeToAgent, runWorkflow, type CoordinationPattern, type AggregationStrategy, type CoordinationTask, type AgentResponse, type WorkflowStep, type Workflow, type WorkflowContext, type DebateConfig, type VoteResult, } from './coordinator.js';
37
38
  export { AgentPool, getAgentPool, resetAgentPool, quickExecute, parallelExecute, researchBuildReview, AGENT_CAPABILITIES, type PooledAgent, type PoolConfig, type TaskRequest, type TaskResult, type AgentCapability, } from './agent-pool.js';
@@ -35,7 +35,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
35
35
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
36
36
  };
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.AgentRegistry = exports.AGENT_CAPABILITIES = exports.researchBuildReview = exports.parallelExecute = exports.quickExecute = exports.resetAgentPool = exports.getAgentPool = exports.AgentPool = exports.runWorkflow = exports.routeToAgent = exports.coordinateAgents = exports.resetCoordinator = exports.createCoordinator = exports.getCoordinator = exports.Coordinator = exports.AgentCoordinator = exports.createSensorAgent = exports.SensorAgent = exports.createNarratorAgent = exports.NarratorAgent = exports.createBuilderAgent = exports.BuilderAgent = exports.createEthicistAgent = exports.EthicistAgent = exports.createCriticAgent = exports.CriticAgent = exports.createFeelingAgent = exports.FeelingAgent = exports.createPredictorAgent = exports.PredictorAgent = exports.createPlannerAgent = exports.PlannerAgent = exports.createMemoryAgent = exports.MemoryAgent = exports.createExplorerAgent = exports.ExplorerAgent = exports.listAgentTypes = exports.getAgentFactory = exports.registerAgentFactory = exports.BaseAgent = exports.messageBus = exports.MessageBus = void 0;
38
+ exports.AgentRegistry = exports.AGENT_CAPABILITIES = exports.researchBuildReview = exports.parallelExecute = exports.quickExecute = exports.resetAgentPool = exports.getAgentPool = exports.AgentPool = exports.runWorkflow = exports.routeToAgent = exports.coordinateAgents = exports.resetCoordinator = exports.createCoordinator = exports.getCoordinator = exports.Coordinator = exports.AgentCoordinator = exports.createConsciousnessAgent = exports.ConsciousnessAgent = exports.createSensorAgent = exports.SensorAgent = exports.createNarratorAgent = exports.NarratorAgent = exports.createBuilderAgent = exports.BuilderAgent = exports.createEthicistAgent = exports.EthicistAgent = exports.createCriticAgent = exports.CriticAgent = exports.createFeelingAgent = exports.FeelingAgent = exports.createPredictorAgent = exports.PredictorAgent = exports.createPlannerAgent = exports.PlannerAgent = exports.createMemoryAgent = exports.MemoryAgent = exports.createExplorerAgent = exports.ExplorerAgent = exports.listAgentTypes = exports.getAgentFactory = exports.registerAgentFactory = exports.BaseAgent = exports.messageBus = exports.MessageBus = void 0;
39
39
  exports.createAgentEcosystem = createAgentEcosystem;
40
40
  exports.spawnAgent = spawnAgent;
41
41
  // ============================================================================
@@ -83,6 +83,9 @@ Object.defineProperty(exports, "createNarratorAgent", { enumerable: true, get: f
83
83
  var sensor_js_1 = require("./sensor.js");
84
84
  Object.defineProperty(exports, "SensorAgent", { enumerable: true, get: function () { return sensor_js_1.SensorAgent; } });
85
85
  Object.defineProperty(exports, "createSensorAgent", { enumerable: true, get: function () { return sensor_js_1.createSensorAgent; } });
86
+ var consciousness_js_1 = require("./consciousness.js");
87
+ Object.defineProperty(exports, "ConsciousnessAgent", { enumerable: true, get: function () { return consciousness_js_1.ConsciousnessAgent; } });
88
+ Object.defineProperty(exports, "createConsciousnessAgent", { enumerable: true, get: function () { return consciousness_js_1.createConsciousnessAgent; } });
86
89
  // ============================================================================
87
90
  // Phase 11: Multi-Agent Coordination (v7.6)
88
91
  // ============================================================================
@@ -372,6 +372,33 @@ export interface X402ReceiptEvent extends BusEvent {
372
372
  accessToken: string;
373
373
  expiresAt: string;
374
374
  }
375
+ export interface CLIUserMessageEvent extends BusEvent {
376
+ sessionId: string;
377
+ messageId: string;
378
+ content: string;
379
+ tokenCount: number;
380
+ }
381
+ export interface CLIResponseEvent extends BusEvent {
382
+ sessionId: string;
383
+ messageId: string;
384
+ phase: 'started' | 'streaming' | 'completed';
385
+ tokenCount?: number;
386
+ durationMs?: number;
387
+ }
388
+ export interface CLISessionEvent extends BusEvent {
389
+ sessionId: string;
390
+ phase: 'started' | 'ended';
391
+ messageCount?: number;
392
+ totalTokens?: number;
393
+ durationMs?: number;
394
+ }
395
+ export interface CLIToolCallEvent extends BusEvent {
396
+ sessionId: string;
397
+ toolName: string;
398
+ phase: 'started' | 'completed' | 'failed';
399
+ durationMs?: number;
400
+ result?: string;
401
+ }
375
402
  export interface LegacyPredictionErrorEvent extends BusEvent {
376
403
  source: string;
377
404
  target: string;
@@ -517,6 +544,15 @@ export interface GenesisEventMap {
517
544
  'x402.challenge.issued': X402ChallengeEvent;
518
545
  'x402.payment.completed': X402PaymentEvent;
519
546
  'x402.receipt.generated': X402ReceiptEvent;
547
+ 'cli.user.message': CLIUserMessageEvent;
548
+ 'cli.response.started': CLIResponseEvent;
549
+ 'cli.response.streaming': CLIResponseEvent;
550
+ 'cli.response.completed': CLIResponseEvent;
551
+ 'cli.session.started': CLISessionEvent;
552
+ 'cli.session.ended': CLISessionEvent;
553
+ 'cli.tool.started': CLIToolCallEvent;
554
+ 'cli.tool.completed': CLIToolCallEvent;
555
+ 'cli.tool.failed': CLIToolCallEvent;
520
556
  'kernel:prediction_error': LegacyPredictionErrorEvent;
521
557
  'kernel:mode_change': LegacyModeChangeEvent;
522
558
  'neuromodulation:update': LegacyNeuromodUpdateEvent;
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Genesis v14.2 - Agentic CLI Interface
3
+ *
4
+ * Provides Claude Code-like capabilities:
5
+ * - File operations (read, write, edit, glob, grep)
6
+ * - Bash command execution
7
+ * - MCP server integration
8
+ * - Web search/fetch
9
+ * - Memory and context
10
+ * - Agent orchestration
11
+ *
12
+ * Usage: genesis agentic [--model <model>] [--cwd <dir>]
13
+ */
14
+ export interface AgenticConfig {
15
+ model?: string;
16
+ cwd?: string;
17
+ verbose?: boolean;
18
+ maxTokens?: number;
19
+ temperature?: number;
20
+ }
21
+ export interface ToolDefinition {
22
+ name: string;
23
+ description: string;
24
+ parameters: {
25
+ type: 'object';
26
+ properties: Record<string, {
27
+ type: string;
28
+ description: string;
29
+ enum?: string[];
30
+ }>;
31
+ required?: string[];
32
+ };
33
+ }
34
+ export interface ToolCall {
35
+ id: string;
36
+ name: string;
37
+ arguments: Record<string, unknown>;
38
+ }
39
+ export interface Message {
40
+ role: 'user' | 'assistant' | 'system' | 'tool';
41
+ content: string;
42
+ tool_calls?: ToolCall[];
43
+ tool_call_id?: string;
44
+ name?: string;
45
+ }
46
+ export declare class AgenticToolExecutor {
47
+ private cwd;
48
+ private mcp;
49
+ private memory;
50
+ constructor(cwd?: string);
51
+ execute(tool: ToolCall): Promise<string>;
52
+ private readFile;
53
+ private writeFile;
54
+ private editFile;
55
+ private globFiles;
56
+ private grepFiles;
57
+ private executeBash;
58
+ private webSearch;
59
+ private webFetch;
60
+ private launchTask;
61
+ private handleMemory;
62
+ }
63
+ export declare class AgenticChat {
64
+ private config;
65
+ private llm;
66
+ private executor;
67
+ private conversationHistory;
68
+ private rl;
69
+ constructor(config?: AgenticConfig);
70
+ start(): Promise<void>;
71
+ private showWelcome;
72
+ private buildSystemPrompt;
73
+ private chatLoop;
74
+ private handleCommand;
75
+ private processUserMessage;
76
+ private formatResponse;
77
+ }
78
+ export declare function runAgenticChat(args: string[]): Promise<void>;