Documentation
¶
Index ¶
- Constants
- func AgentBind(ctx context.Context, store agentkit.SessionStore, id agentkit.SessionID) (agentkit.AgentID, error)
- func ChannelAgentBind(ctx context.Context, store agentkit.SessionStore, ws workspace.Service, ...) (agentkit.AgentID, error)
- func GlobalAgentBind(ctx context.Context, ws workspace.Service) (agentkit.AgentID, error)
- func GlobalModelBind(ctx context.Context, ws workspace.Service, agentID agentkit.AgentID) (string, error)
- func GlobalModelBinds(ctx context.Context, ws workspace.Service) (map[string]string, error)
- func ModelBind(ctx context.Context, store agentkit.SessionStore, id agentkit.SessionID) (string, error)
- func ResolveAgentID(ctx context.Context, store agentkit.SessionStore, ws workspace.Service, ...) (effective, sessionBind, channelBind, globalBind agentkit.AgentID, err error)
- func ResolveEffectiveModel(ctx context.Context, store agentkit.SessionStore, ws workspace.Service, ...) (effective, sessionOverride, globalOverride string, err error)
- func ResolveSubagentModel(ctx context.Context, ws workspace.Service, parentAgentID agentkit.AgentID, ...) string
- func RuntimeStore(store agentkit.SessionStore) (agentkit.SessionRuntimeStore, error)
- func SetChannelAgentBind(ctx context.Context, store agentkit.SessionStore, ws workspace.Service, ...) error
- func SetGlobalAgentBind(ctx context.Context, ws workspace.Service, agent agentkit.AgentID) error
- func SetGlobalModelBind(ctx context.Context, ws workspace.Service, agentID agentkit.AgentID, ...) error
- func SetSessionAgentBind(ctx context.Context, store agentkit.SessionStore, id agentkit.SessionID, ...) error
- func SetSessionModelBind(ctx context.Context, store agentkit.SessionStore, id agentkit.SessionID, ...) error
- type ChannelRuntimeData
- type GlobalRuntimeData
Constants ¶
const SubagentModelWildcardKey agentkit.AgentID = "sub:*"
SubagentModelWildcardKey is the global models key that applies to every in-process subagent without a more specific entry. Written by `/submodel * <model>`; it never affects the main agent.
Variables ¶
This section is empty.
Functions ¶
func AgentBind ¶
func AgentBind(ctx context.Context, store agentkit.SessionStore, id agentkit.SessionID) (agentkit.AgentID, error)
AgentBind returns the per-session agent override, or "" when unset.
func ChannelAgentBind ¶ added in v0.4.18
func ChannelAgentBind(ctx context.Context, store agentkit.SessionStore, ws workspace.Service, entryKey agentkit.SessionID) (agentkit.AgentID, error)
ChannelAgentBind returns the channel default for entryKey (stable delivery / active-entry id). Falls back to legacy local:runtime.json when tenant-scoped.
func GlobalAgentBind ¶
GlobalAgentBind returns the workspace-wide default agent id, or "" when unset.
func GlobalModelBind ¶
func GlobalModelBind(ctx context.Context, ws workspace.Service, agentID agentkit.AgentID) (string, error)
GlobalModelBind returns the global default model for agentID, or "" when unset.
func GlobalModelBinds ¶ added in v0.3.59
GlobalModelBinds returns every entry in global:runtime.json models, or nil when unset. Commands use it to list configured overrides.
func ModelBind ¶
func ModelBind(ctx context.Context, store agentkit.SessionStore, id agentkit.SessionID) (string, error)
ModelBind returns the per-session model override, or "" when unset.
func ResolveAgentID ¶
func ResolveAgentID( ctx context.Context, store agentkit.SessionStore, ws workspace.Service, sessionID agentkit.SessionID, entryKey agentkit.SessionID, eventAgent agentkit.AgentID, ) (effective, sessionBind, channelBind, globalBind agentkit.AgentID, err error)
ResolveAgentID applies session bind, channel bind, global default, then explicit event agent id. The bind results are the stored values at each layer, including layers that lost to a higher priority.
func ResolveEffectiveModel ¶
func ResolveEffectiveModel( ctx context.Context, store agentkit.SessionStore, ws workspace.Service, sessionID agentkit.SessionID, agentID agentkit.AgentID, defaultModel string, ) (effective, sessionOverride, globalOverride string, err error)
ResolveEffectiveModel applies session override, then global (per agent), then defaultModel.
func ResolveSubagentModel ¶ added in v0.3.59
func ResolveSubagentModel( ctx context.Context, ws workspace.Service, parentAgentID agentkit.AgentID, childAgentID agentkit.AgentID, defModel string, ) string
ResolveSubagentModel resolves the model for an in-process subagent step.
Priority (definition author > explicit subagent config > general default > fallback):
- defModel — agents/<name>.md `model:` is a capability contract authored together with the prompt and modalities; runtime overrides never win.
- global models[<childAgentID>] — the explicit per-subagent config written by `/submodel <name> <model>`.
- global models[SubagentModelWildcardKey] — the all-subagents policy written by `/submodel * <model>`; main agent is unaffected.
- global models[<parentAgentID>] — the parent agent's `/model -g` choice, the general default specific keys refine.
defModel is also the final fallback when nothing else is set. Neither the child session's bind nor the parent conversation's session bind participate: per-delegation ids have no /model entry point, and the user's in-conversation /model targets the main agent only — subagent models are explicit config, not implicit inheritance.
func RuntimeStore ¶
func RuntimeStore(store agentkit.SessionStore) (agentkit.SessionRuntimeStore, error)
RuntimeStore returns the session runtime overlay capability when present.
func SetChannelAgentBind ¶ added in v0.4.18
func SetChannelAgentBind(ctx context.Context, store agentkit.SessionStore, ws workspace.Service, entryKey agentkit.SessionID, agent agentkit.AgentID) error
SetChannelAgentBind sets or clears the channel default for entryKey.
func SetGlobalAgentBind ¶
SetGlobalAgentBind sets or clears the workspace-wide default agent id.
func SetGlobalModelBind ¶
func SetGlobalModelBind(ctx context.Context, ws workspace.Service, agentID agentkit.AgentID, model string) error
SetGlobalModelBind sets or clears the global default model for agentID.
func SetSessionAgentBind ¶
func SetSessionAgentBind(ctx context.Context, store agentkit.SessionStore, id agentkit.SessionID, agent agentkit.AgentID) error
SetSessionAgentBind sets or clears the per-session agent override.
func SetSessionModelBind ¶
func SetSessionModelBind(ctx context.Context, store agentkit.SessionStore, id agentkit.SessionID, model string) error
SetSessionModelBind sets or clears the per-session model override.
Types ¶
type ChannelRuntimeData ¶ added in v0.4.18
ChannelRuntimeData holds channel-scoped dynamic overrides.