Standard llm.txt with package layout, key types, service pattern. Points to CLAUDE.md and docs/RFC.md for full specs. Co-Authored-By: Virgil <virgil@lethean.io>
41 lines
1.3 KiB
Text
41 lines
1.3 KiB
Text
# core/go — CoreGO DI Framework
|
|
|
|
> dappco.re/go/core — Dependency injection, service lifecycle, and message-passing
|
|
> framework for Go. Foundation layer for the Lethean ecosystem.
|
|
|
|
## Entry Points
|
|
|
|
- CLAUDE.md — Agent instructions, build commands, architecture overview
|
|
- docs/RFC.md — API contract specification (start here for the full spec)
|
|
|
|
## Package Layout
|
|
|
|
- pkg/core/ — The Core struct: DI container, service registry, lifecycle, IPC
|
|
- No subpackages — everything is in the root core package
|
|
|
|
## Key Types
|
|
|
|
- Core — Central application container (created via core.New())
|
|
- Option — Single key-value pair {Key: string, Value: any}
|
|
- Options — Collection of Option with typed accessors
|
|
- Result — Universal return type {Value: any, OK: bool}
|
|
- Service — Managed component with lifecycle (Startable/Stoppable)
|
|
- Message — IPC message interface for ACTION/QUERY/PERFORM
|
|
|
|
## Service Pattern
|
|
|
|
Services register via factory functions:
|
|
|
|
core.New(
|
|
core.WithService(mypackage.Register),
|
|
)
|
|
|
|
func Register(c *core.Core) core.Result {
|
|
svc := &MyService{runtime: core.NewServiceRuntime(c, opts)}
|
|
return core.Result{Value: svc, OK: true}
|
|
}
|
|
|
|
## Conventions
|
|
|
|
Follows RFC-025 Agent Experience (AX) principles.
|
|
See: https://core.help/specs/RFC-025-AGENT-EXPERIENCE/
|