How muxuejc/norma works
Norma is a Go agent-harness SDK. A host supplies a prompt and provider, then drives a stateful Session that streams model output, dispatches permitted tools, and returns results. The graph also preserves the documented context management, integrations, and agent extensions, plus the substantial NOA context subsystem present in the source tree. Edges reflect README statements or shown/indexed references; unsampled implementations are represented without guessed call paths.
Main entry points: agentcore.go Session API · query.go Streaming Loop · session.go NOA Session · registry.go Tool Registry
Components 25
Agent Runtime
- Session API
agentcore/agentcore.go - Streaming Loop
harness/query.go - Provider Adapters
llm/anthropic.go - Stream Events
harness/event.go
Safety and Tools
- Permission Policy
permission/permission.go - Tool Registry
tool/registry.go - Core Tools
tool/files.go - Web Search
tool/websearch.go - Background Tasks
tool/task.go
Context and Persistence
- Context Compaction
compaction/compaction.go - Summarizer
compaction/summarizer.go - Transcript Store
transcript/transcript.go
Agent Extensions
- Lifecycle Hooks
hook/hook.go - Subagents
subagent/subagent.go - Coordinator
coordinator/coordinator.go - MCP Integration
mcp/mcp.go - Plan Mode
plan/plan.go - Long-Term Memory
memory/memory.go - Skill System
skill/skill.go
NOA Context
- NOA Session
noaadapter/session.go - History Projection
noaadapter/project.go - NOA State Store
noaadapter/state_store.go - NOA Compression
noa/compress.go
Other components
- SDK Host
- LLM Service
Connections 24
- SDK Host → Session API: configures and prompts
- Session API → Streaming Loop: runs query
agentcore/agentcore.go - Streaming Loop → Provider Adapters: streams completion
- Provider Adapters → LLM Service: sends requests
- Streaming Loop → Stream Events: emits events
- Streaming Loop → Permission Policy: evaluates calls
- Streaming Loop → Tool Registry: dispatches tools
- Tool Registry → Core Tools: registers tools
- Tool Registry → Web Search: registers optionally
- Session API → Context Compaction: manages context
agentcore/agentcore.go - Context Compaction → Summarizer: summarizes history
compaction/compaction.go - Streaming Loop → Transcript Store: records messages
harness/query.go - Session API → Lifecycle Hooks: configures callbacks
- Session API → Subagents: exposes delegation
- Coordinator → Subagents: runs workers
coordinator/coordinator.go - Session API → MCP Integration: adds MCP tools
- Session API → Plan Mode: enables plan mode
- Session API → Long-Term Memory: adds memory tools
- Session API → Skill System: adds skill tool
agentcore/agentcore.go - Session API → Background Tasks: manages task tools
- NOA Session → History Projection: projects history
- NOA Session → NOA State Store: loads and stores state
- NOA Session → NOA Compression: applies compression
- History Projection → NOA Compression: uses NOA model
noaadapter/project.go