conduct-cli 0.4.98__tar.gz → 0.4.99__tar.gz

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 (27) hide show
  1. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/PKG-INFO +1 -1
  2. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/pyproject.toml +1 -1
  3. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli/hook_template.py +26 -5
  4. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli.egg-info/PKG-INFO +1 -1
  5. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/README.md +0 -0
  6. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/setup.cfg +0 -0
  7. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/setup.py +0 -0
  8. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli/__init__.py +0 -0
  9. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli/api.py +0 -0
  10. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli/guard.py +0 -0
  11. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli/guardmcp.py +0 -0
  12. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli/hook_precompact_template.py +0 -0
  13. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli/hook_session_start_template.py +0 -0
  14. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli/hook_stop_template.py +0 -0
  15. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli/main.py +0 -0
  16. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli/mcp_server.py +0 -0
  17. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli/memory.py +0 -0
  18. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli/paxel.py +0 -0
  19. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli.egg-info/SOURCES.txt +0 -0
  20. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli.egg-info/dependency_links.txt +0 -0
  21. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli.egg-info/entry_points.txt +0 -0
  22. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli.egg-info/requires.txt +0 -0
  23. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/src/conduct_cli.egg-info/top_level.txt +0 -0
  24. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/tests/test_guard_policy.py +0 -0
  25. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/tests/test_guard_savings.py +0 -0
  26. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/tests/test_hook_syntax.py +0 -0
  27. {conduct_cli-0.4.98 → conduct_cli-0.4.99}/tests/test_switch.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: conduct-cli
3
- Version: 0.4.98
3
+ Version: 0.4.99
4
4
  Summary: CLI for Conduct AI — install agents, manage projects, run tests
5
5
  Author-email: Conduct AI <hello@conductai.ai>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "conduct-cli"
7
- version = "0.4.98"
7
+ version = "0.4.99"
8
8
  description = "CLI for Conduct AI — install agents, manage projects, run tests"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -8,6 +8,27 @@ import time
8
8
  import urllib.request
9
9
  from pathlib import Path
10
10
 
11
+ _FLUSH_INTERVAL = 8 * 3600
12
+ _FLUSH_STAMP = Path.home() / ".conduct" / "last_memory_flush"
13
+
14
+
15
+ def _should_periodic_flush() -> bool:
16
+ try:
17
+ if not _FLUSH_STAMP.exists():
18
+ return True
19
+ return time.time() - float(_FLUSH_STAMP.read_text().strip()) >= _FLUSH_INTERVAL
20
+ except Exception:
21
+ return True
22
+
23
+
24
+ def _mark_flushed() -> None:
25
+ try:
26
+ _FLUSH_STAMP.parent.mkdir(parents=True, exist_ok=True)
27
+ _FLUSH_STAMP.write_text(str(time.time()))
28
+ except Exception:
29
+ pass
30
+
31
+
11
32
  GUARD_DIR = Path.home() / ".conductguard"
12
33
  POLICY_PATH = GUARD_DIR / "policy.json"
13
34
  CONFIG_PATH = GUARD_DIR / "config.json"
@@ -589,19 +610,19 @@ def main():
589
610
  session_id = data.get("session_id", "")
590
611
  transcript_path = data.get("transcript_path")
591
612
  repo = _detect_repo()
592
- from conduct_cli.memory import post_session_to_api, mark_flushed
613
+ from conduct_cli.memory import post_session_to_api
593
614
  post_session_to_api(session_id, transcript_path, repo)
594
- mark_flushed()
615
+ _mark_flushed()
595
616
  sys.exit(0)
596
617
 
597
618
  # Periodic flush — fire at most once every 8 hours mid-session
598
- from conduct_cli.memory import should_periodic_flush, mark_flushed, post_session_to_api
599
- if should_periodic_flush():
619
+ if _should_periodic_flush():
600
620
  session_id = data.get("session_id", "")
601
621
  transcript_path = data.get("transcript_path")
602
622
  repo = _detect_repo()
623
+ from conduct_cli.memory import post_session_to_api
603
624
  post_session_to_api(session_id, transcript_path, repo)
604
- mark_flushed()
625
+ _mark_flushed()
605
626
 
606
627
  # Policy version check (cached 60s) — auto-syncs if server version differs
607
628
  _maybe_sync_policy()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: conduct-cli
3
- Version: 0.4.98
3
+ Version: 0.4.99
4
4
  Summary: CLI for Conduct AI — install agents, manage projects, run tests
5
5
  Author-email: Conduct AI <hello@conductai.ai>
6
6
  License: MIT
File without changes
File without changes
File without changes