@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 +1 -1
- package/pyproject.toml +1 -1
- package/src/skcapstone/__init__.py +1 -1
- package/src/skcapstone/dreaming.py +20 -0
package/package.json
CHANGED
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.
|
|
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"}
|
|
@@ -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()
|