@minded-ai/mindedjs 1.0.0-ec2-beta-171 → 1.0.0-ec2-beta-172

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.
@@ -185,7 +185,7 @@ class LogsCapture:
185
185
  self.s3_client = self.boto3.client('s3', region_name=self.aws_region)
186
186
 
187
187
  # Track accumulated logs
188
- self.log_entries: List[Dict[str, Any]] = []
188
+ self.log_entries: List[str] = []
189
189
  self.step_counter = 0
190
190
 
191
191
  logger.info(f"📝 Logs capture ENABLED - will save history logs periodically")
@@ -202,31 +202,18 @@ class LogsCapture:
202
202
  # Get history object from agent
203
203
  history = agent.history
204
204
 
205
- # Extract relevant information from history
206
- log_entry = {
207
- 'step': step_number,
208
- 'timestamp': datetime.now().isoformat(),
209
- 'urls': history.urls() if hasattr(history, 'urls') else [],
210
- 'action_names': history.action_names() if hasattr(history, 'action_names') else [],
211
- }
212
-
213
205
  # Extract model outputs if available
214
206
  try:
215
207
  model_outputs = history.model_outputs() if hasattr(history, 'model_outputs') else []
216
- log_entry['model_outputs'] = [
217
- {
218
- 'memory': h.current_state.memory if hasattr(h, 'current_state') else None,
219
- 'next_goal': h.current_state.next_goal if hasattr(h, 'current_state') else None,
220
- 'thinking': h.current_state.thinking if hasattr(h, 'current_state') else None,
221
- }
222
- for h in model_outputs
223
- ]
208
+ last_model_output = model_outputs[-1] if model_outputs else None
209
+ if hasattr(last_model_output, 'current_state'):
210
+ self.log_entries.append('💡 Thinking:\n' + last_model_output.current_state.thinking)
211
+ self.log_entries.append('🧠 Memory:\n' + last_model_output.current_state.memory)
212
+ self.log_entries.append('🎯 Next goal:\n' + last_model_output.current_state.next_goal)
224
213
  except Exception as e:
225
214
  logger.debug(f"Could not extract model outputs: {e}")
226
- log_entry['model_outputs'] = []
227
-
215
+
228
216
  # Add to accumulated logs
229
- self.log_entries.append(log_entry)
230
217
 
231
218
  # Upload to S3
232
219
  s3_key = f"{self.s3_prefix}{self.session_id}/operator.log"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minded-ai/mindedjs",
3
- "version": "1.0.0-ec2-beta-171",
3
+ "version": "1.0.0-ec2-beta-172",
4
4
  "description": "MindedJS is a TypeScript library for building agents.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -185,7 +185,7 @@ class LogsCapture:
185
185
  self.s3_client = self.boto3.client('s3', region_name=self.aws_region)
186
186
 
187
187
  # Track accumulated logs
188
- self.log_entries: List[Dict[str, Any]] = []
188
+ self.log_entries: List[str] = []
189
189
  self.step_counter = 0
190
190
 
191
191
  logger.info(f"📝 Logs capture ENABLED - will save history logs periodically")
@@ -202,31 +202,18 @@ class LogsCapture:
202
202
  # Get history object from agent
203
203
  history = agent.history
204
204
 
205
- # Extract relevant information from history
206
- log_entry = {
207
- 'step': step_number,
208
- 'timestamp': datetime.now().isoformat(),
209
- 'urls': history.urls() if hasattr(history, 'urls') else [],
210
- 'action_names': history.action_names() if hasattr(history, 'action_names') else [],
211
- }
212
-
213
205
  # Extract model outputs if available
214
206
  try:
215
207
  model_outputs = history.model_outputs() if hasattr(history, 'model_outputs') else []
216
- log_entry['model_outputs'] = [
217
- {
218
- 'memory': h.current_state.memory if hasattr(h, 'current_state') else None,
219
- 'next_goal': h.current_state.next_goal if hasattr(h, 'current_state') else None,
220
- 'thinking': h.current_state.thinking if hasattr(h, 'current_state') else None,
221
- }
222
- for h in model_outputs
223
- ]
208
+ last_model_output = model_outputs[-1] if model_outputs else None
209
+ if hasattr(last_model_output, 'current_state'):
210
+ self.log_entries.append('💡 Thinking:\n' + last_model_output.current_state.thinking)
211
+ self.log_entries.append('🧠 Memory:\n' + last_model_output.current_state.memory)
212
+ self.log_entries.append('🎯 Next goal:\n' + last_model_output.current_state.next_goal)
224
213
  except Exception as e:
225
214
  logger.debug(f"Could not extract model outputs: {e}")
226
- log_entry['model_outputs'] = []
227
-
215
+
228
216
  # Add to accumulated logs
229
- self.log_entries.append(log_entry)
230
217
 
231
218
  # Upload to S3
232
219
  s3_key = f"{self.s3_prefix}{self.session_id}/operator.log"