forked from enderofwings/NexusOS
feat: sync with upstream — v1.2.0, in-app updates, Projects, modules
Brings the public tree back in line with the development repo after several weeks of drift caused by a stale publish include list. New: - In-app update path: GET /update/check compares the checkout against origin/main and POST /update/apply runs `ncp upgrade` detached (pull, rebuild, restart). The sidebar shows the version, checks on click, and offers an "update available" pill. - Projects: a project workspace groups chats and RAG documents, with per-project instructions and document retrieval scoped to the active project. Replaces the standalone Documents page. - modules/: auto-discovered feature plugins (mail, network) with their frontend counterparts and tests. - Memory curation runs in-process (synapse/memory/curator.py) on the chat model when a conversation goes idle. The separate memory service on :8001 is gone, along with the launcher lines that started it. Also: the KDE theme, panel and Promethean terminal assets, the full test suite, and VERSION 1.2.0. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This commit is contained in:
+22
-24
@@ -2,30 +2,28 @@ from typing import List
|
||||
from .playbooks.store import playbook_store, PlaybookItem
|
||||
|
||||
|
||||
class PlaybookManager:
|
||||
@classmethod
|
||||
def _all(cls) -> List[PlaybookItem]:
|
||||
"""Return all playbooks sorted by order (position 0 is always main)."""
|
||||
return playbook_store.all_playbooks()
|
||||
def _all() -> List[PlaybookItem]:
|
||||
"""Return all playbooks sorted by order (position 0 is always main)."""
|
||||
return playbook_store.all_playbooks()
|
||||
|
||||
@classmethod
|
||||
def get_main_playbook(cls) -> PlaybookItem | None:
|
||||
playbooks = cls._all()
|
||||
return playbooks[0] if playbooks else None
|
||||
|
||||
@classmethod
|
||||
def get_context_playbooks(cls) -> List[PlaybookItem]:
|
||||
"""All playbooks after the first — injected as reference context."""
|
||||
playbooks = cls._all()
|
||||
return playbooks[1:] if len(playbooks) > 1 else []
|
||||
def get_main_playbook() -> PlaybookItem | None:
|
||||
playbooks = _all()
|
||||
return playbooks[0] if playbooks else None
|
||||
|
||||
@classmethod
|
||||
def get_system_prompt(cls) -> str:
|
||||
playbook = cls.get_main_playbook()
|
||||
if not playbook:
|
||||
return ""
|
||||
goal = (getattr(playbook, "goal", "") or "").strip()
|
||||
instructions = (getattr(playbook, "instructions", "") or "").strip()
|
||||
if goal and instructions:
|
||||
return f"{goal}\n\n{instructions}"
|
||||
return goal or instructions
|
||||
|
||||
def get_context_playbooks() -> List[PlaybookItem]:
|
||||
"""All playbooks after the first — injected as reference context."""
|
||||
playbooks = _all()
|
||||
return playbooks[1:] if len(playbooks) > 1 else []
|
||||
|
||||
|
||||
def get_system_prompt() -> str:
|
||||
playbook = get_main_playbook()
|
||||
if not playbook:
|
||||
return ""
|
||||
goal = (getattr(playbook, "goal", "") or "").strip()
|
||||
instructions = (getattr(playbook, "instructions", "") or "").strip()
|
||||
if goal and instructions:
|
||||
return f"{goal}\n\n{instructions}"
|
||||
return goal or instructions
|
||||
|
||||
Reference in New Issue
Block a user