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 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"`
Skill string `json:"skill,omitempty"`
SkillEnv string `json:"skill_env,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 是 exec_command 进入命令核心后的稳定输入契约。 可选整数使用指针保留“未提供”和“显式提供 0”的区别,例如 yield_time_ms=0。
type RuntimeOptions ¶ added in v0.8.2
type RuntimeOptions struct {
Runtime string `json:"runtime,omitempty"`
WSLDistribution string `json:"wsl_distribution,omitempty"`
}
RuntimeOptions 描述命令实际执行环境。非 Windows 主机只接受零值。
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 SessionActRequest struct {
Action string `json:"action,omitempty"`
SessionID string `json:"session_id,omitempty"`
Chars string `json:"chars,omitempty"`
MaxOutputBytes *int `json:"max_output_bytes,omitempty"`
}
SessionActRequest 是 session_act 的强类型输入。
type SessionObserveRequest ¶ added in v0.8.2
type SessionObserveRequest struct {
Action string `json:"action,omitempty"`
SessionID string `json:"session_id,omitempty"`
MaxOutputBytes *int `json:"max_output_bytes,omitempty"`
}
SessionObserveRequest 是 session_observe 的强类型输入。
type SkillResolver ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.