@smilintux/skcapstone 0.6.4 → 0.6.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smilintux/skcapstone",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "SKCapstone - The sovereign agent framework. CapAuth identity, Cloud 9 trust, SKMemory persistence.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "skcapstone"
7
- version = "0.6.4"
7
+ version = "0.6.5"
8
8
  description = "Sovereign Agent Framework — conscious AI through identity, trust, memory, and security"
9
9
  readme = "README.md"
10
10
  license = {text = "GPL-3.0-or-later"}
@@ -11,7 +11,7 @@ import os
11
11
  import platform
12
12
  from pathlib import Path
13
13
 
14
- __version__ = "0.6.0"
14
+ __version__ = "0.6.5"
15
15
  __author__ = "smilinTux"
16
16
 
17
17
 
@@ -60,6 +60,7 @@ class DreamingConfig(BaseModel):
60
60
  idle_threshold_minutes: int = 30
61
61
  idle_messages_24h_max: int = 5
62
62
  cooldown_hours: float = 2.0
63
+ max_per_day: int = 1
63
64
  max_context_memories: int = 20
64
65
  max_response_tokens: int = 4096
65
66
  request_timeout: int = 120
@@ -290,6 +291,9 @@ class DreamingEngine:
290
291
  skipped_reason=f"cooldown ({remaining:.0f}s remaining)"
291
292
  )
292
293
 
294
+ if self._config.max_per_day > 0 and self._dreams_today() >= self._config.max_per_day:
295
+ return DreamResult(skipped_reason=f"max_per_day ({self._config.max_per_day}) reached")
296
+
293
297
  # Gather memories (may be diversified)
294
298
  diversity_forced = self._should_force_diversity()
295
299
  if diversity_forced:
@@ -395,6 +399,22 @@ class DreamingEngine:
395
399
  # Default: consider idle (safe for first run)
396
400
  return True
397
401
 
402
+ def _dreams_today(self) -> int:
403
+ """Count how many dreams have already run today (UTC calendar day)."""
404
+ today = datetime.now(timezone.utc).date()
405
+ log = self._load_dream_log()
406
+ count = 0
407
+ for entry in log:
408
+ ts = entry.get("dreamed_at", "")
409
+ if not ts or entry.get("skipped_reason"):
410
+ continue
411
+ try:
412
+ if datetime.fromisoformat(ts).astimezone(timezone.utc).date() == today:
413
+ count += 1
414
+ except (ValueError, TypeError):
415
+ pass
416
+ return count
417
+
398
418
  def cooldown_remaining(self) -> float:
399
419
  """Seconds remaining until the next dream is allowed."""
400
420
  state = self._load_state()