10 Commits

Author SHA1 Message Date
xiaoju 7de75b5df7 rfc-003: remove timeout from RoleSpec, it's an adapter concern
RoleSpec now has exactly 3 fields: adapter, prompt, meta.
Timeout belongs to adapter config — different timeouts = different adapter instances.

Refs #245
小橘 🍊(NEKO Team)
2026-04-29 08:34:00 +00:00
xiaoju 4be465918c rfc-003: adapter as direct function reference, not string
- RoleSpec.adapter: string → AgentFn (direct import)
- Each adapter exports default instance + factory
- No adapter map, no registry, no lookup — compile-time safety
- TypeScript catches missing adapters at import time

Refs #245
小橘 🍊(NEKO Team)
2026-04-29 08:23:59 +00:00
xiaoju 732669fab5 rfc-003: simplify agent layer — remove registry, roles declare adapter directly
- Remove nerve.yaml agents config (keep only extract + knowledge)
- RoleSpec.agent → RoleSpec.adapter
- buildWorkflowSpec receives adapter map directly
- Extract merge: 3-level → 2-level (global → role)
- Update open questions (embedding service resolved)

小橘 🍊(NEKO Team)
2026-04-29 08:11:54 +00:00
xiaoju ce5462cb59 feat(knowledge): integrate real embedding service
Replace placeholder fake embeddings with real embed service calls:
- Add embed-service.ts (remote API + cosine similarity + fallback)
- knowledge-db stores externally-provided embeddings
- sync.ts/query.ts now async, call embed service
- CLI commands updated for async API

WIP: tests need updating for async changes

Refs #234
2026-04-29 07:43:05 +00:00
xiaoju 18584641bd docs(rfc): RFC-003 — adapter packages + dynamic prompts
- Adapter packages: each adapter in own package (@nerve/adapter-cursor, etc.)
- AgentRegistry accepts adapter factories at construction (plugin model)
- Migration path: move spawn logic from workflow-utils to adapter packages
- Dynamic prompts: RoleSpec.prompt supports string | async function
- Workspace only installs adapters it uses

Ref: #234
2026-04-29 07:08:34 +00:00
xiaoju 623fb3cd3a fix(cli): knowledge query --repo flag, remove -r alias (conflicts with global remote flag)
- Rename -r to --repo for knowledge query scope
- Update RFC docs to match
- Fix biome format issues
- Add assertZodMetaSchemas export
- KNOWN_AGENT_ADAPTER_IDS: add cursor/hermes/codex

Self-tested: nerve knowledge sync + query work correctly
2026-04-29 06:02:24 +00:00
xiaoju 7a4e16381c docs(rfc): address review — resolve open questions, add error handling/hot-reload/context/validation
- model: auto = delegate to adapter's default strategy
- ExtractFn: retry once + throw ExtractError, three-level merge (global → agent → role)
- Agent hot-reload: AgentRegistry rebuilds on config change, running threads unaffected
- WorkflowContext: add workdir + AbortSignal
- Configuration validation: nerve validate checks agent name refs
- WorkflowSpec compile: runtime lazy compile at daemon startup/hot-reload
- Compatibility: existing hand-written Role functions continue to work (not breaking)
- Resolved 3 of 5 open questions, 2 remaining (long-term memory, embedding service)

Refs #233
2026-04-29 04:26:48 +00:00
xiaoju aecced587c docs(rfc): knowledge layer — built-in, local-first, repo-scoped
Replaces the Alysaril delegation with a built-in knowledge feature:
- knowledge.yaml at repo root with include/exclude
- knowledge.db (SQLite) stores chunks + embeddings locally
- Remote service only for embedding computation + content-hash cache
- In-memory cosine search (sufficient for project scale)
- CLI: nerve knowledge sync/query with -r and -g flags

Refs #233
2026-04-29 04:12:09 +00:00
xiaoju 3950f0e278 docs(rfc): add Knowledge Layer section — delegate to Alysaril
Project knowledge is not a nerve feature. Nerve runtime does not hardcode
knowledge paths; loading is a prompt concern. Adds Alysaril as the
independent knowledge base tool.

小橘 <xiaoju@shazhou.work>
2026-04-29 03:25:43 +00:00
xiaoju ea07c2c667 docs(rfc): RFC-003 agent configuration layer
Separates agent infrastructure (nerve.yaml) from workflow business logic.
Key decisions:
- Agent = domain capability, Role = scenario specialization
- Unified AgentFn protocol: (prompt, context) → string
- Independent extract layer for structured output
- Two-layer timeout (agent default, role override)
- No runtime fallback, fail fast

小橘 <xiaoju@shazhou.work>
2026-04-29 01:26:41 +00:00