Documentation
¶
Index ¶
- Constants
- func AddRuntimeProperties(_ map[string]any)
- func Description() string
- func InputSchema(name string) (map[string]any, bool)
- func OutputSchema(name string) (map[string]any, bool)
- func WorkdirDescription() string
- type CommandContext
- type ConfigProvider
- type ExecRequest
- type Result
- type RuntimeOptions
- type Service
- func (s *Service) Act(request SessionActRequest) (Result, error)
- func (s *Service) BeginClose()
- func (s *Service) Close() error
- func (s *Service) CommandEnv(skillName string, extra map[string]string) ([]string, error)
- func (svc *Service) Exec(ctx context.Context, request ExecRequest) (Result, error)
- func (s *Service) InternalCommandEnv(extra map[string]string) ([]string, error)
- func (s *Service) Observe(request SessionObserveRequest) (Result, error)
- func (s *Service) WaitForStarts() error
- type SessionActRequest
- type SessionObserveRequest
- type SkillLease
- type SkillResolver
- type ToolError
Constants ¶
View Source
const ( ToolExecCommand = "exec_command" ToolSessionObserve = "session_observe" ToolSessionAct = "session_act" )
View Source
const MaxOutputBytes = maxCommandOutputBytes
MaxOutputBytes is the public exec/session output contract limit used by schema generation.
Variables ¶
This section is empty.
Functions ¶
func AddRuntimeProperties ¶
func Description ¶
func Description() string
func WorkdirDescription ¶
func WorkdirDescription() string
Types ¶
type CommandContext ¶
type ConfigProvider ¶
type ExecRequest ¶ added in v0.8.2
type ExecRequest struct {
RuntimeOptions
Cmd string `json:"cmd"`
Workdir string `json:"workdir,omitempty"`
SkillRef string `json:"skill_ref,omitempty"`
Env map[string]string `json:"env,omitempty"`
TimeoutMS *int `json:"timeout_ms,omitempty"`
ExecutionMode string `json:"execution_mode,omitempty"`
YieldTimeMS *int `json:"yield_time_ms,omitempty"`
MaxOutputBytes *int `json:"max_output_bytes,omitempty"`
Stdin string `json:"stdin,omitempty"`
TTY bool `json:"tty,omitempty"`
}
ExecRequest is the stable exec_command input contract.
type RuntimeOptions ¶ added in v0.8.2
type RuntimeOptions struct {
Runtime string `json:"runtime,omitempty"`
WSLDistribution string `json:"wsl_distribution,omitempty"`
}
RuntimeOptions describes the actual command runtime. Non-Windows hosts only accept zero values.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(configProvider ConfigProvider, ws *workspace.Workspace, envs *envstore.Store, resolveSkill SkillResolver, commandContext CommandContext) *Service
func (*Service) BeginClose ¶ added in v0.8.1
func (s *Service) BeginClose()
BeginClose 先关闭新的 command reservation 入口。 Runtime 会在取消共享 commandCtx 之前等待 startup 窗口排空,避免半启动进程被抢占。
func (*Service) CommandEnv ¶
func (*Service) InternalCommandEnv ¶
func (*Service) WaitForStarts ¶ added in v0.8.1
type SessionActRequest ¶ added in v0.8.2
type SessionObserveRequest ¶ added in v0.8.2
type SkillLease ¶ added in v0.9.0
type SkillResolver ¶
type SkillResolver func(ctx context.Context, skillRef string) (SkillLease, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.