Abstract seeds into modular skill packs + split config
Group committed starter skills into packs (semif_agent/packs.py) that bind a
concern to its categories, bridge(s), requirements, and config schema:
- seeds/ -> packs/<name>/ with a pack.json manifest + skills/<category>/<leaf>/.
Shipped: nextcloud, simplex, outlook, browser (each owning its bridge) and
essentials (time + calculator, no bridge).
- PackRegistry discovers packs (a root with no manifest is one implicit pack);
merge_packs loads every enabled pack. Pack enable is one switch
(packs.<name>.enabled -> bridges.<bridge>.enabled -> enabled_by_default);
disabling a pack drops its categories (incl. generated bodies) and its bridge.
- CATEGORY_DESCRIPTIONS now comes from the pack manifests (built-ins stay).
Adopt a Home-Assistant-style layered config (semif_agent/config.py):
- config.json is a thin index ({"include": [...]}) over config/core.json,
config/gateway.json, config/bridges.json, config/packs/*.json, deep-merged.
- Secrets live in the gitignored secrets.json, referenced as "!secret <key>";
api_key_env is removed.
- CORE_SCHEMA + each pack's config schema own defaults and GENERATE the
committed config.example.json; new `check-config` (validate + --write-example)
and `config-init` (seed the split layout) commands.
- scripts/config_merge.py (stdlib) lets bootstrap read the merged config.
Tests: tests/test_packs.py (renamed from test_seed_skills, +enable/merge),
new tests/test_config.py. All unit tests pass (772).
This commit is contained in:
1 parent
b953475bf7
commit
78b4621ba0
115 files changed
+1701
-398
No files matched your search
@@ -38,6 +38,7 @@ from .engine import DecisionEngine, EngineUnavailable
|
||||
from .llm import LLMClient
|
||||
from .log import DecisionLog
|
||||
from .provider import ProviderError
|
||||
from .packs import disabled_categories, load_packs, merge_packs
|
||||
from .queue import RequestQueue
|
||||
from .skill import SkillRunner
|
||||
from .timers import TimerService
|
||||
@@ -411,7 +412,9 @@ class Scheduler:
|
||||
registry_path = config.get("category_registry", "data/categories.json")
|
||||
self.registry = CategoryRegistry(registry_path)
|
||||
self.body_store = SkillStore(config.get("skill_bodies", "data/skills"))
|
||||
self.seed_store = SkillStore(config.get("skill_seeds", "seeds"))
|
||||
# Packs bundle committed starter skills with their concern, category
|
||||
# scope, bridge, and config schema. A disabled pack contributes nothing.
|
||||
self.packs = load_packs(config)
|
||||
# Deletions are durable: a tombstone suppresses a seed (or a generated
|
||||
# body of the same name) on every future load. Derived from the registry
|
||||
# path when not configured, so a test store is self-contained.
|
||||
@@ -420,9 +423,14 @@ class Scheduler:
|
||||
)
|
||||
self.deleted = DeletedSkills(deleted_path)
|
||||
merge_registry(self.tree, self.registry.read())
|
||||
merge_seed_store(self.tree, self.seed_store, self.body_store)
|
||||
merge_packs(self.tree, self.packs, config, self.body_store)
|
||||
merge_skill_store(self.tree, self.body_store, self.registry.read())
|
||||
apply_tombstones(self.tree, self.deleted)
|
||||
# A disabled pack's categories are dropped entirely — including any
|
||||
# generated body authored into one — so the tree never offers a skill
|
||||
# whose pack (and bridge) is off.
|
||||
for category in disabled_categories(config, self.packs):
|
||||
self.tree.pop(category, None)
|
||||
self.timers = TimerService(trace=self.trace, timezone=config.get("timezone"))
|
||||
self.ctx = ActionContext(
|
||||
engine=self.engine, config=config, timers=self.timers, admin=self
|
||||
|
||||
Reference in new issue
Block a user