Documentation
¶
Overview ¶
Package core registers hub.CapCore — internal multi-op capability for notify, clip, agent, HTTP, sandboxed execution, and persistent KV.
Index ¶
- Constants
- func CatalogSpec() capability.Spec
- func LegacyCapability(name string) bool
- func LegacyOperation(capability, operation string) (coreOp string, ok bool)
- func Register() error
- func SetExecProvider(p ExecProvider)
- func SetKVStore(s KVStore)
- func SetMetaLLMForTest(fn metaLLMFunc)
- func SetNotifier(n Notifier)
- func SetNotifierFunc(...)
- func SetPersister(p Persister)
- func SetRunner(r Runner)
- func WordCount(content string) int
- type ExecProvider
- type KVStore
- type Meta
- type Notifier
- type Persister
- type Record
- type RunParams
- type RunResult
- type Runner
Constants ¶
const ( OpNotifySend = "notify_send" OpNotifyHealth = "notify_health" OpClipCreate = "clip_create" OpClipGet = "clip_get" OpClipHealth = "clip_health" OpAgentRun = "agent_run" OpAgentHealth = "agent_health" OpHTTPRequest = "http_request" OpRunCode = "run_code" OpRunTerminal = "run_terminal" OpKVGet = "kv_get" OpKVSet = "kv_set" OpKVDelete = "kv_delete" )
const (
// MaxContentBytes is the maximum accepted markdown body size for create.
MaxContentBytes = 512 * 1024
)
Variables ¶
This section is empty.
Functions ¶
func CatalogSpec ¶
func CatalogSpec() capability.Spec
CatalogSpec returns capability metadata for documentation (handlers may close over a nil service and must not be invoked).
func LegacyCapability ¶
LegacyCapability reports whether name is a pre-CapCore capability type string.
func LegacyOperation ¶
LegacyOperation maps pre-CapCore (capability, operation) to CapCore op name. ok is false when the pair is not a known legacy mapping.
func SetExecProvider ¶
func SetExecProvider(p ExecProvider)
SetExecProvider wires sandboxed execution used by run_code and run_terminal.
func SetKVStore ¶
func SetKVStore(s KVStore)
SetKVStore wires the persistence backend used by kv_get/set/delete.
func SetMetaLLMForTest ¶
func SetMetaLLMForTest(fn metaLLMFunc)
SetMetaLLMForTest overrides LLM metadata generation in unit tests.
func SetNotifier ¶
func SetNotifier(n Notifier)
SetNotifier wires the notification gateway used by notify_send.
func SetNotifierFunc ¶
func SetNotifierFunc(fn func(ctx context.Context, uid types.Uid, templateID string, channels []string, payload map[string]any) error)
SetNotifierFunc wires a send function (tests and server).
func SetPersister ¶
func SetPersister(p Persister)
SetPersister wires the persistence backend used by clip_create.
Types ¶
type ExecProvider ¶
type ExecProvider interface {
// ExecConfig returns workspace root and ExecutionEnv (typically Docker sandbox).
ExecConfig(ctx context.Context) (pkgexec.Config, error)
}
ExecProvider supplies workspace-bound execution config for run_code / run_terminal.
type KVStore ¶
type KVStore interface {
Get(ctx context.Context, uid types.Uid, namespace, key string) (types.KV, error)
Set(ctx context.Context, uid types.Uid, namespace, key string, value types.KV) error
Delete(ctx context.Context, uid types.Uid, namespace, key string) error
}
KVStore persists namespaced key/value data for core.kv_* ops.
type Notifier ¶
type Notifier interface {
Send(ctx context.Context, uid types.Uid, templateID string, channels []string, payload map[string]any) error
}
Notifier dispatches template notifications (wired to pkg/notify.GatewaySend in server).
type Persister ¶
type Persister interface {
// CreateClip inserts a clip row keyed by slug.
CreateClip(ctx context.Context, slug, title, description, content, createdBy string) error
// GetClipBySlug returns a clip by slug, or nil when not found.
GetClipBySlug(ctx context.Context, slug string) (*Record, error)
}
Persister stores and loads clips.
type Record ¶
type Record struct {
// Slug is the public short identifier.
Slug string
// Title is the clip title.
Title string
// Description is the short preview text.
Description string
// Content is the markdown body.
Content string
// CreatedBy is the optional creator identifier.
CreatedBy string
// CreatedAt is when the clip was created.
CreatedAt time.Time
}
Record is a persisted clip returned by get operations.
type RunParams ¶
type RunParams struct {
Prompt string
UID types.Uid
Tools []string
Skills []string
MemoryScope string
}
RunParams carries one pipeline-rendered agent run request.